7

I have all parts of my thesis (introduction/body/results ) etc. in the table of contents. Right before the introduction I have an image (on a separate page) which currently has no title. I have been asked to give it a title/heading such that it gets included in the table of contents. I dont want to make it a chapter. How can I include it in the table of contents?

12

Add in the preamble of your document

\providecommand\phantomsection{}% for hyperref

Then before the picture

\clearpage
% Add the title here, maybe \chapter*{My image title} ????
\phantomsection
\addcontentsline{toc}{chapter}{My image title}
%Your image here ....
| improve this answer | |
  • The \providecommand\phantomsection{} is not needed if someone uses hyperref, isn't it? – Martin Scharrer Jun 28 '11 at 8:15
  • @Martin Scharrer: It is nessesary if you use hyperref to put an anchor position. Without \phantomsection hyperref will jump to the previous sectioning position. – Danie Els Jun 28 '11 at 11:02
  • I understand the need of \phantomsection, but my point is: If you use \usepackage{hyperref} you don't need to add the \providecommand\phantomsection{} line. So simply commenting the \phantomsection line with "Needed if hyperref is used" would be actually clearer, wouldn't it? – Martin Scharrer Jun 28 '11 at 11:05
  • @Martin Scharrer: My view is it good practise to always put \phantomsection before all \addcontentslines. If you add hyperref later then you do not have to change anything. Therefor the \providecommand to always provide it. – Danie Els Jun 28 '11 at 11:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.