I have some scanned pdf documents which I want to put together in a latex file and structure them with sections which appear only in the TOC. This has the advantage, that I can jump to the page using hyperref.
However with this code only text is added to the toc, but I would like them to be numbered as if I had written a normal \section.
\phantomsection\addcontentsline{toc}{chapter}{SI-System}
\includepdf[pages=1-3,pagecommand={\thispagestyle{plain}}]{02-SI.pdf}
Best Answer
You can use the
addtotoc
option for the\includepdf
command; this option has the syntaxwhere
<page number>
is the page number of the inserted document that will be linked to from the ToC,<section>
is the LaTeX sectioning name (e.g., section, subsection,...),<level>
denotes depth of section (e.g., 1 for section level, 2 for subsection level,...),<heading>
is the title inserted in the table of contents, and<label>
is the name of the label which can be referred to with\ref
and\pageref
.With your current approach you can use
\numberline
to add the number of the corresponding sectional unit to the ToC; for example, you can say something like:Here's an example or the use of addtotoc option (kindly provided by Marco Daniel):
save the file as, for example,
test.tex
and run it using