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
514 stars 72 forks source link

an uncompilable output with \left( and \right) #196

Closed rsato64 closed 4 years ago

rsato64 commented 4 years ago

I found a problem when I run latexdiff old.tex new.tex with the following source files.

old.tex:

\documentclass{article} \begin{document} text \end{document}

new.tex:

\documentclass{article} \begin{document} text \begin{eqnarray} \left( {\cal A} \right) \end{eqnarray} \end{document}

The output is

\begin{document} text \DIFaddbegin \begin{eqnarray} \DIFadd{\left( }{\DIFadd{\cal A}} \DIFadd{\right) }\end{eqnarray} \DIFaddend\end{document}

This output is uncompilable.

ftilmann commented 4 years ago

Actually, when I try to compile I get an error message but if I skip this and a few following (or use pdflatex -interaction=nonstopmode the output generated is actually correct). Or, if in new.tex, the unneeded set of braces are removed, i.e. if the eqn array environment is written as \left( \cal{A} \right), then the processing is done correctly, too. (The need to always using braces for arguments is one of the documented latexdiff limitations, so I wrote \cal{A} instead of \cal A, even though the latter would work in this particular instance). Although this is not perfect, and your report is in principle a bona-fide bug report, I will close this issue, as there is no easy fix, and a fix is not really needed.