# Insert A3 page with figure into A4 document with active references

Based on the first answer from a previous post "Insert foldable A3 pages in an A4 document with active references", I tried to get a figure on an A3 page in my thesis. However, it does not turn out as it should: the picture does not get centered on the page. Otherwise it works. (see below for example output).

What I would like: The picture centered on the page and the caption on the inner half of the A3 page, just as if it were an A4 page. Any ideas? I also do need hyperref working ...

\usepackage[demo]{graphicx}
\usepackage{lipsum}

\usepackage{afterpage}
\usepackage{changepage}
\newenvironment{hugepage}%
{\clearpage
\pagestyle{empty}  % turn off display of page numbers, headers, ...

\changepage{247mm}{370mm}{25mm}{15mm}{}{}{}{}{}} % switch to A3
{\clearpage
\changepage{160mm}{247mm}{25mm}{25mm}{}{}{}{}{}} % back to A4

\begin{document}

\afterpage{%
\pdfpagewidth=2\pdfpagewidth
\pagestyle{empty}
\begin{hugepage}
$\,$
\begin{figure}[!t]

\includegraphics[width=308mm,height=229mm,page=1]{figures/aaa.pdf}
\caption{Left side image A3.}
\end{figure}
\end{hugepage}
}

\newpage

\afterpage{%
\pdfpagewidth=2\pdfpagewidth
\pagestyle{empty}
\begin{hugepage}
$\,$
\begin{figure}[!t]

\includegraphics[width=308mm,height=229mm,page=2]{figures/aaa.pdf}
\caption{Right side image A3.}
\end{figure}
\end{hugepage}
}

\lipsum{3}
\end{document}


Page 2 (the A3 page) looks like this:

The problem is, that the picture is not center aligned. The caption is on the right side of the odd and the even page, but it should be on the right side of the even and on the left side of the odd page.

Other suggested solutions are:

change of textwidth (Not an option since it requires memoir class).

using a KOMA script (Which results in non-centered image as well. And the caption got centered as well, but it should not be). Code of which looks like this:

\afterpage{% Insert after the current page
\clearpage
\KOMAoptions{paper=A3,paper=landscape,pagesize}
\recalctypearea
\begin{figure}[p]
\centering
\includegraphics[width=308mm,height=229mm,keepaspectratio]{largeimage}%
\caption{A large image which required A3}
\end{figure}
\clearpage
\KOMAoptions{paper=A4,pagesize}
\recalctypearea
}


However, it messes up with the page numbers. (see page 3).

-
Usually, we don't put a greeting or a “thank you” in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Accepting and upvoting answers is the preferred way here to say “thank you” to users who helped you. –  Kurt Apr 13 at 0:43
Be always very careful when use the afterpage-package. This doesn't always work as you would expect (had many problem with that while trying to change pagecolors). –  DL6ER Apr 18 at 20:32
@DL6ER I did warn you:-) The package says "This is really a pre-release, to see whether people like the idea of a command like this. This implementation is not particularly robust. This implementation does not work in two column mode, and can get "confused" by \LaTeX's floating environments." (it's said that for 20 years but it's still just a sketch really:-) –  David Carlisle Apr 18 at 21:22
@DavidCarlisle Yes, I've read that and afterwards I removed it and then it worked (surely it wasn't this easy, but you get the idea). I had to execute several commands to change the page from black-on-white to white-on-black, as the whole text has to be white, and the headings and footers and all the rules on this side, etc. –  DL6ER Apr 19 at 6:41

I think you are making it look more complicated than it need be, you don't need afterpage (or a float at all) just position the images and locally double\pdfpagwidth so that the image is not cropped to an A4 page.

An advantage of doing it this way is that the horizontal and vertical position can easily be tweaked by adjusting the spacing commands.

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{lipsum}
\usepackage{capt-of,color}

\begin{document}

% \thispagestyle{empty}
{\pdfpagewidth=2\pdfpagewidth
\vspace*{-2cm}
\noindent\kern.5\pdfpagewidth\rlap{\parbox{\textwidth}{%
\noindent\kern.25\pdfpagewidth
\llap{\includegraphics[width=308mm,height=229mm,page=1]{figures/aaa.pdf}}\endgraf
\vspace{2ex}%
\captionof{figure}{Left side image A3.}}}\kern-.5\pdfpagewidth
\par
\vspace*{-5cm}
\clearpage
%\thispagestyle{empty}
\vspace*{-2cm}
\noindent\parbox{\textwidth}{%
\noindent\rlap{\includegraphics[width=308mm,height=229mm,page=2]{figures/aaa.pdf}}\endgraf
\vspace{2ex}%
\captionof{figure}{Right side image A3.}}
\par
\vspace*{-5cm}
\clearpage
}

\lipsum{3}
\end{document}

-