-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbooklet.tex
More file actions
23 lines (17 loc) · 787 Bytes
/
booklet.tex
File metadata and controls
23 lines (17 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
\documentclass[a4paper]{article}
\usepackage{pdfpages}
\usepackage{lastpage}
\begin{document}
\includepdf[pages=-,booklet,landscape]{main.pdf}
% the logic below needs to be thoroughly checked
% To make sure that the first page includes both, the front and back cover,
% we process the first and last page
%\includepdf[pages={1,last}, nup=1x2, landscape=false, angle=90]{main.pdf}
% Then we add the rest of the document, skipping the first and last pages.
% But first, we have to get the total number of pages and figure out what
% the number of the "last but one" page is.
%\edef\TotalPages{\the\pdflastximagepages}
%\edef\SecondToLastPage{\the\numexpr\TotalPages-1}
% Add the rest
%\includepdf[pages=2-\SecondToLastPage, booklet, landscape]{main.pdf}
\end{document}