Skip to content

Instantly share code, notes, and snippets.

@ojmarcelino
Forked from ppanyukov/combinePdfFiles.tex
Last active August 17, 2021 02:22
Show Gist options
  • Save ojmarcelino/fe838605f798cc35c6484b3d06f6f1ba to your computer and use it in GitHub Desktop.
Save ojmarcelino/fe838605f798cc35c6484b3d06f6f1ba to your computer and use it in GitHub Desktop.
Combine several PDF files into one using LaTeX
% Many times we have HTML articles published across multiple pages.
% And sometimes we want to print all those pages as one PDF.
% Usage:
% - Print to PDF from browser;
% - Put and rename the PDF on the same folder as .tex;
% - Use LaTeX to assemble these into one PDF.
%
\documentclass[a4paper]{article}
\usepackage{pdfpages}
\begin{document}
\includepdfset{pages=-,fitpaper}
\includepdf[pages=-, scale=0.9]{p01.pdf}
% one can change specific options too as below
%\includepdf[pages=5-]{p03.pdf}
%\includepdf[pages=1-4]{p03.pdf}
%\includepdf[pages={2-},scale=0.75]{p03.pdf}
\includepdf[pages=-, scale=0.9]{p02.pdf}
\includepdf[pages=-, scale=0.9]{p03.pdf}
\includepdf[pages=-, scale=0.9]{p04.pdf}
\includepdfset{} % force settings reset
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment