首页 > 解决方案 > 方程列表中不同章节标签之间的垂直间距调整

问题描述

我正在写一篇论文,我必须在目录 (ToC) 中包含一个方程式列表(如图表列表等)。我按照这里给出的答案成功地将方程式列表添加到了 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}

标签: latexpdflatexlatex-environment

解决方案


您可以像这样修补\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}

在此处输入图像描述


推荐阅读