15

I try to use latexdiff to point out changes I have made in a document to the other people who need to read it and give me their advice... However, I've been getting this error:

Runaway argument?
{En rajoutant aux interactions la seconde main, qui dans notre cas es\ETC.
! Paragraph ended before \UL@on was complete.
<to be read again> 
               \par 
l.8 }
   %DIFDELCMD <
?

regarding this section of code produced by latexdiff :

 \DIFdelbegin \DIFdel{En rajoutant aux interactions la seconde main, qui dans notre cas est la main gauche, l'interface pourrait devenir plus intuitive et plus facile à utiliser.

}%DIFDELCMD < 

%DIFDELCMD < %%%
\DIFdelend

Where \DIFdelbegin, \DIFdel, \DIFdelend are defined as (in my main .tex, added automagically by latexdiff) :

\providecommand{\DIFdel}[1]{{\protect\color{red}\sout{#1}}} %DIF PREAMBLE
\providecommand{\DIFdelbegin}{} %DIF PREAMBLE
\providecommand{\DIFdelend}{} %DIF PREAMBLE

What's wrong & what can I do now?

EDIT : If I replace the \sout{#1} by just #1 (i.e., remove the strike-through formatting), it works, but that strike-through kinda was the best feature of it, making it easy to spot what was removed. Is there another formatting command that would not break with a new paragraph?

If there was a strikethrough environment I could probably use it (by placing a \begin{strikethrough} in \DIFdelbegin and an \end{strikethrough} in \DIFdelend), but I don't think there is one.

Hendrik Vogt
  • 37,935
levesque
  • 12,993
  • 12
  • 43
  • 52
  • 1
    If you remove the blank line in the argument to \DIFdel, does the error persist? – Willie Wong Nov 07 '10 at 19:32
  • 1
    No, but that's part of the problem. Latex diff is inserting this line automatically, I can't be editing all my files manually after latexdiff has parsed them, I'd rather look for another solution than be forced to do it manually. – levesque Nov 07 '10 at 19:37

5 Answers5

7

I had exactly the same problem. Latexdiff seems to introduce Windows line endings, which seemed to caused the problem.

I now run dos2unix on the resulting latexdiff tex files and the problem has disappeared.

I'm running latexdiff 0.5 (Algorithm::Diff 1.15 so)

5

I got the same problem when I was doing difflatex in Mac. The exact same error ! What I did was moved up the "}" sign that was causing the problem to the the end of the paragraph and it worked. Don't ask me why, but it worked for me !!!

hpesoj626
  • 17,282
Shree
  • 51
3

Instead of \sout, try the \st command from the soul package.

Willie Wong
  • 24,733
  • 8
  • 74
  • 106
0

For me worked defining a new command hsout according to this post, which takes care of having multiple paragraphs in the command sout from the package ulem. Also using the definitions for \DIFadd and \DIFdel which take care of the using the color command for multiple paragraphs as suggested here, {\color{<color>}{...}}

\RequirePackage{color} %DIF PREAMBLE
\RequirePackage[normalem]{ulem} %DIF PREAMBLE
\newcommand\hsout[1]{\let\helpcmd\sout\parhelp#1\par\relax\relax} %<-- new command
  \long\def\parhelp#1\par#2\relax{%
    \helpcmd{#1}\ifx\relax#2\else\par\parhelp#2\relax\fi%
  }
\providecommand{\DIFadd}[1]{{\color{blue}{#1}}}       %DIF PREAMBLE
\providecommand{\DIFdel}[1]{{\color{red}\hsout{#1}}}  %DIF PREAMBLE
0

I had the same problem caused by the \hspace inserted after citation commands, unfortunately the other answers here didn't help. For a quick and relatively sane workaround, modifying the "safe commands" list of latexdiff works pretty well. In my case, adding this option has fixed it:

latexdiff --exclude-safecmd='cite,citep,citet'   [....]
exa
  • 98
  • 6