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

when changing \begin{math}-->\begin{equation}: no differences are displayed in pdf #244

Closed
ouboub opened this issue Oct 15, 2021 · 1 comment

Comments

@ouboub
Copy link

ouboub commented Oct 15, 2021

Hi
Old file

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

New file:

\begin{document}
\begin{equation}
  \int f dx =0
\end{equation}
\end{document}

using latexdiff-1.3.0

with

/usr/local/bin/latexdiff-vc --so --math-markup=3  --driver=pdftex

changing math-markup from 3 to 2, to, 1, to 0.

then the corresponding diff files give me a pdf without any visible differences. What is the problem?
replace-equation-diff0.pdf

@ftilmann
Copy link
Owner

ftilmann commented Feb 9, 2022

Sorry for the long latency in reacting. Actually when I tested it, I got error messages on compiling the DIFF file with --math-markup equal to 1 (WHOLE) or 2 (COARSE), as latexdiff did not know about the math environment. This is now fixed by 0d71987 and compilable code results from all math markup modes. The way it's displayed is not quite perfect, though. In FINE (3) mode, the change remains invisible. This is more or less a feature. Format changes are generally not highlighted, and rather the formatting of the new text is adopted (also e.g. changes to type for text). However, this change is marked in the source file, of course.

In WHOLE or COARSE math markup modes, the equation is shown as deleted (without equation number) and added (with equation number). It's not quite good, as also the deleted equation is shown in display math format rather than as inline text format. This would not be difficult to fix, in principle, but would add yet another special case, so in striking a balance with regard to code maintainability I opted to live with this slight imperfection. Correct markup in inline text format will result from use of either $..$ or \(...\) instead of math environment (and the change will then show up for all choices of --math-markup option except NONE. If you feel strongly that correct (i.e. inline) math formatting is important for deleted math environment, please open a new issue.

PS I hope you do not mind that I used your MWE in constructing an example for a test in testsuite

@ftilmann ftilmann closed this as completed Feb 9, 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

2 participants