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

math environment is not marked up properly #257

Open ouboub opened 2 years ago

ouboub commented 2 years ago

Hi

thanks for the fix. I pulled and reinstalled. I still think that the use of \begin{math} \end{math} is useful instead of ()

  1. If I quickly want to change in a region from {equation} to {math} the query replace function is easier.
  2. Sometimes people tend to have even longer latex constructs inline, then \begin{math} \end{math} improves the display.

Be it as it may I see quite a difference when using

alt.tex

\documentclass[12pt]{article}
\begin{document}
\(  \int f dx =0\)
\end{document}

new.tex

\documentclass[12pt]{article}
\begin{document}
\begin{equation}
  \int f dx =0
\end{equation}
\end{document}

Compared to having the old file as

old.tex

\documentclass[12pt]{article}
\begin{document}
\begin{math}
  \int f dx =0
\end{math}
\end{document}

I run

/usr/local/bin/latexdiff --math-markup=3 --driver=pdftex alt.tex new.tex > diff1.tex

and

/usr/local/bin/latexdiff --math-markup=3 --driver=pdftex old.tex new.tex > diff2.tex

And

/usr/local/bin/latexdiff --math-markup=1 --driver=pdftex alt.tex new.tex > diff10.tex
/usr/local/bin/latexdiff --math-markup=1 --driver=pdftex old.tex new.tex > diff20.tex

I attach the pdfs

Frankly in my view, ( ) is treated correctly but \begin{math}\end{math} no.

So if you could deal with that case I would appreciate this

regards diff1.pdf

diff2.pdf diff10.pdf diff20.pdf