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

\begin{gather/align} on input line * ended by \end{align/gather} #184

Closed nkr0 closed 4 years ago

nkr0 commented 4 years ago

Below is a very minimal latex file which can be used as both old and new, or you can make a small change in the text change.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\section{section}
    change
    \begin{subequations} % eq 1
        \begin{gather}
            \begin{align}
                a &= 1\\
                b &= 1
            \end{align}
        \end{gather}
    \end{subequations}
    \begin{equation} % eq 2
        a + b= 2
    \end{equation}
    \begin{equation} % eq 3
        \frac{a}{b} = 1
    \end{equation}
\end{document}

When I run latexdiff-vc --pdf old.tex new.tex on this, latexdiff-vc flips the closing

            \end{align}
        \end{gather}

into

            \end{gather}
        \end{align}

This results in a couple of errors as mentioned in the subject line. Now the strange part. The issue is in eq 1. But, if I delete eq 2 and/or 3, it'll disappear. Also, if I change eq 3 in such a way that it doesn't have the frac (e.g. a-b=0), it'll disappear.

Lastly, although the end statements are flipped in diff.tex, just pressing return through the errors compiles diff.pdf, and the pdf looks fine to me.