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

Problem with alignat #251

Closed
ahaselbacher opened this issue Dec 2, 2021 · 2 comments
Closed

Problem with alignat #251

ahaselbacher opened this issue Dec 2, 2021 · 2 comments

Comments

@ahaselbacher
Copy link

I've run into a problem running latexdiff on files containing alignat. With this file, called temp-old.tex

\documentclass{article}
\begin{document}
Hello this was a test.
\end{document} 

and temp.tex

\documentclass{article}
\usepackage{amsmath}
\begin{document}
Hello this is a test.
\begin{alignat}{3}
  a& = b &\quad & \text{if} & \quad & x\ne y\\
  c& = d &      & \text{if} &       & x = y
\end{alignat}    
\end{document}

and running

latexdiff temp-old.tex temp.tex > diff.tex
pdflatex diff.tex

I get the error

! Missing number, treated as zero.
<to be read again> 
                   {
l.46 \DIFaddbegin \begin{alignat}{\DIFadd{3}}

This is not surprising because diff.tex contains

\DIFaddbegin \begin{alignat}{\DIFadd{3}}
  \DIFadd{a}& \DIFadd{= b }&\DIFadd{\quad }& \DIFadd{\text{if} }& \DIFadd{\quad }& \DIFadd{x\ne y}\\
  \DIFadd{c}& \DIFadd{= d }&      & \DIFadd{\text{if} }&       & \DIFadd{x = y
}\end{alignat}

When changed to

\DIFaddbegin \begin{alignat}{3}
  \DIFadd{a}& \DIFadd{= b }&\DIFadd{\quad }& \DIFadd{\text{if} }& \DIFadd{\quad }& \DIFadd{x\ne y}\\
  \DIFadd{c}& \DIFadd{= d }&      & \DIFadd{\text{if} }&       & \DIFadd{x = y
}\end{alignat}

everything works.

@ahaselbacher
Copy link
Author

Btw, I'm running This is LATEXDIFF 1.3.1.1 (Algorithm::Diff 1.15 so, Perl v5.30.2) on Mac OS 11.6 with LaTeX2e <2021-06-01> patch level 1

@ftilmann
Copy link
Owner

ftilmann commented Feb 7, 2022

Running this with --mathmode=FINE worked for me but might cause other problems. In any case it should be fixed properly with commit 5d7ebb4 . Thanks for reporting.

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

2 participants