Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Using latexdiff I have the problem, that by adding new \section, I get the following error by trying to run pdflatex.

! Argument of \UL@word has an extra }.
<inserted text> 
                \par 
l.69 \subsection{\DIFadd{Some Text}}

Here you can see the redefined \section command...

\renewcommand{\section}{%
\@startsection{section}%
{1}     % Structure level
{0mm}   % Indention
{2ex plus 1ex minus 1ex}            % Pre-Margin
{0.5ex plus 0.5ex minus 0.5ex}      % Post-Margin
{\chapterheadfont\Large\bfseries}   % Style
}
\renewcommand{\subsection}{%
\@startsection{subsection}%
{2}     % Structure level
{0mm}   % Indention
{1.5ex plus 1ex minus 0.5ex}        % Pre-Margin
{0.3ex plus 0.3ex minus 0.3ex}      % Post-Margin
{\chapterheadfont\large\bfseries}   % Style
}

How can I fix the problem? It would work for me also to ignore the changed section names.

share|improve this question
1  
Welcome to TeX.sx! We'd like to keep answers separate from questions, so you should write a separate answer instead of editing your answer into the question. Self-answers are perfectly admissible, and a well-written answer may earn you additional reputation. –  lockstep Dec 18 '12 at 18:28

2 Answers 2

up vote 5 down vote accepted

(OPs answer, moved from the question.)

I thought it would be complexer, but I found a solution. Using --exclude-textcmd allows the ignoring of tags. It works now.

--exclude-textcmd="section,subsection"
share|improve this answer

It's difficult without an MWE, but 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
...
share|improve this answer
    
I've tried your solution, but it doesn't work. I get the same errors like before. –  aphex Dec 18 '12 at 22:51
    
@aphex Then please provide an MWE –  Jörg Dec 19 '12 at 9:16
    
@Jörg I seem to be suffering from the same issue. In my document i have a section "Conclusions". When i set this as a comment my latexdiff file compiles as normal. However if i have this as a section, the same error appears: Argument of \UL@word has an extra }. <inserted text> \par l.1411 \DIFaddbegin \section{\DIFadd{Conclusion}} –  wierts Nov 22 '13 at 14:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.