【问题标题】:Vertical Spacing adjustment between different chapter's labels in the list of equations方程式列表中不同章节标签之间的垂直间距调整
【发布时间】:2020-04-30 06:39:49
【问题描述】:

我正在写一篇论文,我必须在目录 (ToC) 中包含一个方程式列表(如图表列表等)。我按照here 给出的答案成功地将方程式列表添加到 ToC。但问题是不同章节的方程式标签之间的垂直间距。我需要在两个不同的章节标签之间有一个间隙,比如默认的图形/表格列表。我附上了 thesis.cls 文件,该文件具有图形/表格/符号等列表的默认定义以及图形和方程式屏幕截图列表

简而言之,我的方程式列表在格式上应该像数字列表

以下是方程式列表的最小可重现代码

\documentclass[11pt]{report}
\usepackage{tocloft}
\usepackage{xpatch}


\begin{document}

\newcommand{\listequationsname}{List of Equations}
\newlistof{myequations}{equ}{\listequationsname}
\newcommand{\myequations}[1]{%
\addcontentsline{equ}{myequations}{\protect\numberline{\theequation}#1}\par}
\xpretocmd{\listofmyequations}{\addcontentsline{toc}{chapter}{\listequationsname}}{}{}

\tableofcontents
\clearpage
\listofmyequations

\chapter{First chapter}
\section{First section}
\begin{equation}
E=mc^2 
\end{equation}
\myequations{Energy Equation}
\begin{equation}
F = ma 
\end{equation}
\myequations{Force equation}

\chapter{Second chapter}
\section{First section}
\begin{equation}
S = vt
\end{equation}
\myequations{displacement equation}
\end{document}

【问题讨论】:

    标签: latex pdflatex latex-environment


    【解决方案1】:

    您可以像这样修补\chapter 命令:

    \documentclass[11pt]{report}
    \usepackage{tocloft}
    \usepackage{xpatch}
    
    \newcommand{\listequationsname}{List of Equations}
    \newlistof[chapter]{myequations}{equ}{\listequationsname}
    \newcommand{\myequations}[1]{%
    \addcontentsline{equ}{myequations}{\protect\numberline{\theequation}#1}\par}
    \xpretocmd{\listofmyequations}{\addcontentsline{toc}{chapter}{\listequationsname}}{}{}
    
    \makeatletter
    \xpretocmd{\@chapter}{\addtocontents{equ}{\protect\addvspace{10\p@}}}{}{}{}%
    \makeatother
    
    
    \begin{document}
    
    \tableofcontents
    \clearpage
    \listofmyequations
    
    \chapter{First chapter}
    \section{First section}
    \begin{equation}
    E=mc^2 
    \end{equation}
    \myequations{Energy Equation}
    \begin{equation}
    F = ma 
    \end{equation}
    \myequations{Force equation}
    
    \chapter{Second chapter}
    \section{First section}
    \begin{equation}
    S = vt
    \end{equation}
    \myequations{displacement equation}
    \end{document}
    

    【讨论】:

      【解决方案2】:

      我只知道手动。请在每章末尾添加以下命令\addtocontents{equ}{\addvspace{1.2pc}}。并重新生成目录。

      【讨论】: