# [texhax] Splitting 2-up pages

Mike Marchywka marchywka at hotmail.com
Mon Feb 25 19:06:15 CET 2019

I'm not entirely sure I understand what you are doing and the loop below
is probably a great solution but for "repetitive error prone "
I've started to generate a lot of latex with either bash scripts or c++.

If you know all the features of latex there are probably lots of nice things like
the loop but if you only want simple latex and have some natural
reason to use another lanaguage, I don;t know
where your PDF or other inputs are created,  that may make more sense.

For example, with data table I don't think it is uncommon to be able
to get output right in latex format similar to maybe html snippets.
When I get a new bibtex entry I generate code to reference it
and make sure it is acceptable to  bibtex.

Mike Marchywka 306 Charles Cox Drive Canton, GA 30115
2295 Collinworth  Drive Marietta GA 30062.  formerly 487 Salem Woods Drive Marietta GA 30067 404-788-1216 (C)<- leave message 989-348-4796 (P)<- emergency

________________________________________
From: texhax <texhax-bounces+marchywka=hotmail.com at tug.org> on behalf of Philip Taylor <P.Taylor at Rhul.Ac.Uk>
Sent: Monday, February 25, 2019 10:46 AM
To: Joel C. Salomon; ΤeXhax
Subject: Re: [texhax] Splitting 2-up pages

I have a PDF document “printed” 2-up, so that on each 11″×8½″ page there

Is there a way to do this automatically for the entire book?

Maybe something along the lines of the following (replace "100" by the maximum page number)

\documentclass{minimal}

\usepackage[papersize={5.5in,8.5in}, margin=0pt, ignoreall]{geometry}

\setlength{\parindent}{0pt}

\usepackage{graphicx}

\begin{document}

\count 254 = 0

\loop

\includegraphics[viewport= 0 0 396 612, page=\count 254]{two-up.pdf}

\includegraphics[viewport= 396 0 792 612, page=\count 254]{two-up.pdf}

\includegraphics[viewport= 0 0 396 612, page=\count 254]{two-up.pdf}

\includegraphics[viewport= 396 0 792 612, page=\count 254]{two-up.pdf}

\ifnum \count 254 < 100 %%% maximum page number