General ⇒ PDF contents (viewed in acrobat or Mac Preview) incorrect
PDF contents (viewed in acrobat or Mac Preview) incorrect
I'm generating a PDF for my PhD thesis with pdftex. It's a complicated document with many chapters, include statements, etc.
When I view the PDF in either TeXShop, Preview, or Acrobat Pro 9, the contents of the PDF are incorrect. I see only the first couple entries for the first chapter. Also, the Chapter numbers are completely missing from the contents.
Please see the attached image to make sure it's clear.
I don't really know where to start, so I'd appreciate a quick reply or idea so I can include more details here.
Thanks!
Bobby
When I view the PDF in either TeXShop, Preview, or Acrobat Pro 9, the contents of the PDF are incorrect. I see only the first couple entries for the first chapter. Also, the Chapter numbers are completely missing from the contents.
Please see the attached image to make sure it's clear.
I don't really know where to start, so I'd appreciate a quick reply or idea so I can include more details here.
Thanks!
Bobby
- Attachments
-
- Screen shot 2009-09-04 at 10.55.52 PM.png (171.36 KiB) Viewed 5121 times
NEW: TikZ book now 40% off at Amazon.com for a short time.

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
PDF contents (viewed in acrobat or Mac Preview) incorrect
It seems that the (subsection) entries without number are typeset with \subsection* and then added to the ToC with the \addcontensline command. From the picture alone this is remains unclear. Try to reduce the problem to a minimal working example (MWE) with only the necessary packages and commands.
Best regards
Thorsten
Best regards
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
PDF contents (viewed in acrobat or Mac Preview) incorrect
I've reduced it now to a surprisingly small MWE. When I compile the file below, my PDF contents are actually unchanged! So, even though I have removed all of the contents, the items in the sidebar (photo right side) still remain. Instead it should say chapters One, Two, Three. Do I need to run a separate command to get the PDF contents to compile. I'm using the newest version of TexShop (2.18) and have the options LaTeX and Pdftex checked.
thanks,
bobby
thanks,
bobby
Code: Select all
Code, edit and compile here:
\documentclass[a4paper,twoside,12pt]{book}\usepackage{graphicx}\usepackage[german,english]{babel}\begin{document}\tableofcontents\chapter{one}\chapter{two}\chapter{three}\end{document}
Re: PDF contents (viewed in acrobat or Mac Preview) incorrect
Those are only there because you've unloaded the hyperref package so it isn't updating. Delete the [filename].out and [filename].aux files, and run a few more times and it should go away.
PDF contents (viewed in acrobat or Mac Preview) incorrect
Sorry, my example was too simple. Here's another try. Now the image still looks the same.
I checked and I don't have \addcontentsline anywhere in my files.
I checked and I don't have \addcontentsline anywhere in my files.
Code: Select all
Code, edit and compile here:
\documentclass[a4paper,twoside,12pt]{book}\usepackage{graphicx}\usefont{T1}{bch}{m}{n}%\renewcommand\familydefault{bch}\usepackage{sectsty}\allsectionsfont{\usefont{OT1}{phv}{bc}{n}\selectfont}\usepackage[usenames]{color}\usepackage[german,english]{babel}\usepackage[utf8]{inputenc}\usepackage{color}\usepackage{amssymb}\usepackage{amsmath}\bibliographystyle{plainnat}\usepackage[square,authoryear,sort&compress]{natbib}\bibpunct{(}{)}{;}{a}{,}{,}\include{commands}\usepackage{hyperref}\begin{document} % preamble ends here ------------------------------------------------------\setcounter{tocdepth}{3}\tableofcontents%\mainmatter\input{one}\input{lif}
Re: PDF contents (viewed in acrobat or Mac Preview) incorrect
You're using the \input command four times to insert four other documents -- it appears that almost everything affecting the table of contents are in those other files. There is no way for us to check the output or see what is causing the problem without the files being inputted there.
Please try to actually create a minimal working example without using the \input command, and remove all code and packages unrelated to your problem.
Please try to actually create a minimal working example without using the \input command, and remove all code and packages unrelated to your problem.
PDF contents (viewed in acrobat or Mac Preview) incorrect
Now I've found a solution by going through this process (as you suggested)!
If I comment out this line
then the PDF contents are generated correctly. Otherwise it includes only the first few sections.
Now another question:
How can I include chapter and section numbers in the PDF contents?
thanks,
bobby
If I comment out this line
Code: Select all
\usepackage[twoside,varioref,rightFloats]{fltpage} % fullpage figures w/ captions on opposite side\
Now another question:
How can I include chapter and section numbers in the PDF contents?
thanks,
bobby
PDF contents (viewed in acrobat or Mac Preview) incorrect
Change \usepackage{hyperref} to \usepackage[bookmarksnumbered=true]{hyperref} -- and for more info, see the hyperref manual.