-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheso-ex3-pt.tex
38 lines (31 loc) · 1009 Bytes
/
eso-ex3-pt.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
% based on `eso-ex3.tex' in eso-pic
% -- example for import pages of another (pdf) document.
\ifx\AddToHook\undefined
\RequirePackage{plautopatch}% pxatbegshi
\fi
\documentclass[a4paper,dvipdfmx]{tarticle}
\usepackage{graphicx}
\usepackage{ifthen,calc,eso-pic}
\newcounter{thispdfpage}\newcounter{afterlastpdfpage}
\newcommand{\includepdfpages}[3]
{%
\setcounter{thispdfpage}{#2}\setcounter{afterlastpdfpage}{#3+1}%
\newpage
\whiledo{\value{thispdfpage} < \value{afterlastpdfpage}}%
{%
\AddToShipoutPicture*
{%
\put(0,0){%
\includegraphics[width=\paperwidth,height=\paperheight,%
keepaspectratio,page=\arabic{thispdfpage}]{#1}}%
}
\thispagestyle{empty}\mbox{}\newpage
\stepcounter{thispdfpage}%
}
}
\begin{document}
\section{First page of the main document}
% import pages 1 to 3 of an external document.
\includepdfpages{img/multimg.pdf}{1}{3}
\section{First page after the imported pages of the external document}
\end{document}