KOMA 图书类:listoftables 增加表格编号和标题之间的间距

KOMA 图书类:listoftables 增加表格编号和标题之间的间距

在我的表格列表,数字和标题文本太靠近,有时会重叠,导致数字过宽。

为此会生成一个警报(尽管它没有提到表格列表具体来说):

Package tocbasic Warning: number width of table toc entries should be increased
!
(tocbasic)                Currently used number width = 25.2507pt,
(tocbasic)                Wanted number separation    = 4.37993pt,
(tocbasic)                Reserved number width       = 25.18501pt on input line 16.

这是一个非常人为的例子,其中表格的编号被标题覆盖

\documentclass{scrbook}

\begin{document}
\tableofcontents
\listoftables

\chapter{Twiddle}
\section{Dee}
\appendix
\setcounter{chapter}{22}
\chapter{Tweedle}
\section{Dum}
\begin{table}[htb]
\caption{The is time is 5:21}
\caption{The is time is 5:22}
\caption{The is time is 5:23}
\caption{The is time is 5:24}
\caption{The is time is 5:25}
\caption{The is time is 5:26}
\caption{The is time is 5:27}
\caption{The is time is 5:28}
\caption{The is time is 5:29}
\caption{The is time is 5:30}
\caption{The is time is 5:31}
\caption{The is time is 5:32}
\caption{The is time is 5:33}
\caption{The is time is 5:34}
\caption{The is time is 5:35}
\caption{The is time is 5:36}
\caption{The is time is 5:37}
\caption{The is time is 5:38}
\end{table}


\end{document}enter code here

在此处输入图片描述 当这件事发生在主要目录我可以调整托克纳姆宽度使用以下命令:

\RedeclareSectionCommand[
  tocnumwidth=30pt
]{section}
\RedeclareSectionCommand[
  tocnumwidth=36pt
]{subsection}

我应该使用什么名称(而不是章节或小节)来调整托克纳姆宽度为一个表格列表和/或图片列表;或者有没有完全不同的方法可以做到这一点?

另外,有人能建议我如何通过查看源代码或更好的是,在 KOMAscript 手册中发现这一点吗?

答案1

\RedeclareSectionCommand不能用于配置table表列表的条目。但是阅读以下文档\RedeclareSectionCommand

不同的目录条目样式还具有不同的附加属性。如果在它们前面加上 ,则可以直接设置它们。例如,您可以使用toc设置 […] 数字宽度 。有关更多目录条目样式属性,请参阅第 15.3 节 […]numwidthtocnumwidth

导致进入第 15.3 节和属性numwidth。在本节中,我们可以找到\DeclareTOCStyleEntry设置命令numwidth。该命令有一个可选参数和两个必需参数。第一个可选参数是选项或属性的列表。这是numwidth=…我们想要设置的。第二个必需参数是样式。对于表格或图形条目,我们可以使用(default这是 KOMA-Script 类使用的默认样式)或提供专用样式numwidth,例如tocline。最后一个也是必需的参数是条目级别,即table。因此,我们将有例如序言行:

\DeclareTOCStyleEntry[numwidth=35pt]{default}{table}

将使用样式(带有)的条目numwidth的数字宽度属性设置为 35pt。tabledefaulttoclinescrbook

将其添加到您的示例中:

\documentclass{scrbook}
\DeclareTOCStyleEntry[numwidth=35pt]{default}{table}
\begin{document}
\tableofcontents
\listoftables

\chapter{Twiddle}
\section{Dee}
\appendix
\setcounter{chapter}{22}
\chapter{Tweedle}
\section{Dum}
\begin{table}[htb]
\caption{The is time is 5:21}
\caption{The is time is 5:22}
\caption{The is time is 5:23}
\caption{The is time is 5:24}
\caption{The is time is 5:25}
\caption{The is time is 5:26}
\caption{The is time is 5:27}
\caption{The is time is 5:28}
\caption{The is time is 5:29}
\caption{The is time is 5:30}
\caption{The is time is 5:31}
\caption{The is time is 5:32}
\caption{The is time is 5:33}
\caption{The is time is 5:34}
\caption{The is time is 5:35}
\caption{The is time is 5:36}
\caption{The is time is 5:37}
\caption{The is time is 5:38}
\end{table}

\end{document}

结果是:

在此处输入图片描述

顺便说一句:除了使用显式的,numwidth您还可以使用属性dynnumwidth

\documentclass{scrbook}
\DeclareTOCStyleEntry[dynnumwidth]{default}{table}
\begin{document}
\tableofcontents
\listoftables

\chapter{Twiddle}
\section{Dee}
\appendix
\setcounter{chapter}{22}
\chapter{Tweedle}
\section{Dum}
\begin{table}[htb]
\caption{The is time is 5:21}
\caption{The is time is 5:22}
\caption{The is time is 5:23}
\caption{The is time is 5:24}
\caption{The is time is 5:25}
\caption{The is time is 5:26}
\caption{The is time is 5:27}
\caption{The is time is 5:28}
\caption{The is time is 5:29}
\caption{The is time is 5:30}
\caption{The is time is 5:31}
\caption{The is time is 5:32}
\caption{The is time is 5:33}
\caption{The is time is 5:34}
\caption{The is time is 5:35}
\caption{The is time is 5:36}
\caption{The is time is 5:37}
\caption{The is time is 5:38}
\end{table}

\end{document}

至少LaTeX 运行后结果为:

在此处输入图片描述

有关文档,dynnumwidth请参阅 KOMA-Script 手册中的表 15.1。

内幕消息:如果您想知道使用的numwidthdynnumwidth,请参阅行

\global\@namedef{scr@dte@table@lastmaxnumwidth}{32.66748pt}

*.aux文件中。

相关内容