GeneralListoffigures prevents compiling

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
diamond_kid
Posts: 2
Joined: Wed Jul 10, 2013 11:38 pm

Listoffigures prevents compiling

Post by diamond_kid »

Hello,
I'm writing my bachelor thesis at the moment and I encountered a problem regarding \listoffigures.

I wrote different tex-files and \input them all togheter and the list of figures worked at the beginning, but suddenly an error occured. If I comment the command out, everything works fine. But now, even if I comment everything out, it won't compile.

This is the error message:
! pdfTeX error (ext1): \pdfendlink cannot be used in vertical mode.
\close@pdflink ...\Hy@VerboseLinkStop \pdfendlink
l.18 ...5}{\ignorespaces \@@par }}{18}{figure.2.5}
And this is the code of the master tex-file. If other information is needed, just say it :)

Code: Select all

\documentclass[a4paper,twoside,english,12pt]{scrbook}


\input{formal/packages}
\input{formal/pagestyle}

\makeindex 
\hfuzz=20pt 
\vfuzz=20pt 
\pagenumbering{alph} 
\selectlanguage{english}

\begin{document}
    \addtokomafont{captionlabel}{\sffamily\bfseries}\setcapindent{0pt}
    \renewcommand{\tocetcmark}[1]{\markboth{#1}{#1}}

    \input{formal/startpages}
    \input{summary}
    \input{zusammenfassung}
    \tableofcontents
    \input{abbriviations}

    \cleardoublepage
    \pagenumbering{arabic} 

    \input{introduction}
    \input{theory}
    \input{experiment}
    \input{results}
    \input{outlook}

    \begin{appendix}
        \cleardoublepage 
        \pagenumbering{Alph} 
        \input{appendix} 
        \input{formal/bibliography}
        \listoffigures
        \input{formal/index}
        \input{formal/endpages}
    \end{appendix}
\end{document}
Thanks in advance!

cheers, Patrick

\EDIT: Maybe the packages I use, can be helpful.

Code: Select all

\usepackage{graphicx} 
\usepackage{color} 
\usepackage{subfigure}
\usepackage[chapter,numbib]{tocbibind} 
\setcounter{tocdepth}{2}
\setlength\belowcaptionskip{15pt}

\usepackage{supertabular} 
\usepackage{fancyhdr}
\usepackage{fancybox} 
\usepackage{wrapfig} 
\usepackage{picinpar} 

\usepackage{amsmath}
\usepackage{amssymb} 
\usepackage{upgreek} 
\usepackage{pifont} 
\usepackage{textcomp} 

\usepackage{scrtime}
\usepackage[numbers,sort&compress]{natbib} 
\usepackage{makeidx}
\usepackage[english,german]{babel} 
\usepackage{units} 

\usepackage{color} 
\definecolor{darkblue}{rgb}{0,0,0.5}
\definecolor{lila}{rgb}{0.3,0,0.3}
\definecolor{turq}{rgb}{0,0.1,0.4}

\usepackage{url} 

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Listoffigures prevents compiling

Post by sommerfee »

diamond_kid wrote:! pdfTeX error (ext1): \pdfendlink cannot be used in vertical mode.
\close@pdflink ...\Hy@VerboseLinkStop \pdfendlink
l.18 ...5}{\ignorespaces \@@par }}{18}{figure.2.5}
There is a problem with your \caption of Figure 2.5, I assume you use a fragile command in there which needs protection.

Comment out this caption, delete your .aux and .lof file, and try again. If you can compile your document twice now, take a closer look at the \caption you have commented out to see what's wrong with it.
diamond_kid
Posts: 2
Joined: Wed Jul 10, 2013 11:38 pm

Re: Listoffigures prevents compiling

Post by diamond_kid »

You are right, I used \textcolor with a self-defined color and that caused the problem. \protect fixed the problem, thanks a lot!
Post Reply