1

I'm currently using TeXworks 0.4.5 with Windows 7 SP1 and MikTeX 2.9 to compile a thesis template that was constructed by a colleague. (If you would like to see the template, click here). This includes \special commands, which should mean the resulting PDF generated by LaTeX has the table of contents built into the PDF itself as bookmarks (allowing for easier navigation in PDF readers). One of these commands is given below.

\special{pdf: out 1 << /Title (\thechapter. Introduction) /Dest [@thispage /FitH @ypos] >>}

However, when I compile the document, Acrobat says 'An error exists on this page. Acrobat may not display the page correctly. Please contact the person who created the PDF document to correct the problem.' It also refuses to display the page that the bookmark created by \special should point to.

I know that it is definitely the \special commands causing the issue, since commenting them out fixes the problem.

Does anyone know how to generate a table of contents that is compatible with Acrobat, either by altering the \special command or by using some other method to do so?

  • Hi and welcome, what exactly is the template link? As far as i can tell by the bit of code found at the linked site, i can only say: Be careful, part of this should not be done. – Johannes_B Oct 27 '14 at 16:33
  • using \special restricts you to latex (normally) it's usually better to let hyperref deal with this then it will use whatever is required depending if you are using latex or pdflatex, and add it automatically without you requiring to put anything other than the standard \section{zzz} markup. – David Carlisle Oct 27 '14 at 16:33
  • There is also bookmark (which uses hyperref) or navigator. – cfr Oct 27 '14 at 17:08
  • @Johannes_B Which part ought not be done? – cfr Oct 27 '14 at 17:13
  • @cfr Please look down to the Handy Tips part and especially to Split figures. Do you consider this clean coding? – Johannes_B Oct 27 '14 at 17:17
2

If you use package hyperref you will get the inbuild bookmarks of hyperref. If you want to configure the bookmarks you can load package bookmark after hyperref. See texdoc hyperref and texdoc bookmark for more information or search this side ;-)

Give the following a try:

\usepackage[hypcap=true]{hyperref}  % hypcap corrects an error pointing to images 
%\usepackage{bookmark}              % delete leading % if ypou want to try it

So each \chapter or \sectionor ... will be bookmarked. You do not need further more \special.

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.