Graphics, Figures & Tables ⇒ Graphics in table of contents
Graphics in table of contents
I'm trying to do something like below where I have a small icon in the section heading and the same image in the table of contents, but I get a "! Missing \endcsname inserted." error when I try.
MWE
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\tableofcontents
\section{ Section \includegraphics[height=1.25ex]{foo.pdf} Heading}
\end{document}
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Re: Graphics in table of contents
I tried your MWE and get the same error. I tried to replace the parameter [height=1.25ex] with something like [scale=0.5] and get the same error.
I tried with no parameter at all and get an output PDF, but there are two errors yet. Those errors are "! Argument of \@sect has an extra }.", and "! Paragraph ended before \@sect was complete.". Although, the errors seem not to affect the output PDF.
http://latexlive.wordpress.com/
TeX Live 2009/TeXmaker
Powered by Debian Squeeze
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Graphics in table of contents
Code: Select all
\section{Section {\includegraphics[height=1.25ex]{foo}} Heading}Best regards and welcome to the board
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Graphics in table of contents
I tried the extra curly brackets but it doesn't seem to make any difference.
I tried without the parameter at all and get the same error that joe74 got. I do eventually get an output file, but for me there is no contents line for the section with the image.
Has anyone ever seen putting an image in the table of contents work or am I in uncharted territory here?