# Error when trying to generate a PDF from a latexdiff document

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
\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 <


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{\DIFdel}[1]{{\protect\color{red}\sout{#1}}}                      %DIF PREAMBLE
%DIF SAFE PREAMBLE %DIF PREAMBLE
\providecommand{\DIFdelbegin}{} %DIF PREAMBLE
\providecommand{\DIFdelend}{} %DIF PREAMBLE
%DIF FLOATSAFE PREAMBLE %DIF PREAMBLE

• Try removing the \footnote, maybe it breaks the \DIFdel – Gambhiro Apr 6 '11 at 9:47