ftilmann / latexdiff

Compares two latex files and marks up significant differences between them. Releases on www.ctan.org and mirrors
GNU General Public License v3.0
506 stars 72 forks source link

Bug: Moving a footnote shows the content as changed #288

Closed BaumiCoder closed 4 months ago

BaumiCoder commented 9 months ago

Description

I only change the position of a footnote. This triggers latexdiff to show the content of the footnote as changed. But it have not changed.

Example

$ latexdiff --version
This is LATEXDIFF 1.3.1a  (Algorithm::Diff 1.15 fast, Perl v5.34.0)
  (c) 2004-2018 F J Tilmann
$ latexdiff footnote1.tex footnote2.tex > footnoteDiff.tex

Resulting diff PDF: footnoteDiff.pdf

footnote1.tex

\documentclass{article}

\begin{document}
    \section{A}
    content \dots more text \footnote{Something in a footnote}

    \section{B}
    content \dots 
\end{document}

footnote2.tex

\documentclass{article}

\begin{document}

    \section{A}
    content \dots 

    \section{B}
    content \dots more text \footnote{Something in a footnote}
\end{document}
ftilmann commented 4 months ago

Thanks for your comment, and apologies for the delay of many months for reply. Actually, this is desired behaviour. If you imagine the footnote being on different pages of text, then it should be marked as new, or deleted.But latexdiff cannot know on which page the footnote ends up. Also, it is not that intelligent. To figure out it is indeed the same footnote, it would need to have some overview of the whole text, and in some sense a partial re-implementation of latex functionality would be needed. This is way beyond the scope of what latexdiff aims to be. If you disagree on marking up moved footnotes on different pages, you should be able to disable that markup with option --exclude-textcmd=footnote but that also means modifications of the footnote remain undetected.