latex - 方程列表中不同章节标签之间的垂直间距调整
问题描述
我正在写一篇论文,我必须在目录 (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}
解决方案
您可以像这样修补\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}
推荐阅读
- node.js - 使用 README.md 将 Angular 6 库发布到 npmjs
- python - 如何使用 mitmproxy 阻止 url
- python - 检索记录 MySql 数据库 PyDAL
- java - Wildfly:使用 RandomAccessFile 时获得权限被拒绝
- python - 在 QTextEdit 窗口中选择文本并使用 setTextBackgroundColor 突出显示
- eclipse - 没有名为 cairo 的模块 - Mac
- jenkins - Jenkins - 单击可用插件时出现错误立即检查按钮
- amazon-product-api - 使用亚马逊产品广告 API 获取产品类别
- python - 命令“python setup.py egg_info”在 /tmp/pip-install-jsegcbha/mysqlclient/ 中失败,错误代码为 1
- java - JavaFx 套接字编程和发送图像