0

I am writing a paper which has an appendix. The main part of the paper looks like this: enter image description here

I want to put a table of contents in the appendix. I want the table of contents to list only the sections/subsections in the appendix and not those in the main part of the paper. What I have now also lists the section from the main part of the paper: enter image description here

How can I find a way not to include sections/subsections from the main part of the paper into the appendix table of contents? I am looking for a simple solution, if possible. Will appreciate any help. Here is my MWE:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tocloft}
\renewcommand\cftsecleader{\cftdotfill{\cftdotsep}}
\usepackage[colorlinks,linktoc=all]{hyperref}

\title{Paper-A}

\begin{document}

\maketitle
\section{Introduction}
In \autoref{app:eqcond}, I show in detail the equilibrium conditions of the 
model. \autoref{app:staeq} lists the stationary equilibrium of the economy.

\newpage

\appendix
\begin{center}
\section*{\textsc{ONLINE APPENDIX}}
\end{center}
\tableofcontents
\section{Equilibrium Conditions}\label{app:eqcond}
\subsection{Further Explanation}
\section{Stationary Equilibrium}\label{app:staeq}
\end{document}

I also had this curiosity whether the leaders between the text and page numbers in TOC can also be hyperlinked (so that if one clicks the leaders, it takes one to the relevant page)?

1

You can add links to the leader definitions:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tocloft}
\makeatletter
\renewcommand\cftsecleader{%
 \hyper@linkstart {link}{\Hy@tocdestname}\cftdotfill{\cftdotsep}\hyper@linkend}
\renewcommand\cftsubsecleader{%
 \hyper@linkstart {link}{\Hy@tocdestname}\cftdotfill{\cftdotsep}\hyper@linkend} 
\usepackage[colorlinks,linktoc=all]{hyperref}

\title{Paper-A}

\begin{document}

\maketitle
\section{Introduction}
In \autoref{app:eqcond}, I show in detail the equilibrium conditions of the
model. \autoref{app:staeq} lists the stationary equilibrium of the economy.

\newpage

\appendix
\begin{center}
\section*{\textsc{ONLINE APPENDIX}}
\end{center}


\tableofcontents

\section{Equilibrium Conditions}\label{app:eqcond}
\subsection{Further Explanation}
\section{Stationary Equilibrium}\label{app:staeq}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.