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

\newcommand is mixed #237

Open
impact27 opened this issue Jul 20, 2021 · 1 comment
Open

\newcommand is mixed #237

impact27 opened this issue Jul 20, 2021 · 1 comment
Labels

Comments

@impact27
Copy link

impact27 commented Jul 20, 2021

1- Create a file (test.tex) with:

\documentclass{article}
\usepackage[utf8]{inputenc}
\begin{document}

\newcommand{\be}{\begin{equation}}
\newcommand{\ee}{\end{equation}}

\end{document}

2- latexdiff test.tex test.tex > diff.tex

I get:

\documentclass{article}
%DIF LATEXDIFF DIFFERENCE FILE
%DIF DEL old.tex   Tue Jul 20 08:47:56 2021
%DIF ADD old.tex   Tue Jul 20 08:47:56 2021
\usepackage[utf8]{inputenc}
%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}

\newcommand{\be}{\begin{equation}\end{equation}
\newcommand{\ee}{}}

\end{document}

Notice the \newcommand lines are mixed together.

This is LATEXDIFF 1.2.1  (Algorithm::Diff 1.15 so, Perl v5.30.0)
  (c) 2004-2017 F J Tilmann
@ftilmann
Copy link
Owner

You have discovered a way to fool latexdiff. In the current framework it's not that easy to fix. Can you move these definitions into the preamble? Alternatively, with --math-markup=3 it works. Thank you for your report, but the amount of effort to address this combined with it being quite an unusual setup, mean I will not address this in foreseeable future. As it's a bug I will leave the issue open, though
(in case you are suprised to get a reaction so late. I was unable to allot much time to latexdiff in the last few months; I now try try to got through the backlog of issues and prioritise them)

@ftilmann ftilmann added the Low label Feb 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants