使用 RevTex 4.2 時減少目錄中的空白

使用 RevTex 4.2 時減少目錄中的空白

revtex4-2我有一個APS 風格的文檔。出於風格原因,我想保留文件類,但文件不需要針對期刊提交進行樣式設定。

我想包含一個非常緊湊的目錄。具體來說:(1) 僅頂層部分,(2) 條目之間的最小垂直空白,(3) 腳註大小無襯線字體,(4) 包含連結。到目前為止,我已經取得了以下成就:

總有機碳 文字

這還不夠緊湊。我想完全刪除垂直空白。這可能嗎?

關於(1)。 RevTex 似乎忽略了tocdepth計數器。使用我解決這個問題的相關問題的答案(注意:我不知道這是做什麼的)

\makeatletter
\def\l@subsection#1#2{}
\def\l@subsubsection#1#2{}
\makeatother

關於(3)。我嘗試了tocloftminitoc、 和parskip包包。前兩者似乎與 RevTex 不相容,第三個搞亂了段落文字中的 RevTex 樣式。唯一有效的方法是調整\baselinestretch,但如上圖所示,它似乎達到了最低限度。

有什麼辦法可以進一步減少這個空白嗎?

這是一個最小的例子:

\documentclass[reprint, aps, prx]{revtex4-2}
\usepackage{hyperref}
\hypersetup{colorlinks = true, linkcolor = blue, linktoc = all}
\begin{document}
{
\makeatletter
\def\l@subsection#1#2{}
\def\l@subsubsection#1#2{}
\makeatother

\footnotesize \sf 
\renewcommand{\baselinestretch}{0.1}

\tableofcontents
}
\section{Introduction}
For comparison, here is the spacing of normal text.
\section{Results}
\subsection{I don't want this in TOC}
\subsection{I also don't want this in TOC}
\section{Another section}
\section{And another}
\section{Less vertical white space between sections please}
\section{Conclusion}
\clearpage
\end{document}

我可以嘗試設定的任何 TeX 長度都會有幫助。透過循環各部分並將其寫入表格來重新建立「非官方」目錄的答案也將非常有幫助。

答案1

\documentclass[reprint, aps, prx]{revtex4-2}
\usepackage{hyperref}
\hypersetup{colorlinks = true, linkcolor = blue, linktoc = all}
\begin{document}

\makeatletter
\def\l@subsection#1#2{}
\def\l@subsubsection#1#2{}
\def\l@f@section{}%
\def\toc@@font{\footnotesize \sffamily}%
\makeatother


\tableofcontents



\section{Introduction}
For comparison, here is the spacing of normal text.
\section{Results}
\subsection{I don't want this in TOC}
\subsection{I also don't want this in TOC}
\section{Another section}
\section{And another}
\section{Less vertical white space between sections please}
\section{Conclusion}
\clearpage
\end{document}

在此輸入影像描述

相關內容