TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got a large document whose table of contents is being generated by the usual \tableofcontents command. I'd really like to include a small image next to each line in the TOC. How can I do that?

EDIT: Answering the question in the comment below, I'm using Article, and I'd like a different image for each SubSection.

share|improve this question
Which document class are you using? Will the image be the same for all entries in the ToC? – Gonzalo Medina Apr 4 '11 at 22:44

Here's an example using the tocstyle package which is part of KOMA-script. (You may replace \rule with \includegraphics from the graphicx package.) Graphics for the "section" ToC entries may be changed using \setsectiongraphics.



  \addtocontents{toc}{\protect\renewcommand{\sectiongraphics}{\protect #1}}%

\settocstylefeature{entryhook}{\rule{0.15cm}{0.15cm}\hspace{0.15cm}}% for all ToC levels
    {\sectiongraphics\hspace{0.3cm}\bfseries}% "[1]" for sections









enter image description here

share|improve this answer
Can i add different picture for different chapter? – manish Jan 24 '13 at 3:56
@manish See updated answer. – lockstep Jan 24 '13 at 11:15
i need output like chapter name and below to that image name. Infront of it index (page number). Is this possible to implement it. – manish Jan 25 '13 at 15:35

Your Answer


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.