Debian Codegraph @

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

raw
1 %%
2 %% This is file `pdf-toc.tex',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% pdfpages.dtx (with options: `example3')
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]{book}
15 \usepackage{pdfpages}
16 \usepackage{verbatim}
17 \usepackage[plainpages=false, pdfpagelabels,
18 bookmarksopen]{hyperref}
19
20 \begin{document}
21 \tableofcontents
22
23 \chapter{How to create a toc}
24
25 The next pages were inserted using the following command:
26
27 \begin{verbatim}
28 \includepdf[pages=1-6,
29 pagecommand={},
30 addtotoc={1, chapter, 0, Main chapter, cha:main,
31 1, section, 1, First section, sec:first,
32 3, section, 1, Second section, sec:second},
33 trim=0 120 0 120, clip]{dummy.pdf}
34 \end{verbatim}
35
36 \noindent
37 See Chapter \ref{cha:main} (\nameref{cha:main}) on page
38 \pageref{cha:main}.\par\noindent
39 See Section \ref{sec:first} (\nameref{sec:first}) on page
40 \pageref{sec:first}.\par\noindent
41 See Section \ref{sec:second} (\nameref{sec:second}) on page
42 \pageref{sec:second}.
43
44 \includepdf[pages=1-6,
45 pagecommand={},
46 addtotoc={1, chapter, 0, Main chapter, cha:main,
47 1, section, 1, First section, sec:first,
48 3, section, 1, Second section, sec:second},
49 trim=0 120 0 120, clip]{dummy.pdf}
50
51 \end{document}
52 \endinput
53 %%
54 %% End of file `pdf-toc.tex'.