I want to include some external documents (PDFs) in the appendix of the document I am writing. I would like to have these included documents listed in my table of contents, but no section heading should be typeset where they appear in the main document.
The setup I constructed with the help of this answer (included below) works fine, except that the links made by hyperref in the ToC all point to the start of the appendix. How can I get links in the ToC that point to the sections?
\documentclass[oneside]{scrbook}
\usepackage{hyperref,scrpage2}
\newcommand*\silentsection[1]{
\addtocounter{section}{1}
\addcontentsline{toc}{section}{\protect\numberline{\thesection}#1}
\sectionmark{#1} % this is to get headers for the section
}
\pagestyle{scrheadings}
\automark{section}
\begin{document}
\tableofcontents
\chapter{main}
\clearpage\section{part}
\clearpage\section{with}
\chapter{some}
\clearpage\section{sections}
\appendix
\chapter{included documents}
\silentsection{one}
Yada.
\cleardoublepage
\silentsection{two}
Yada yada.
\cleardoublepage
\silentsection{three}
Yada yada yada.
\end{document}
\phantomsectionjust before your\silentsectioncommand. – Aug 21 '14 at 09:13