# Exam paper in A3 booklet format

I use the exam class for my tests. I usually give them in a booklet format which is the folded version of A3 paper. Here is a sample 4-page test:

\documentclass[addpoints, 10pt, a4paper]{exam}

%\usepackage[a3paper, landscape, twocolumn]{geometry}

\usepackage{lastpage}
\footer{}{Page \thepage / \pageref{LastPage}}{}

\usepackage{graphicx}

\begin{document}

Sample Test
\end{center}}{}{}
Sample Test
\end{center}}{}{}

\begin{questions}
\question[25]
\begin{figure}[h]
\includegraphics[width=0.5\textwidth]{figs/test.eps}
\end{figure}
\newpage
\question[25]
\newpage
\question[25]
\newpage
\question[25]
\end{questions}
\end{document}


When the geometry line uncommented, what I expect is this:

.

But the page footer does not align and it looks like it's 2-page. More importantly, the page order is not in correct order (4,1,2,3) for booklet format.

How I prepared the A3 booklet by now is quite impractical. After I compiled the test pdf in A4, passed it to PDFLaTeX like:

\documentclass{article}
\usepackage[landscape,a3paper]{geometry}
\usepackage{pdfpages}
\begin{document}
\includepdf[pages={4,1},nup=2x1]{test.pdf}
\includepdf[pages={2,3},nup=2x1]{test.pdf}
\end{document}


Is there any way I can do this directly in my document?

• Unrelated to LaTeX but as a teacher i'm always using this format for my lessons/tests/exams. Many printers are able to print a booklet format on A3 page paper without any changes on a pdf file. You can simply set the option on the printer directly and function of the numbers of pages, the printers will organize the pages automatically. Apart from a printer, you can also launch a booklet format from a computer by setting the corresponding option too without any changes on your pdf. – Piroooh Jan 11 '20 at 10:40
• @Piroooh, thank you for the advise. However, printer options might be restricted by the company/school. – tarik Jan 11 '20 at 11:35

This uses the booklet package. Removing the [print] option will format normally.

\documentclass[addpoints, 10pt, a4paper]{exam}
\usepackage[twouparticle,print]{booklet}
\source{\magstep0}{\paperwidth}{\paperheight}
\target{\magstep0}{2\paperwidth}{\paperheight}

\usepackage{graphicx}
%\AtBeginDocument{\setpdftargetpages}% pdflatex
\AtBeginDocument{\setdvipstargetpages}% otherwise

\usepackage{lipsum}
\usepackage{lastpage}
\footer{}{Page \thepage{} / \pageref{LastPage}}{}

\begin{document}

\begin{questions}
\question[25]\lipsum[1]
\fullwidth{\includegraphics[width=\columnwidth]{example-image}}
\newpage
\question[25]
\newpage
\question[25]
\newpage
\question[25]
\end{questions}

\end{document}

• This creates just a 2 page pdf with the page numbers Page4/4 and Page 2/2. – tarik Jan 9 '20 at 8:11
• Are you using pdflatex? Otherwise use \setdvitargetpages instead. – John Kormylo Jan 9 '20 at 17:01
• Looking at the aux file I see that \thepage is never being expanded. So \pageref will always return the current page number. The manual says to not use [print] until the last run. – John Kormylo Jan 9 '20 at 17:16
• I use the LaTeX-dvips-ps2pdf structure. \setdvitargetpages gives the "! Undefined control sequence." error by the way. Still no luck for me. – tarik Jan 10 '20 at 8:23
• Oops, \setdvipstargetpages. I tested it this time. – John Kormylo Jan 10 '20 at 16:57