Latex:使 \listoffigures 看起来像 \listoftables 或 \lstlistoflistings
在我的文档末尾,我在表格列表和数字列表之后有一个列表。真正让我恼火的是,它们看起来相同,只是列表列表没有在章节之间留下行间隙。
我用谷歌搜索了一下,有人问了同样的问题,但似乎没有任何回应。
他们有什么理由让它们看起来不一样并且看起来很简洁吗?
I've got a list of listings at the end of my document following my list of tables and my list of figures. The thing that is really annoying me is that they look the same except the list of listings doesn't leave a line gap between chapters.
I've had a good google around and people have asked the same question but don't seem to have had any response.
Is their any reason why they don't look the same and it be made to look concise?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
其原因是图列表(lof)和表列表(lot)中的章节之间的垂直间距是由
\chapter
命令添加的,而对于清单列表(笑)。如何解决这个问题在一定程度上取决于您所使用的文档类。如果您使用优秀的
memoir
类,则已经提供了用于此目的的挂钩:如果您的列表出现在附录中,您将挂钩
\memappchapinfo
而不是\memchapinfo
。 (有关可用挂钩列表,请参阅回忆录手册第 18.25 节。)如果您不使用
memoir
,则通常需要挂钩您的班级的\@chapter
命令。例如,这可能看起来像:您可以通过检查与您的文档相对应的
.lol
文件来轻松检查用于生成 lol 的内容。例如,如果您的文档是base.tex
,请查看base.lol
。您应该看到类似以下内容:注意
\addvspace
将内容行与不同章节分开。由于用于在章节之间插入间距的实际代码也取决于文档类,因此请调整实际的
\addvspace
命令,使其与.lof
或中的命令相同.lot
文件。The reason for this is that the vertical spacing between chapters in the list of figures (lof) and list of tables (lot) is added by the
\chapter
command, and there simply is no such provision for the list of listings (lol).How to fix this depends a bit on the document class you are using. If you are using the excellent
memoir
class, hooks for this purpose are already provided:If your listings are appearing in the appendices, you'll hook
\memappchapinfo
instead of\memchapinfo
. (Consult section 18.25 of the memoir manual for a list of hooks available.)If you're not using
memoir
, you'll typically need to hook your class'\@chapter
command. This could look like, for example:You can easily check what is used for generating the lol by checking the
.lol
file corresponding to your document. If your document is, for example,base.tex
, look intobase.lol
. You should see something like:Note the
\addvspace
separating the content lines from different chapters.As the actual code used to insert spacing between chapters also depends on the document class, adapt the actual
\addvspace
command to be the same as in your.lof
or.lot
files.