I try to include an entire pdf file with pdfpages but I will not use numbering in the table of contents. Here is a MWE, which illustrates the problem.

Only a test
\addsec{Another Test}
\includepdf[pages=-,addtotoc={1,section,1,{Another PDF},test}]{test.pdf}

I will not number the entry in the toc for the included pdf. Well, I can set the number, denoting depth of section to a higher value than tocdepth/secnumdepth (which is working, like \includepdf[pages=-,addtotoc={1,section,6,{Another PDF},test}]{test.pdf} ).

Is there a smarter solution available?

  • 1
    You could say something like { \renewcommand\thesection{} \addtocounter{section}{-1} \includepdf[pages=-,addtotoc={1,section,1,{Another PDF},test}]{b.pdf} } but I am not sure of this would be "smarter". – Gonzalo Medina Mar 22 '13 at 2:37

You know the command addsec provided by a KOMA class. You can use this as an option of addtotoc:

\includepdf[pages=-,addtotoc={1,addsec,1,{Another PDF},test}]{test-crop.pdf}

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.