Problem using latexdiff and pdflatex with changes inside sections

Issue #101 invalid
Former user created an issue
Running latexdiff (LATEXDIFF 1.0.4  (Algorithm::Diff 1.1902, Perl v5.18.2)) with changes
inside section or subsection I got:
Argument of \UL@word has an extra } ...begin\DIFadd{Some Text}\DIFaddend}

I found that applying what advised in http://tex.stackexchange.com/questions/87536/problem-using-latexdiff-and-pdflatex-with-custom-command
solves the problem.

In particular:
"I would assume that the difficulty is with hyperref, which tries to include underlined/crossed
out text as hyperlink given that it is part of a chapter.

The solution is to use texorpdfstring, which tells hyperref to use plain text for the
hyperlinks. I can't remember the exact commands that latexdiff definds, but try something
like that:

% Redefine these commands for chapter/sections and change below
\DeclareRobustCommand{\hsout}[1]{\texorpdfstring{\sout{#1}}{#1}}
\DeclareRobustCommand{\hwave}[1]{\texorpdfstring{\uwave{#1}}{#1}}

%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\textcolor{blue}{\hwave{#1}}}}% DIF PREAMBLE
\providecommand{\DIFdel}[1]{{\protect\textcolor{red}{\hsout{#1}}}}% DIF PREAMBLE
"

Even --exclude-textcmd="section,subsection" works, but I lose the edits into  the subsection.

Thanks, Alex

Original issue reported on code.google.com by pacini409 on 2015-02-22 17:08:42

Comments (2)

  1. Former user Account Deleted
    Sorry, I am in the wrong place xD
    

    Original issue reported on code.google.com by pacini409 on 2015-02-22 17:12:48

  2. André Miede repo owner
    No problem, I will close the issue then.
    

    Original issue reported on code.google.com by amiede on 2015-03-04 19:41:36 - Labels added: Type-Other - Labels removed: Type-Defect

  3. Log in to comment