Open ITWOI opened 3 years ago
It's a little bit pathological code, although of course technically correct. The easiest way to fix this would be to look for this pattern in pre-processing and make just the substitution you suggest. Would that be OK? - it would modify the .tex a little, so does not quite conform the ambition that the new file can be reconstructed from the diff'ed file. Is there ever a time, when this construction has its justification? Of course, latexdiff should cope with idiosyncratic but correct .tex It's easy enough to turn off detection for $$ entirely and would be theoretically justified as it's not strictly latex but original TeX. But I feel this would cause many more problems.
The pathological code can be easily fixed. Since it only occurs once, I have already fixed it.
It's easy enough to turn off detection for $$ entirely and would be theoretically justified as it's not strictly latex but original TeX. But I feel this would cause many more problems.
The reason for reporting this bug is that I think the way how latexdiff processes this kind of syntax is incorrect. $=$$=$
is an example, maybe there are other bug patterns.
Hi,
Here is the latex code
$=$$=$
. You can see it can be split into two parts:$=$
and$=$
. However, latexdiff mistakenly pairs the first$
and the last$
, and tries to find the second$$
.I admit the code can be easily fixed by replacing the latex code with
$==$
, but maybe it may lead to other bugs.