currently i am in a situation where i have inserted some pages via includepdf, followed by additional \includepdf calls that use the addtotoc function, as follows:
\includepdf{pdffile1}
\includepdf{pdffile2}
\includepdf{pdffile3}
\includepdf{pdffile4}
\includepdf{pdffile5}
\includepdf{pdffile6}
\addcontentsline{toc}{part}{Part 1. Part 1}
\includepdf[pages=-,pagecommand={},addtotoc={1, subsection, 2, somename, somenamelabel,
...
n, subsection, 2, somenameN, somenameNlabel}]{./part1docs}
\addcontentsline{toc}{part}{Part 2. Part 2}
\includepdf[pages=-,pagecommand={},addtotoc={1, subsection, 2, somenamepart2, somenamep2label,
...
n, subsection, 2, somenamepart2N, somenamep2Nlabel}]{./part2docs}
i would like to now add a new section heading, called "Part 3", where the subsections would refer to the pages in the \includepdf{pdffile1}..\includepdf{pdffile6} calls.
edit: i found someone's macro that allows me to put in entries
\newcommand*{\NoPageAddContentsLine}[3]{%
\begingroup
\newpage
\let\protected@write\protected@immediate@write
\addcontentsline{#1}{#2}{#3}%
\endgroup
\stepcounter{page}%
}
via \NoPageAddContents line, so if i add this code:
\setcounter{page}{1}
\NoPageAddContentsLine{toc}{part}{Part 3. Transcripts}
\NoPageAddContentsLine{toc}{subsection}{pdffile1name}
...
\NoPageAddContentsLine{toc}{subsection}{pdffile6name}
it looks right but the linking is still an issue. even if i add a link=true, linkname=x to each of the pdffiles, it does not work.
any tips on getting a working link to a contents entry added in this way, if the link is created through pdfpages?
\href{foo.pdf#section}{...}
. And the difficulty is, that you would like this\href
command to be inside a TOC entry. Is this what you want?