[Tex/LaTex] Print eight A6 pages on one two-sided A4 sheet in a book folding order

double-sidedpdfpages

What I'm trying to achieve might be a little too-much. Although I have to admit that TeX never let me down, so I thought, let's give it a spin here.

I have a document like this:

\documentclass[9pt,twoside]{article}
\usepackage[dutch]{babel}
\usepackage[a6paper]{geometry}
\begin{document}
% my document
\end{document}

That works perfectly nice and generates several A6 pages. Now, what I want is this: I want to print eight A6 pages on one A4 portrait page (i.e. four A6 pages on one A4 side).

Now, the hard part is this: when these A4 sheets are printed, I want to cut them in half. Then, I'd like to put the upper and bottom halves of the A4 sheets on top of each other and fold them vertically, so I've got myself a little A6 book.

I think the ASCII-art below helps in understanding what I'm trying to do. In the end, I'd like my printer to print this:

A4 sheet #1 - back   A4 sheet #1 - front   A4 sheet #2 - back  A4 sheet #2 - front
+--------|--------+  +--------|--------+  +--------|--------+  +--------|--------+
|        |        |  |        |        |  |        |        |  |        |        |
|        |        |  |        |        |  |        |        |  |        |        |
| page 8 | page 1 |  | page 2 | page 7 |  | page 6 | page 3 |  | page 4 | page 5 |
|        |        |  |        |        |  |        |        |  |        |        |
+--------|--------+  +--------|--------+  +--------|--------+  +--------|--------+
|        |        |  |        |        |  |        |        |  |        |        |
| page 8 | page 1 |  | page 2 | page 7 |  | page 6 | page 3 |  | page 4 | page 5 |
|        |        |  |        |        |  |        |        |  |        |        |
|        |        |  |        |        |  |        |        |  |        |        |
+--------|--------+  +--------|--------+  +--------|--------+  +--------|--------+

So in short: how can I make this work?

Best Answer

First, I use the auxiliary document from cfr to create an example 8 page A6 document:

\documentclass[a6paper,twoside]{article}
\usepackage{geometry}
\usepackage{graphicx}
\pagestyle{empty}
\begin{document}
\centering
\scalebox{30}{1}\newpage
\scalebox{30}{2}\newpage
\scalebox{30}{3}\newpage
\scalebox{30}{4}\newpage
\scalebox{30}{5}\newpage
\scalebox{30}{6}\newpage
\scalebox{30}{7}\newpage
\scalebox{30}{8}
\end{document}

After compilation, this gives a file called a6.pdf which contains 8 pages with 8 large numbers.

To assemble the pages as requested, you may use the raster library of tcolorbox. There is not much boxing of any kind here, but with a few lines of code you get your document:

\documentclass[a4paper]{article}
\usepackage[margin=0pt]{geometry}
\usepackage[skins,raster]{tcolorbox}
\pagestyle{empty}
\begin{document}
\begin{tcbraster}[raster height=\textheight,raster equal skip=0pt,blank,
    graphics pages={8,1,8,1,  2,7,2,7,  6,3,6,3,  4,5,4,5}]
  \tcbincludepdf{a6.pdf}% <-- The A6 document with 8 pages
\end{tcbraster}
\end{document}

The result is a A4 document with 4 pages:

enter image description here