Skip to content

latexdiff should add more braces to usual commands #326

@EB2000

Description

@EB2000

Hi!

latexdiff makes some effort to add some braces where needed to be able to process inputs such as \frac ab instead of \frac{a}{b}. unfortunately, it is not enough to cover all usual cases.

  • Using modern engines (such as lualatex) and package unicode-math, it is possible to type commands such as \frac αβ, which latexdiff will fail to brace properly.
  • Using again engines such as lualatex, it is possible to define commands with unicode letters, such as \résumé or . latexdiff will fail to add braces to \frac \Δ 2.
  • Many commands beyond \frac are often used without braces. latexdiff could do the same kind of preprocessing as for frac to these commands. For instance, right now, latexdiff will output incorrect latex if asked to highlight the differences between x \in \mathbb R and x \in \mathbf R in an equation environment. latexdiff could maintain a list of commands with one arguments (such as \mathbb), with two arguments (such as \frac), etc. and add braces when needed to the arguments.

For information, this is not theoretical: I am using these constructs in my documents. (For instance, \Δ is \symup{Δ} to have an upright Δ, while Δ alone is slanted.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions