我想在附录中放一个目录。我希望目录仅列出附录中的章节/小节,而不列出论文主体中的章节/小节。我现在还列出了论文主体中的章节:
我怎样才能找到一种方法,不将论文主要部分的章节/小节纳入附录目录?如果可能的话,我正在寻找一个简单的解决方案。任何帮助都将不胜感激。这是我的 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}
我也很好奇目录中文本和页码之间的领导者是否也可以超链接(这样,如果单击领导者,就会转到相关页面)?
答案1
您可以添加指向领导者定义的链接:
\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}