tags:

views:

28

answers:

2

This question is a follow on from the one that was asked here.

I've tried the suggestion that was put forward, which was:

\includepdf[pages=-, addtotoc={<page number>, section, 1, <heading>, <label>}]

but if I do this, I can only input the page number as 1, as the TOC won't accept any other integers. I want my Appendix A to start at Page 43, but pdfpages won't let me use that was a value, it just defaults to 1.

\appendix
\input{./Appendix1.tex}
\clearpage
\includepdf[pages=-,landscape=true,addtotoc={43, section, 1, Appendix A, AppendixA}]{TrackDetails1.pdf}
\input{./Appendix2.tex}
\clearpage
\includepdf[pages=-,landscape=true]{TrackDetails2.pdf}
\input{./Appendix3.tex}
\thispagestyle{empty}
\clearpage

This is a sample of my Appendix section, i'm not sure whether part of the problem is that i'm inserting a title page before the inserted PDF or not? Obviously the above isn't right, it's just the current state that my appendix section is in right now.

I've been trying various combinations for the last 4 hours now and frankly i'm sick of building my final PDF each time and finding that LaTeX still isn't doing what I want it to.

Someone please help!

A: 

In autotoc, 'page number' refers to the numbering in the original pdf-file. Thus, setting 'page number' to 43 adds a toc-entry for the 43th page of original.pdf. You may be looking for something like the following:

\documentclass{report} \usepackage{pdfpages}

\begin{document} \tableofcontents \chapter{foo} (...)

\setcounter{page}{42} \appendix \includepdf[pages=-,addtotoc={1, chapter, 1, bar, bar}]{baz.pdf} %first page of baz.pdf is added to toc as page 43

\end{document}

tharkun
A: 

With the memoir class you can do something along the lines of:

\def\chaptername{Appendix}
\addappheadtotoc
\includepdf{mypdf.pdf}

Which makes Appendix show up at the correct page + place in your TOC. Now i'm not sure if this is specific for the Memoir class but quick googling shows examples of people not using the memoir class and still using the command. It might be worth a shot.

Of course you can also do:

\def\sectionname{Appendix}
\addappheadtotoc
\includepdf{mypdf.pdf}

If you want it to appear as a section.

bastijn