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.

Issue

I want to join several pdf files to a single pdf with 4 pages on one page and continuously proceeding pages using just one SINGLE tex file. Something like:

\documentclass[a4paper,10pt]{article}
\usepackage{pdfpages}
\usepackage{pgfpages}
\pgfpagesuselayout{4 on 1}[a4paper]
\begin{document}
\includepdf[pages=-]{page1.pdf}
\includepdf{page2.pdf}
\includepdf{page3.pdf}
\includepdf{page4.pdf}
\end{document}

but pdfpages seems to stay in conflict with pgfpages.

Until now

So far I always used two tex files:

\documentclass[a4paper,10pt]{article}
\usepackage{pdfpages}
\begin{document}
\includepdf[pages=-]{page1.pdf}
\includepdf{page2.pdf}
\includepdf{page3.pdf}
\includepdf{page4.pdf}
\end{document}

and

\documentclass[a4paper,10pt]{article}
\usepackage{pdfpages}
\begin{document}
\includepdf[pages=-,nup=2x2]{temp.pdf}
\end{document}

Condition

I do not want to use pdfjam as it does almost the same as pdfpages.

Update

Is there a way to generalize this also to different layout like nup=2x3? 6 to 1 is undefined in \pgfpagesuselayout.

Another Ansatz

Maybe using the package bashful wrong.

MWE:

\documentclass[a4paper,10pt]{article}
\usepackage{pdfpages}
\usepackage{bashful}

\begin{filecontents}{temp}
    \documentclass[a4paper,10pt]{article}
    \usepackage{pdfpages}
    \begin{document}
    \includepdf[pages=-]{page1.pdf}
    \includepdf{page2.pdf}
    \includepdf{page3.pdf}
    \includepdf{page4.pdf}
    \end{document}
\end{filecontents}

\begin{document}

\bash{ shopt -s nullglob; pdflatex temp.tex; done; } 
\END

\includepdf[pages=-,nup=2x2]{temp.pdf}
\end{document}
share|improve this question
add comment

1 Answer

By loading pgfpages before pdfpages, it works:

\documentclass[a4paper,10pt]{article}

\usepackage{pgfpages}
\usepackage{pdfpages}
\pgfpagesuselayout{4 on 1}[a4paper]

\begin{document}
\includepdf[pages=-]{page1.pdf}
\includepdf{page2.pdf}
\includepdf{page3.pdf}
\includepdf{page4.pdf}
\end{document}
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.