ClassicThesis sections and latexdiff

Issue #34 on hold
Former user created an issue

``` I'm trying to use ClassicThesis in combination with latexdiff (to generate PDFs in which the changes between versions are highlighted). When a (sub)section title is changed, the tex file generated by latexdiff cannot be compiled into a PDF using pdflatex. I've reproduced the problem using the latest version of ClassicThesis with minimal changes.

What steps will reproduce the problem?

(Note: for convenience I attached the tex files.)

1. Take a clean version of ClassicThesis

2. Create a new version of Chapter01

cd Chapters cp Chapter01.tex Chapter01-vs02.tex

3. Edit a section title, for example

< \section{Organization} ---

\section{Organization edit}

4. Run latexdiff to generate a new tex file

latexdiff Chapter01.tex Chapter01-vs02.tex > Chapter01-diff.tex dos2unix Chapter01-diff.tex

5. Include Chapter01-diff.tex in ClassicThesis.tex

< \include{Chapters/Chapter01} ---

\include{Chapters/Chapter01-diff}

6. Add the latexdiff preamble to ClassicThesis.tex (e.g. directly below Hyphenation)

%************** % Hyphenation %*********** %\hyphenation{put special hyphenation here}

%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

7. Run pdflatex

pdflatex ClassicThesis.pdf

What is the expected output? What do you see instead?

The PDF is not generated and the errors below are given. Manually removing the latexdiff additions in the latex file allows the PDF to be generated.

[3] Runaway argument? ! Paragraph ended before \let was complete. <to be read again> \par l.86 ...ion \DIFaddbegin \DIFadd{edit}\DIFaddend }

? ! Undefined control sequence. \UL@on ...\let \hskip \UL@hskip \let \par \UL@par \let
\UL@cr \let \-\UL@d... l.86 ...ion \DIFaddbegin \DIFadd{edit}\DIFaddend }

? ! Argument of \UL@word has an extra }. <inserted text> \par l.86 ...ion \DIFaddbegin \DIFadd{edit}\DIFaddend }

? Runaway argument? \@empty ! Paragraph ended before \UL@word was complete. <to be read again> \par l.86 ...ion \DIFaddbegin \DIFadd{edit}\DIFaddend }

? Runaway argument? Organization {\protect \protect \<>-\@ifnextchar {blue}\protect #I\setbox \ETC. ! Paragraph ended before \HyPsd@@ProtectSpacesFi was complete. <to be read again> \par l.86 ...ion \DIFaddbegin \DIFadd{edit}\DIFaddend }

? ! Undefined control sequence. \Hy@tempa ...\UL@skip \tw@ \UL@pixel \UL@leadtype \LA@hskip \UL@skip \LA@hsk... l.86 ...ion \DIFaddbegin \DIFadd{edit}\DIFaddend }

? ! Undefined control sequence. \Hy@tempa ...nskip \unskip \<let>-command \UL@vad \vadjust \<>-\new@ifnextch... l.86 ...ion \DIFaddbegin \DIFadd{edit}\DIFaddend }

? ! Undefined control sequence. \Hy@tempa ...\UL@vad \vadjust \<>-\new@ifnextchar \<let>-command \-\global \... l.86 ...ion \DIFaddbegin \DIFadd{edit}\DIFaddend }

? ! Undefined control sequence. \Hy@tempa ...\UL@skip \tw@ \UL@pixel \UL@leadtype \LA@hskip \UL@skip \LA@hsk... l.86 ...ion \DIFaddbegin \DIFadd{edit}\DIFaddend }

? ! TeX capacity exceeded, sorry [input stack size=5000]. \-->\discretionary {-}{} {} l.86 ...ion \DIFaddbegin \DIFadd{edit}\DIFaddend }

! ==> Fatal error occurred, no output PDF file produced! Transcript written on ClassicThesis.log.

What version of the product are you using? On what operating system?

  • Latest Ubuntu Linux + Windows 7 + MacOSX 10.6. Same results everywhere.
  • ClassicThesis 3.0
  • texlive installation via macports (or on Linux via a package manager, or Miktex on Windows) texlive-basic @23152_1+doc (active) texlive-bin @2011_1+motif+x11 (active) texlive-bin-extra @23089_1+doc (active) texlive-common @2011_0 (active) texlive-context @23171_0+doc (active) texlive-documentation-base @23160_0+doc (active) texlive-fonts-extra @22691_0+doc (active) texlive-fonts-recommended @23165_0+doc (active) texlive-generic-recommended @23088_0+doc (active) texlive-lang-cyrillic @23092_0+doc (active) texlive-latex @23089_0+doc (active) texlive-latex-extra @22931_0+doc (active) texlive-latex-recommended @23089_0+doc (active) texlive-math-extra @23089_0+doc (active) texlive-metapost @23089_0+doc (active) texlive-pictures @22961_1+doc (active) texlive-science @22994_0+doc (active) texlive-xetex @23080_0+doc (active)

Please provide any additional information below.

Potentially an additional issue: "\ref{}" is deleted from the source text. The latexdiff tex version gives errors when a pdf is generated with pdflatex.

```

