typst / webapp-issues

Issue tracker for Typst's web app.
https://typst.app
10 stars 0 forks source link

git-latexdiff like functionality #55

Open fangrh opened 1 year ago

fangrh commented 1 year ago

Description

I am writing to propose the inclusion of a git-latexdiff like functionality in Typst to enhance collaboration during the writing process of LaTeX documents. Currently, in LaTeX, tools like git-latexdiff (found at https://gitlab.com/git-latexdiff/git-latexdiff) offer the ability to mark changes between the current and previous Git versions of a document in PDF.

Use Case

This feature proves to be incredibly useful, especially in collaborative writing scenarios.

baptiste commented 8 months ago

I agree it would be super useful to have a tool like latexdiff (and hopefully better at handling things like bibtex, figures, etc.).

My probably naive way of thinking about this problem would be:

  1. We have two ASTs. Comparing trees and merging them probably has a standard solution in Rust that can be reused.

  2. The changes need to be identified with a start and end point, so the content in-between can be styled appropriately (red/blue, or more fancy background, strikethrough, etc.). The pinit package seems to have a neat interface for this (I don't know if it can handle all cases robustly enough, but it looks promising).