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.

I used latexdiff to generate a tex document with the differences between two other tex documents. This worked fine, but when I try to generate a PDf from the diff document I always get this error:

''! Undefined control sequence. 
l.20 \DIFdelbegin 
\DIFdel{In this chapter all the necessary information to f... 

? '' 

I think the problem is that I should include a package or something like that in my diff document, but I don't know which one. Any hints?

Here is the beginning of my diff document:

\documentclass[12pt,a4paper]{article}

\RequirePackage{changebar}
\RequirePackage{ulem}
\RequirePackage{color}

\newcommand\TLSins[1]{
\cbstart{}%
\textcolor{blue}{\uline{#1}}%
\cbend{}%
}

\newcommand\TLSdel[1]{
\cbdelete{}%
\textcolor{red}{\sout{#1}}%
}

\begin{document}

\DIFdelbegin \DIFdel{In this chapter all the necessary information to fully understand the actual application is presented. First, a short overview about the history of multi-touch interfaces is provided. Particular attention is paid to the Microsoft Surface that was used to develop this application. Since the application is used to automatically detect code smells in a software project, the chapter \textit{\nameref{chp:metrics}} explains how code metrics can be used to detect code smells. Finally this chapter addresses how the necessary structural information and code metrics of a software project were retrieved from a web service in order to perform a code smell analysis. }%DIFDELCMD < 

%DIFDELCMD < \FloatBarrier
%DIFDELCMD < %%%
\section{\DIFdel{The history of multi-touch user interfaces}}
%DIFAUXCMD
\addtocounter{section}{-1}%DIFAUXCMD
\DIFdel{The user interface is the place where the }\DIFdelend \DIFaddbegin \section{\DIFadd{Motivation}}
\DIFadd{User interfaces are one of the fastest changing areas in software engineering. Not long ago \textit{Command Line Interfaces (CLI)} were the only available input method. \textit{Graphical User Interfaces (GUI)} changed the }\DIFaddend interaction between humans and \DIFdelbegin \DIFdel{machines takes place. Most user interfaces allow bidirectional interactions. This means the user has the possibility to enter input in order to manipulate and control the system and the machine has the possibility to create output to inform the user about the effects of its inputs. The basic goal of all user interfaces is to require minimal input in order to produce the desired output while minimizing the undesired output at the same time.}%DIFDELCMD < \\
%DIFDELCMD < 
share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

You either need to tell latexdiff to insert its command definitions in the preamble of the output file (see man latexdiff), or insert these definitions in the appropriate file manually.

The latter is safer, if you are using a main file in which you are including other files.

Try inserting this in the preamble of your main .tex file:

%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
share|improve this answer
    
Thanks. Now i proceeds further but I get this error: ! Extra }, or forgotten \endgroup. \UL@stop ...z@ \else \UL@putbox \fi \else \egroup \egroup \UL@putbox \fi \if... l.149 ...ze of a software project can be derived.} %DIFDELCMD < \? –  RoflcoptrException Apr 6 '11 at 9:31
    
Can you copy-paste the problematic line and its immediate context? Try pastebin.com –  Nyiti Apr 6 '11 at 9:38
    
I added the problematic paragraph. The error is in the last line: pastebin.com/embed_js.php?i=4h8PTY9T –  RoflcoptrException Apr 6 '11 at 9:40
1  
Try removing the \footnote, maybe it breaks the \DIFdel –  Nyiti Apr 6 '11 at 9:47
1  
Thanks that solved the problem! But slowly I get the feeling that latexdiff is a little bit useless since I already have a new error: ! You can't use `macro parameter character #' in restricted horizontal mode. <argument> ...g/ontologies/seon/2009/06/java.owl## > l.327 WHERE } %DIFDELCMD < { ? . The problem seems to be that in my code listing I'm using # symbol. When I remove the listing it works... But what is the purpose of latexdiff if I have to go manually through my document and replace a lot of things anyway? –  RoflcoptrException Apr 6 '11 at 9:53
show 1 more comment

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.