Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eqnarray environment changed into align* #216

Closed
smihael opened this issue Nov 8, 2020 · 2 comments
Closed

eqnarray environment changed into align* #216

smihael opened this issue Nov 8, 2020 · 2 comments

Comments

@smihael
Copy link

smihael commented Nov 8, 2020

Changes in eqnarray environments are changed to align* environments when diffed.

old.tex:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
Some text:
\begin{eqnarray}
a &=& 1 + 2, \label{eq:a}\\
b &=& 3 + 4, \label{eq:b}
\end{eqnarray}
Some additional text:
\begin{eqnarray}
c &=& 1 + 2, \label{eq:c}\\
d &=& 3 + 4, \label{eq:d}
\end{eqnarray}
\end{document}

new.tex:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\end{document}

Generated diff of the eqnarray environment:

 \DIFdelbegin \DIFdel{Some text:
}\begin{align*}
\DIFdel{a }&\DIFdel{=}& \DIFdel{1 + 2, \label{eq:a}}\\
\DIFdel{b }&\DIFdel{=}& \DIFdel{3 + 4, %DIFDELCMD < \label{eq:b}%%%
}\end{align*}%DIFAUXCMD
\DIFdel{Some additional text:
}\begin{align*}
\DIFdel{c }&\DIFdel{=}& \DIFdel{1 + 2, \label{eq:c}}\\
\DIFdel{d }&\DIFdel{=}& \DIFdel{3 + 4, %DIFDELCMD < \label{eq:d}%%%
}\end{align*}%DIFAUXCMD
%DIFDELCMD <  %%%
\DIFdelend

The generated code won't compile with error "Package amsmath Error: Multiple \label's: label 'eq:a' will be lost. }\end{align*}"
My current workaround is to manually replace all occurrences of align* back to eqnarray.

I'm using LATEXDIFF 1.3.0 (Algorithm::Diff 1.15 fast, Perl v5.30.0) shipped with KDE neon (Ubuntu 18.04 derivative).

@quentin-ag
Copy link

I face the same bug with the gather environment (instead of eqnarray), and the version 1.3.1.1 of latexdiff.

@ftilmann
Copy link
Owner

ftilmann commented Feb 8, 2022

This issue has been fixed with commit 12ddc9e and will be available in versions 1.3.3 and higher

@ftilmann ftilmann closed this as completed Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants