0

I'm having issues the TOC not displaying the section page number correctly for a PDF included in my appendix. Essentially setting the page number argument to "1" in the addtotocoption makes the TOC list the starting page number of the inserted PDF as one page before the first page. A sample of the code looks like this:

\documentclass[twoside, open=right, fontsize=13pt, DIV=calc, chapterprefix=true]{scrreprt}
\usepackage[a4paper,width=150mm,top=25mm,bottom=25mm,hcentering,bindingoffset=6mm]{geometry}
\usepackage{pdfpages}

\begin{document}
\tableofcontents
\appendix
\chapter{Articles}

\includepdf[pages=-, openright=true, addtotoc={1, section, 1, {Article 1}, article1}, pagecommand={}, trim=25mm 0mm 25mm 0mm, offset=3mm 0, width=\textwidth]{chapters/Article1/article1.pdf}

While the first page in the PDF starts on page 85, the TOC displays page 84 as the first page:

enter image description here

I therefore tried setting first page to 2 (addtotoc={2, section, 1, {Article 1}, article1}, but then TOC displays page 86:

enter image description here

Removing openright=true seem to set the page number correctly, but then the PDF starts on an even page, which I do not want.

Furthermore, adding labels doesn't show up when citing references.

Any suggestions?

5
  • looks like a bug of pdfpages. But you can add \cleardoublepage before the \includepdf to get around it. Feb 27, 2020 at 15:42
  • Perhaps it is not a bug. openright seems to add an empty page unconditionally, so it is not really suited to get the first page on the right. \cleardoublepage is better. Feb 27, 2020 at 15:51
  • Your workaround worked almost like a charm. TOC now displays the pages correctly. However, the even page before the inserted PDF is now completely blank, meaning the header and footer is now also gone. Is there a way to avoid this? Btw, you may be right it's not a bug: openright=true seems to intentionally leave a blank page before the first logical page. I realized after posting that one of my included PDFs starts on an even page after leaving an odd page blank. The incorrect page numbering in TOC clearly is a bug, though. Feb 28, 2020 at 9:37
  • the KOMA classes have an number of \clearXXX-variants to get every page style you want on the empty page. Check the documentation. Feb 28, 2020 at 9:46
  • Thanks, I will. \cleardoublepage worked though, so if post it as an answer, I'll tick it off as a solution. Mar 3, 2020 at 20:40

0

You must log in to answer this question.

Browse other questions tagged .