Document ClassesMerging two pages

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
Tranzistors
Posts: 4
Joined: Tue Aug 12, 2008 10:57 am

Merging two pages

Post by Tranzistors »

Hello,
is there a LaTeX package that can merge pair of pages into one? For example, I have [a5paper,portrait]document with 10 pages, I apply thesf wrdq ewhis package and get [a4paper,landscape]document with 5 pages.

This could be accomplished by using documentclass option "twocolumn", unfortunately both columns are considered to be on one page, they should be considered two different pages (for page numbering).
There are also external tools, that can combine the pages together in this fashion, but they destroy internal links.

Any ideas?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

T3.
Posts: 208
Joined: Fri Mar 14, 2008 12:58 pm

Merging two pages

Post by T3. »

There are several packages that can be used depending on your needs: pdfpages, pgfpages (part of PGF package), booklet, quire (part of midnight package).

Here is solution with pdfpages:

Code: Select all

\documentclass[a4paper]{minimal}
\usepackage{pdfpages}
\begin{document}
\includepdf[pages-,nup=1x2,landscape]{a5document.pdf}
\end{document}
Cheers,

Tomek
Tranzistors
Posts: 4
Joined: Tue Aug 12, 2008 10:57 am

Merging two pages

Post by Tranzistors »

Thanks for advice, alas pdfpages package did destroy the links and booklets wasn't exactly what was needed. However, booklets were close enough to investigate bit further and I found this:
http://www.svenhartenstein.de/latex-booklets.php

Although it is ugly solution and doesn't do what I need :) I modified it by replacing page ordering command

Code: Select all

psbook $1.ps tmp1.ps
with essentially 'do nothing' command

Code: Select all

cp $1.ps tmp1.ps
I am not sure all links are working correctly, still, this is a good start :)
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Merging two pages

Post by gmedina »

Perhaps the 2in1 package could be an option.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
User avatar
T3.
Posts: 208
Joined: Fri Mar 14, 2008 12:58 pm

Merging two pages

Post by T3. »

Tranzistors wrote:Thanks for advice, alas pdfpages package did destroy the links and booklets wasn't exactly what was needed.
Right, I missed that part about hyperlinks when I was skimming through your post. I've just checked pgfpages and the documentation says:
A word of warning: using pgfpages will destroy hyperlinks.
So you can cross that one out as well.

I use this booklet stuff for printing only, so breaking hyperlinks doesn't matter for me. I think, that it might be quite difficult to achieve your goal. The way those packages usually work is to hook into TeX's shipout routine and at that point it's probably too late to fix hyperlinks. Your best bet then is probably something that works with two column setup. Skimming through source code of 2in1 package suggested by gmedina it looks like it might be what you're after.

Cheers,

Tomek
Post Reply