Debian Codegraph @

texmf-dist/doc/latex/pdfpages/pdf-hyp.tex

raw
1 %%
2 %% This is file `pdf-hyp.tex',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% pdfpages.dtx (with options: `example2')
8 %%
9 %% This file demonstrates how to use the pdfpages package.
10 %%
11 %% Please send error reports and suggestions for improvements to
12 %% Andreas MATTHIAS <[email protected]>.
13 %%
14 \documentclass[a4paper,12pt]{article}
15 \usepackage[final]{pdfpages}
16 \usepackage{verbatim}
17 %% Uncomment the following lines, if you want to produce thumbnails.
18 %%\usepackage{pdflscape}
19 %%\usepackage{thumbpdf}
20 \usepackage[bookmarksopen]{hyperref}
21
22 \newcounter{example}
23 \setcounter{example}{1}
24
25 \newenvironment{example}
26 {\par\vskip\topsep%
27 \noindent\textbf{Example \arabic{example}:}%
28 \stepcounter{example}%
29 \par\vskip\topsep%
30 \minipage{.9\linewidth}%
31 \verbatim}
32 {\endverbatim%
33 \endminipage\vskip\topsep}
34
35 \newcommand{\meta}[1]{\ensuremath\langle\texttt{#1}\ensuremath\rangle}
36 \newcommand{\link}[2]{\meta{#1}.\meta{#2}}
37
38 \newcommand*{\bookmark}[3][0]{%
39 \pdfoutline user {<< /S /GoTo /D (#3) >>} count #1 {#2}}
40
41 \begin{document}
42
43 \title{A Demonstration of the Hypertext Operations\\
44 of the \texttt{pdfpages} Package}
45 \author{Andreas MATTHIAS}
46 \maketitle
47
48 This is a demonstration of the \texttt{pdfpages} package.
49 It is \textit{not} the documentation of the package.
50 To get the documentation run: `latex pdfpages.dtx'
51
52 \tableofcontents
53
54 \section{Hyperlinks}
55 \subsection{Links to the inserted Pages}
56
57 Hyperlinks are created by using the option \texttt{link}
58 of the \verb|\includepdf| command. Each inserted page
59 gets a link name consisting of the filename and
60 the page number: \link{filename}{page number}
61
62 \begin{example}
63 \includepdf[pages=1-2, link]{dummy.pdf}
64 \end{example}
65
66 In this example the two pages have the link names
67 `\texttt{dummy.pdf.1}' and `\texttt{dummy.pdf.2}'.
68 Setting links to these
69 pages, can be done easily with the \verb|\hyperlink|
70 macro from the \texttt{hyperref.sty} package:
71
72 \bigskip
73 \verb|\hyperlink{dummy.pdf.1}{Page 1}|\hskip10pt \hyperlink{dummy.pdf.1}{Page 1}\par
74 \verb|\hyperlink{dummy.pdf.2}{Page 2}|\hskip10pt \hyperlink{dummy.pdf.2}{Page 2}
75 \bigskip
76
77 This way you can refer to the \hyperlink{dummy.pdf.1}{first}
78 and the \hyperlink{dummy.pdf.2}{second page}.
79
80 \includepdf[pages=1-2, link]{dummy.pdf}
81
82 Inserting the same page twice would result in two
83 identical link names. To prevent this use the option
84 \texttt{linkname} to specify another name for the links.
85
86 \begin{example}
87 \includepdf[pages=1-2, nup=2x1, landscape,
88 link, linkname=mylink]{dummy.pdf}
89 \end{example}
90
91 \noindent
92 Now the links are called `\texttt{mylink.1}' and
93 `\texttt{mylink.2}'.
94
95 \bigskip
96 \verb|\hyperlink{mylink.1}{Page 1}|\hskip10pt \hyperlink{mylink.1}{Page 1}\par
97 \verb|\hyperlink{mylink.2}{Page 2}|\hskip10pt \hyperlink{mylink.2}{Page 2}
98
99 \includepdf[pages=1-2, nup=2x1, landscape,
100 link, linkname=mylink]{dummy.pdf}
101
102 \subsection{Links to the original Document}
103
104 Each page can be a hyperlink to the document from
105 which it was extracted. This can be done with the
106 option \texttt{linktodoc}.
107
108 Click on the inserted pages and see what happens.
109
110 \begin{example}
111 \includepdf[pages=1-4, nup=2x2, linktodoc]{dummy.pdf}
112 \end{example}
113 \includepdf[pages=1-4, nup=2x2, linktodoc]{dummy.pdf}
114
115 \section{Article Threads}
116
117 In a PDF document one or more article threads may be defined.
118 An article thread is a logical connected sequence of content
119 items.
120
121 With the option \texttt{thread} the inserted pages become
122 an article thread.
123
124 \begin{example}
125 \includepdf[pages=1-4, nup=2x2, column,
126 landscape, thread]{dummy-l.pdf}
127 \end{example}
128
129 In Acrobat Reader the mouse pointer changes to a hand with
130 a little arrow in it when moved over an article thread.
131 By clicking on the page you can easily follow the logical
132 structure of the article thread.
133
134 \includepdf[pages=1-4, nup=2x2, column,
135 landscape, thread]{dummy-l.pdf}
136
137 \end{document}
138 \endinput
139 %%
140 %% End of file `pdf-hyp.tex'.