ftilmann / latexdiff

Compares two latex files and marks up significant differences between them. Releases on www.ctan.org and mirrors
GNU General Public License v3.0
513 stars 72 forks source link

A bug on commands followed by a numeral #208

Closed pauloney closed 4 years ago

pauloney commented 4 years ago

The following two valid files:

\documentclass{report}
\begin{document}
A
\vskip0.6cm
B
\end{document}

and

\documentclass{report}
\begin{document}
A
\vskip 0.6cm
B
\end{document}

produce a latexdiff that is not processable an ends up in an error.

ftilmann commented 4 years ago

The problem here is that this is a TeX command. latexdiff expects all command arguments to be enclosed in curly braces, i.e. to confirm to the LaTeX syntax (and actually slightly restricted, as LaTeX allows single character arguments, which confuse latexdiff. There is no real way to fix this shortcoming short of recreating TeX processing within latexdiff, not a realistic prospect. On page 3 of the latexdiff manual (pdf), there is a description how you can protect such confusing text with \DIFnomarkup environment. This should work even if just applied to the new file (you might end up with some spurious crossed-out text) but I fully admit this is not really satisfactory.