在同一章节书籍类别的 LOF 条目之间插入空格

在同一章节书籍类别的 LOF 条目之间插入空格

我发现了与我类似的问题,但仍然不知道该怎么做。

我正在使用书籍类,并且在我的图表列表中,我有默认布局:

List of Figures

1.1 Very long caption that breaks over many lines ..... 1

2.1 Very long caption that breaks over many lines ..... 2 2.2 Very long caption that breaks over many lines that now hugs the first entry from the same chapter like this (no space in same chapter's entries).......... 3

我想要的是在整个过程中应用不同章节(例如 1.1 和 2.1)的条目之间的完全相同的空间。

我真的真的不想偏离书本课程,因为其他一切都很完美,正如我想要的那样。

有什么建议吗?我可以以某种方式编辑 book.cls 文件中的宏吗?

我仍然想做一个表格列表,我认为它会有同样的问题。

编辑:下面是我所指的 MWE 的基本内容:

\documentclass[12pt,a4paper]{book}

\begin{document}

\listoffigures

\chapter{One}
\begin{figure}
\caption{Very long caption that continues over many lines. Very long
caption that continues over many lines. Very long caption that continues
over many lines. Very long caption that continues over many lines. Very
long caption that continues over many lines. Very long caption that 
continues over many lines.}
\end{figure}
\chapter{Two}
\begin{figure}
\caption{Very long caption that continues over many lines. Very long
caption that continues over many lines. Very long caption that continues
over many lines. Very long caption that continues over many lines. Very
long caption that continues over many lines. Very long caption that 
continues over many lines.}
\end{figure}
\begin{figure}
\caption{Very long caption that continues over many lines. Very long
caption that continues over many lines. Very long caption that continues 
over many lines. Very long caption that continues over many lines. Very
long caption that continues over many lines. Very long caption that 
continues over many lines.}
\end{figure}

\end{document}

在 LOF 处产生:

答案1

lof自动在每一章后添加一个\addvspace{}。您可以通过重新定义 -- 本地 -- 此命令不执行任何操作来抑制它。然后使用tocloft包来定义新的跳过。MWE 写道:

\documentclass{book}
\usepackage{tocloft}
\begin{document}

\begingroup
\setlength{\cftbeforefigskip}{1em}
\renewcommand*{\addvspace}[1]{}
\listoffigures
\endgroup

\chapter{One}
etc..
\end{document}

答案2

大家好,在@Danie Els 的一些指导下,并结合过去提出的一些类似问题的想法,我让它做了我想做的事情,如下所示:

首先,您必须使用@Stefan Kottwitz 建议的序言中的代码来禁用/删除书籍类别自动为来自不同章节的 LOF 条目插入的空间(https://tex.stackexchange.com/a/793/54526):

% Remove the initial space between LOF entries of different chapters
\newcommand*{\noaddvspace}{\renewcommand*{\addvspace}[1]{}}
\addtocontents{lof}{\protect\noaddvspace}

然后你按照@user36296 的建议添加一个带有 setlength 的 parskip (https://tex.stackexchange.com/a/330877/54526),然后只需用花括号将其限制为 LOF:

{\setlength{\parskip}{10pt}% adds the new space between LOF entries
\listoffigures}

我发现人们尤其需要避免使用像 tocloft 包这样的东西,因为我认为它会开始影响你的 minitoc 之类的东西(如果你有的话),因为每当我使用 tocloft 时,我的 minitoc 的格式都会改变(这不是我自己做的)。

相关内容