3

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}
5

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}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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