Never happened to me before: I'm trying to insert a pdf file using pdfpages and also create a TOC entry as a chapter. But the first page of the inserted file then overlaps with the second page. No such problem if I don't use tableofcontents or if the inclusion in TOC is at the level of sections. MWE:

\documentclass[12pt,a4paper,oneside]{report}
\usepackage{pdfpages}
\begin{document}
\tableofcontents
\end{document}


If I replace "chapter" with "secton", the problem disappears (but the TOC line is unsatisfactory). If the first number in addtotoc is 3 or above, the problem disappears (but the result is unsatisfactory).

Any ideas? Unfortunately, I don't have a second machine here to test if this is something specific to my installation.

• I have managed to isolate the problem with pdfpages. The issue doesn't exist, and everything compiles as expected with the version as late as v0.5f (from 2016). Not sure how to deal with it other than by using this older version. Jan 26 at 8:35
• @egreg I get a problem. When I use example-image-a4-numbered as pdf page 1 and 2 are gone. Jan 26 at 10:01
• @UlrikeFischer Oh! I didn't check the number of pages. I'll retract my comment. Jan 26 at 10:12
• Just a note: Andreas Matthias, the author and current maintainer of pdfpages has fixed this in pdfpages 0.5u (2022-01-29). Check the CTAN Announcement. Jan 30 at 18:48

No idea why it happens. Anyway, a workaround seems to be adding something invisible between the TOC and the included file.

\documentclass[12pt,a4paper,oneside]{report}
\usepackage{pdfpages}

\begin{document}

\tableofcontents

\mbox{}

\includepdf[
noautoscale=false,
nup=1x2,
pages=-,
landscape=true,

• it happens as pdfpages issues \@chapter in the middle of the code, and then the {\setbox\z@\lastbox} from \@afterheading eats the last box away. It works if one e.g. use \usepackage{indentfirst}. Looks like a bug that should be reported to pdfpages. Jan 26 at 10:42