0

First: I'm not sure if this should be two separate questions but I've decided to post them as one.

Consider the following MWE (follow-up to Error regarding \contentsline when compiling):

\documentclass{article}

\usepackage{tocloft}
\usepackage{pdfpages}
\usepackage{hyperref}


\begin{document}

\tableofcontents
\newpage

\section{A section}
\label{section:A}
Test
\newpage

\section{External document}
The following pages consist of external documents.

\phantomsection
\addtocontents
  {toc}
  {\protect
   \contentsline
     {subsection}
     {\protect\numberline{}Dummy Page}
     {4}
     {}}
\includepdf[pages = -]{dummy.pdf}

\end{document}
  1. How do I make the added ToC entry Dummy Page into a clickable link which directs me to the page where the dummy document starts (page 4, in this case)?

  2. How do I add a bookmark entry called Dummy Page with the correct page number (here, 4)?

1 Answer 1

1
\documentclass{article}

\usepackage{tocloft}
\usepackage{pdfpages}
\usepackage{hyperref}


\begin{document}

\tableofcontents
\newpage

\section{A section}
\label{section:A}
Test
\newpage

\section{External document}
The following pages consist of external documents.

\newpage
\phantomsection
\addcontentsline{toc}{subsection}{\protect\numberline{}Dummy Page}
\includepdf[pages = -]{example-image}

\end{document}
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .