[Tex/LaTex] Compile two A5 pages on one A4 page

paper-sizepdfpagesprinting

I often make A5 size hand outs for my students. I would like the A5 page to be directly compiled to have a copy of the original A5 page on one A4 page. Up till now my solution has been to make a second document handling the copying with the pdfpages package. Could this be automatized to yield two similar A5 pages on a A4 page upon one compilation? The document will always fit one A5 page.

The original A5 document:

\documentclass[a5paper,12pt,norsk]{article}
\usepackage[utf8]{inputenc}
\usepackage{babel,fouriernc,parskip,booktabs,array}
\usepackage[margin=1cm,landscape]{geometry}
\usepackage{enumitem}
\setlist{nolistsep}
\renewcommand\labelitemi{--}

\begin{document}
\thispagestyle{empty}
{\Large <<Jeg kan>> om kjemi}

\vspace{1em}
\begin{center}
\begin{tabular}{p{0.7\textwidth} |>{\centering}p{0.1\textwidth}| >{\centering}p{0.1\textwidth}}
    \toprule
    \textbf{Spørsmål} & \textbf{ja} & \textbf{nei} \tabularnewline
    \hline
    \dots some text & & \tabularnewline
    \bottomrule
\end{tabular}
\end{center}
\end{document}

The "printout" document to collect the A5 sheets on one piece of A4 paper

\documentclass[a4paper]{article}
\usepackage{pdfpages}
\usepackage[margin=0cm,showframe]{geometry}
\begin{document}
    \includepdf[nup=1x2,pages={1,1}]{jegKan}
    % \includepdf{vurderingsskjema}
\end{document}

Best Answer

The following uses, as also suggested by DG', the pgfpages package to do the 1x2 A5 on A4 layout, but automatically duplicates the content of each A5 page at shipout time, so that you end up with two identical A5 copies on each A4 page.

It also works with multi-page documents.

\documentclass[a5paper,12pt,norsk]{article}
\usepackage[utf8]{inputenc}
\usepackage{babel,fouriernc,parskip,booktabs,array}
\usepackage[margin=1cm,landscape]{geometry}
\usepackage{enumitem}

\usepackage{pgfpages}                                 % <— load the package
  \pgfpagesuselayout{2 on 1}[a4paper,border shrink=5mm] % <— set options

\usepackage{atbegshi}
  % duplicate the content at shipout time
  \AtBeginShipout{
    \pgfpagesshipoutlogicalpage{1}\copy\AtBeginShipoutBox
    \pgfpagesshipoutlogicalpage{2}\box\AtBeginShipoutBox
    \pgfshipoutphysicalpage
  }

\usepackage{blindtext}


\setlist{nolistsep}
\renewcommand\labelitemi{--}

\begin{document}
\thispagestyle{empty}
{\Large <<Jeg kan>> om kjemi}

\vspace{1em}
\begin{center}
\begin{tabular}{p{0.7\textwidth} |>{\centering}p{0.1\textwidth}| >{\centering}p{0.1\textwidth}}
    \toprule
    \textbf{Spørsmål} & \textbf{ja} & \textbf{nei} \tabularnewline
    \hline
    \dots some text & & \tabularnewline
    \bottomrule
\end{tabular}
\end{center}

% To demonstrate that it also works with multiple pages
\newpage

\blindtext

\end{document}

enter image description here

Remark: If your a5 pages are portrait, then the setup is:

\documentclass[a5paper]{article}
...
\usepackage[margin=1cm,portrait]{geometry}
...
\usepackage{pgfpages}
\pgfpagesuselayout{2 on 1}[a4paper,landscape,border shrink=5mm]
...

A5 portrait on double A4

Related Question