# why can't I get the A3 page where I want it (inside an A4 document) [duplicate]

I am using an A3 page within an A4 document.

In the SSCCE example below, my plan was to get (in this order):

1. "foo" on an A4 page
2. "A3 stuff" on an A3 page
3. "bar" on an A4 page

1. "foo" on an A4 page
2. "bar" on an A4 page
3. "A3 stuff" on an A3 page

That is, correct page sizes but wrong order. What am I missing?

code below:

\documentclass[11pt,twoside,a4paper,pagesize]{report}
\usepackage{nextpage}
\usepackage{afterpage}
\usepackage[margin=2cm]{geometry}
\usepackage{comment}
\usepackage{typearea}
\usepackage[absolute]{textpos}

\begin{document}

foo

\newpage
\clearpage
\pagebreak

\afterpage{ % Insert after the current page
\clearpage

\KOMAoptions{paper=a3}
\recalctypearea

A3 stuff

\clearpage
\KOMAoptions{paper=A4,pagesize}
\recalctypearea
}

bar

\end{document}


## marked as duplicate by Heiko Oberdiek, ChrisS, jub0bs, Guido, lockstepMay 22 '14 at 22:30

• Note that \afterpage works after the current page. And, since you're setting your A3 page on page two within the \afterpage construction, most certainly it will end up on page 3. Move the \clearpage to after your \afterpage construction. You don't need \newpage and \pagebreak there. – Werner May 22 '14 at 19:03

While the changing of page geometry mid-document is covered in Change paper size in mid-document, I'll only address the order of how items appear when using afterpage in this answer.

\afterpage works after the current page. And, since you're setting your A3 page on page two within the \afterpage construction, most certainly it will end up on page 3. So, the following prints foo on page 1, bar on page 2 and foobar on page 3:

\documentclass{article}
\usepackage[paper=a6paper]{geometry}% Only for this example
\usepackage{afterpage}

\begin{document}

\Huge
\afterpage{bar \clearpage}% Insert this AFTER the current page

foo

\clearpage

foobar

\end{document}