I'm in the process of developing a program that basically compiles a bunch of PDF files into 1 book and generates a TOC. Periodically, there are items that they want to appear in the TOC that point to the same PDF file. It could appear at any point in the TOC, so they are not consecutive. I've sorta gotten this to work using labels and \setcounter{page}{\getpagerefnumber{<label>}}, but it seems a bit cludgy, and while the TOC shows a number, it doesn't jump to the correct PDF file. Here's a sample output:

\usepackage[letterpaper, margin=1in]{geometry}
\pdfoptionpdfminorversion 7

\renewcommand {\headrulewidth}{0.4pt}
\renewcommand {\footrulewidth}{0.4pt}

\addcontentsline{toc}{chapter}{Section 1}\markboth{Section 1}{}
Section 1
\addcontentsline{toc}{section}{2-1/2X1 DOM MAL GALV REDUCER }
\addcontentsline{toc}{chapter}{Section 2}\markboth{Section 2}{}
Section 2
\addcontentsline{toc}{section}{2-1/2X1 DOM MAL GALV REDUCER }

EDIT: Just for clarification, here's a booklet generated (http://www.mtncom.net/project-files/231/VTEhz3etqH1nBhbE/). The PDF file for section 1 and 2 are the same, so it should be like:

Section 1                                  3
   blah, blah, blah ...................... 4

Section 2 6 blah, blah, blah ...................... 4

And the blah, blah, blah in Section 2 should take you to page 4 when you click on it.

Your Answer

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

Browse other questions tagged or ask your own question.