Original issue reported on code.google.com by `Jochem.Liem` on 2011-10-10 08:51:32 <hr>

Comments (6)

  1. André Miede repo owner

    ``` Thanks for the information. I've reproduced the errors and tried a couple of things in order to resolve them (pdfspacing, minionprospacing, plain classicthesis, ...). However, it seems that the spacing commands for getting these awesome-looking ;-) headings don't work with the diff-commands. (Outside of headings it works, though.)

    ```

    Original issue reported on code.google.com by `amiede` on 2011-10-10 18:32:36 - Labels added: Type-Other - Labels removed: Type-Defect

  2. Former user Account Deleted

    ``` Do you think it is worthwhile to report this as a bug at latexdiff or any of the other packages? ```

    Original issue reported on code.google.com by `Jochem.Liem` on 2011-10-11 08:24:43

  3. André Miede repo owner

    ``` I did one more test, the issue seems to be the fancy underlining. Using just \providecommand{\DIFadd}[1]\protect\color{blue}#1 \providecommand{\DIFdel}[1]\protect\color{red}#1 compiles w/o errors. Makes sense, that such a thing causes trouble with spacings. ```

    Original issue reported on code.google.com by `amiede` on 2011-10-11 18:37:00

  4. Former user Account Deleted

    ``` I corresponded with Donald Arseneau (the developer of ulem) about this issue. Also, I managed to reproduce the problem without latexdiff. Only adding \sout to a section will cause problem. Donald suggests that maybe classicthesis does some redefinitions which breaks the selfprotected ulem commands. Below the email correspondence.

    Dear Mr. Arseneau,

    Thank you for the ulem package. I use it daily (through the latexdiff tool).

    I'm experiencing an incompatability with ulem and the the classicthesis template [1]. Adding an \sout or \uwave (as latexdiff does) to a \chapter or \section title results in an error message (see below). Ignoring these messages by continuing results in the PDF not being generated.

    The problem can be reproduced downloading the classicthesis template from [1]. Adding '\usepackage[normalem]{ulem}' to ClassisThesis.tex, and adding \uwave{abc} anywhere in a Section or Chapter. The result when running pdflatex is the error below.

    I was not sure how to report bugs for CTAN packages, but found your email-address in the documentation of ulem. Would it be possible for this incompatability to be resolved?

    Thank you for your time.

    Best regards, Jochem Liem

    [1] http://www.ctan.org/tex-archive/macros/latex/contrib/classicthesis/

    Runaway argument? ! Paragraph ended before \let was complete. <to be read again> \par l.86 \section{Organization \uwave{xxx}}

    Donald's response

    I'm experiencing an incompatability with ulem and the the classicthesis template [1]. Adding an \sout or \uwave (as latexdiff does) to a \chapter or \section title results in an error message

    Runaway argument? ! Paragraph ended before \let was complete. <to be read again> \par l.86 \section{Organization \uwave{xxx}}

    See the TeX faq items about fragile commands, moving arguments, and \protect.

    http://www.tex.ac.uk/cgi-bin/texfaq2html?label=extrabrace http://www.tex.ac.uk/cgi-bin/texfaq2html?label=protect

    \uwave is self-protecting though, so I blame some redefinition done by classicthesis that breaks LaTeX's \protect mechanism.

    http://www.tex.ac.uk/cgi-bin/texfaq2html?label=edef

    I suspect maybe hyperref. If so, you should provide optional arguments for your sections with safe clean text to use as pdf bookmark names.

    Aside from that problem, the text that goes inside \uline, \sout or \uwave is quite restricted, so tagging random text that way with latexdiff is bound to require some manual clean-up.

    A work around to work with latexdiff

    To work with latexdiff and still have the removed text clearly visible, I now use \scriptsize to show the removed text. I have not found a nice way to show the added text (in black & white prints).

    \providecommand{\DIFadd}[1]\protect\color{blue}#1 %DIF PREAMBLE \providecommand{\DIFdel}[1]\protect\color{red}\protect\scriptsize{#1}

    ```

    Original issue reported on code.google.com by `Jochem.Liem` on 2011-10-18 12:06:34

  5. Log in to comment