![文章类附录目录](https://linux22.com/image/397262/%E6%96%87%E7%AB%A0%E7%B1%BB%E9%99%84%E5%BD%95%E7%9B%AE%E5%BD%95.png)
我想在附录中放一个目录。我希望目录仅列出附录中的章节/小节,而不列出论文主体中的章节/小节。我现在还列出了论文主体中的章节:
我怎样才能找到一种方法,不将论文主要部分的章节/小节纳入附录目录?如果可能的话,我正在寻找一个简单的解决方案。任何帮助都将不胜感激。这是我的 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}