Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a document with A5 pages (created from a TeX file) and want to combine pairs of A5 pages to A4 pages. That is, without scaling, page 1 and 2 of the A5 document should become page 1 of the A4 document, and so on. The output has to be a PDF file. How to do this?

enter image description here


Here is an example TeX file, say a5pages.tex. The PDF file is created by pdflatex a5pages.tex and the PS file is created by latex a5pages.tex; dvips a5pages.dvi.

\documentclass{article}
\usepackage[a5paper]{geometry}
\geometry{verbose,tmargin=15mm,bmargin=5mm,lmargin=9mm,rmargin=9mm}
\newenvironment{changemargin}{%
  \begin{list}{}{%
    \setlength{\textwidth}{\paperwidth}
    \setlength{\textheight}{\paperheight}
    \setlength{\topmargin}{-1.5in}\setlength{\topsep}{-0.2in}%
    \setlength{\leftmargin}{-9mm}\setlength{\rightmargin}{-9mm}%
    \setlength{\listparindent}{\parindent}%
    \setlength{\itemindent}{\parindent}
    \setlength{\parsep}{\parskip}%
  }%
  \centering\item[]%
}{\end{list}}

\begin{document}
This is a line of text.
\begin{changemargin}
\rule[1ex]{1\paperwidth}{2pt}

aaa\hfill bbb
\end{changemargin}

\newpage
This is a line of text.
\begin{changemargin}
\rule[1ex]{1\paperwidth}{2pt}

aaa\hfill bbb
\end{changemargin}
\end{document}

My attempts to convert the PS or PDF file to an A4 document have been

  1. using Acrobat Reader: It is possible to print "Multiple pages per sheet" (Pages per sheet: "2") to a PS file, say a4pages.ps, but the result is shifted / wrongly cropped (e.g., the BoundingBox is stated as 19 36 576 833). Changing this value by hand to 0 0 596 842 and possibly changing some other values like DocumentPaperSizes corrects this. The problem is that the result was scaled down...

  2. using psnup of the package "psutils"

    psnup -Pa5 -pa4 -nup 2 a5pages.ps a4pages.ps
    

    The file "a4pages.ps" is on a5 paper despite the option -pa4. That is probably a bug as described here. Changing the BoundingBox and possibly other values corrects the problem for the PS file.

Finally, for attempt 1 or 2, to get a PDF file, I followed this approach. That is, a correct PDF file is created by ps2pdf -dDEVICEWIDTHPOINTS=596 -dDEVICEHEIGHTPOINTS=842 a4pages.ps (where ps2pdf is from the package "ghostscript").

Is there a simple way than editing the BoundingBox and possibly other values?

share|improve this question

migrated from stackoverflow.com Jun 11 '13 at 5:20

This question came from our site for professional and enthusiast programmers.

2  
Have you tried pdfpages for LaTeX? It lets you insert pages from another PDF into a LaTeX document. –  kgraney Jun 10 '13 at 0:42
    
@kgraney No. I'll give it a try... –  e-birk Jun 10 '13 at 0:48
add comment

1 Answer

As kgraney suggested what you want is easy to do with pdfpages. One you have your a5pages.pdf, create a new one (let's say a4pages.tex) with

\documentclass[a4paper]{article}
\usepackage{pdfpages}

\begin{document}
\includepdf[pages=-,nup=1x2,landscape]{a5pages}
\end{document}

where pages=- will include all pages, nup=1x2 will place 2 a5pages one beside the other over an a4 page and landscape will generate a a4 landscape. Compile it with pdflatex a4pages.tex and you'll get

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.