Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

\documentclass[a4paper]{scrreprt}
\usepackage{pdfpages}
\setcounter{tocdepth}{5}
\setcounter{secnumdepth}{5}
\begin{document}
\tableofcontents
\addchap{Test}
Only a test
\addsec{Another Test}
\includepdf[pages=-,addtotoc={1,section,1,{Another PDF},test}]{test.pdf}
\end{document}

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?

share|improve this question
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

1 Answer 1

up vote 3 down vote accepted

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}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.