-
Notifications
You must be signed in to change notification settings - Fork 75
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
Environment "alignat" incorrectly parsed #65
Comments
Hi with the extremely simple MWE for both old and new file:
I failed to reproduce your bug. Can you construct a full MWE and attach and the exact command you used for calling. |
@ftilmann that's quick. I have been able to reproduce the following minimal example. old_min.tex \documentclass{goose-article}
\begin{document}
\begin{alignat}{2}
...
\end{alignat}
\begin{equation}\label{eq:elas:C}
\end{equation}
\begin{equation}\label{eq:elas:lam-mu}
\lambda = \frac{E \nu}{ (1+\nu)(1-2\nu)} \qquad
\end{equation}
\end{document} new_min.tex \documentclass{goose-article}
\begin{document}
\begin{alignat}{2}
...
\end{alignat}
\begin{equation}\label{eq:elas:C}
\end{equation}
\begin{equation}
\mu = \frac{E }{2(1+\nu) }
\end{equation}
\end{document} I run the following command: $ latexdiff --exclude-textcmd="section,subsection" old_min.tex new_min.tex > diff.tex To find diff.tex \documentclass{goose-article}
%DIF LATEXDIFF DIFFERENCE FILE
%DIF DEL old_min.tex Fri Nov 25 12:39:38 2016
%DIF ADD new_min.tex Fri Nov 25 12:39:41 2016
%DIF PREAMBLE EXTENSION ADDED BY LATEXDIFF
%DIF UNDERLINE PREAMBLE %DIF PREAMBLE
\RequirePackage[normalem]{ulem} %DIF PREAMBLE
\RequirePackage{color}\definecolor{RED}{rgb}{1,0,0}\definecolor{BLUE}{rgb}{0,0,1} %DIF PREAMBLE
\providecommand{\DIFadd}[1]{{\protect\color{blue}\uwave{#1}}} %DIF PREAMBLE
\providecommand{\DIFdel}[1]{{\protect\color{red}\sout{#1}}} %DIF PREAMBLE
%DIF SAFE PREAMBLE %DIF PREAMBLE
\providecommand{\DIFaddbegin}{} %DIF PREAMBLE
\providecommand{\DIFaddend}{} %DIF PREAMBLE
\providecommand{\DIFdelbegin}{} %DIF PREAMBLE
\providecommand{\DIFdelend}{} %DIF PREAMBLE
%DIF FLOATSAFE PREAMBLE %DIF PREAMBLE
\providecommand{\DIFaddFL}[1]{\DIFadd{#1}} %DIF PREAMBLE
\providecommand{\DIFdelFL}[1]{\DIFdel{#1}} %DIF PREAMBLE
\providecommand{\DIFaddbeginFL}{} %DIF PREAMBLE
\providecommand{\DIFaddendFL}{} %DIF PREAMBLE
\providecommand{\DIFdelbeginFL}{} %DIF PREAMBLE
\providecommand{\DIFdelendFL}{} %DIF PREAMBLE
%DIF END PREAMBLE EXTENSION ADDED BY LATEXDIFF
\begin{document}
\begin{align}at{2}
...
\end{align}
\begin{equation}\label{eq:elas:C}
\end{equation}
\begin{equation}\DIFdelbegin %DIFDELCMD < %DIFDELCMD < \label{eq:elas:lam-mu}%%%
%DIFDELCMD < %%%
\DIFdel{\lambda }\DIFdelend
\DIFaddbegin \DIFadd{\mu }\DIFaddend = \DIFdelbegin \DIFdel{\frac{E \nu}{ (1+\nu)(1-2\nu)} }%DIFDELCMD < \qquad
%DIFDELCMD < %%%
\DIFdelend \DIFaddbegin \DIFadd{\frac{E }{2(1+\nu) }
}\DIFaddend \end{equation}
\end{document} Note: $ latexdiff --version
This is LATEXDIFF 1.1.1 (Algorithm::Diff 1.15 so, Perl v5.18.2)
(c) 2004-2015 F J Tilmann Hope this helps! |
Thanks. I can confirm that I can reproduce this also with the latest
github version. It is truly bizarre, as removing either one of the
following equation environments lets it process correctly. Offhand, I
don't know the reason but I will look into it.
|
I agree that it is truly bizar. So much so that I had to write a Python script to iteratively trim down my file to this minimal example. |
Found the problem. The bug turned out to be in a contributed subroutine, so I had to get my head around how that one worked first. The faulty line is only activated if there is an equation with a \frac command in any equation, and the bug (currently) only affects alignat (because align starts with the same letters). |
Thanks! Really appreciate it! Yes, it is indeed from elasticity theory. We have developed an FFT-based solver for mechanics, and are about the submit the review (see https://arxiv.org/abs/1603.08893). |
I have ran into a bug concerning the following piece of LaTeX code:
In my case there is no different between the two TeX-files that I compare. However, this piece of code is parsed to the following output:
which is obviously incorrect (and problematic).
Thanks for the effort. And thanks for the great program, BTW!
Tom
The text was updated successfully, but these errors were encountered: