GeneralPDF contents (viewed in acrobat or Mac Preview) incorrect

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
zillions
Posts: 11
Joined: Fri Sep 04, 2009 10:45 pm

PDF contents (viewed in acrobat or Mac Preview) incorrect

Post by zillions »

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
Attachments
Screen shot 2009-09-04 at 10.55.52 PM.png
Screen shot 2009-09-04 at 10.55.52 PM.png (171.36 KiB) Viewed 5078 times

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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

PDF contents (viewed in acrobat or Mac Preview) incorrect

Post by localghost »

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
zillions
Posts: 11
Joined: Fri Sep 04, 2009 10:45 pm

PDF contents (viewed in acrobat or Mac Preview) incorrect

Post by zillions »

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


Code: Select all

\documentclass[a4paper,twoside,12pt]{book}
\usepackage{graphicx}

\usepackage[german,english]{babel}

\begin{document}

\tableofcontents

\chapter{one} 

\chapter{two}

\chapter{three}

\end{document}
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: PDF contents (viewed in acrobat or Mac Preview) incorrect

Post by frabjous »

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.
zillions
Posts: 11
Joined: Fri Sep 04, 2009 10:45 pm

PDF contents (viewed in acrobat or Mac Preview) incorrect

Post by zillions »

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.


Code: Select all

\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}
\appendix
\input{makeglos.gls}
\input{additional_models}


\bibliography{all}

\end{document}
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: PDF contents (viewed in acrobat or Mac Preview) incorrect

Post by frabjous »

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.
zillions
Posts: 11
Joined: Fri Sep 04, 2009 10:45 pm

PDF contents (viewed in acrobat or Mac Preview) incorrect

Post by zillions »

Now I've found a solution by going through this process (as you suggested)!

If I comment out this line

Code: Select all

\usepackage[twoside,varioref,rightFloats]{fltpage}  % fullpage figures w/ captions on opposite side\
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
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

PDF contents (viewed in acrobat or Mac Preview) incorrect

Post by frabjous »

Change \usepackage{hyperref} to \usepackage[bookmarksnumbered=true]{hyperref} -- and for more info, see the hyperref manual.
Post Reply