我定义了一个自定义浮点数,我想在文档开头打印它的列表。但是,浮点数(在列表中)前后的间距与“常规”浮点数(例如)的间距不同,figure
而且太小了。当章节超过 10 个时,这种情况更加明显,因为浮点数与标题重叠。
为什么间距不一样,如何统一设置?
这是一个小型的 MWE:
\documentclass[oneside]{scrbook}
\DeclareNewTOC[%
type=myfloat,
float,
floatpos=tbph,
counterwithin=chapter,
name=Custom,
listname={List of Custom Floats}
]{listofmyfloats}
\setuptoc{listofmyfloats}{chapteratlist}
\begin{document}
\clearpage\listoffigures
\clearpage\listofmyfloats
\chapter{First Chapter}
\begin{figure}
\caption{A figure}
\end{figure}
\begin{myfloat}
\caption{A custom float}
\end{myfloat}
\chapter{Second Chapter}
\chapter{Third Chapter}
\chapter{Fourth Chapter}
\chapter{Fifth Chapter}
\chapter{Sixth Chapter}
\chapter{Seventh Chapter}
\chapter{Eight Chapter}
\chapter{Ninth Chapter}
\chapter{Tenth Chapter}
\begin{figure}
\caption{Another figure}
\end{figure}
\begin{myfloat}
\caption{Another custom float}
\end{myfloat}
\end{document}
答案1
你可以使用
\makeatletter
\let\l@myfloat\l@figure
\makeatother
或添加
tocentryindent=1.5em,% default is 1em, figure uses 1.5em
tocentrynumwidth=2.3em% default is 1.5em, figure uses 2.3em
到选项\DeclareNewTOC
(参见文档)。
例子:
\documentclass[oneside]{scrbook}
\DeclareNewTOC[%
type=myfloat,
float,
floatpos=tbph,
counterwithin=chapter,
name=Custom,
listname={List of Custom Floats},
tocentryindent=1.5em,% <- added
tocentrynumwidth=2.3em% <- added
]{listofmyfloats}
\setuptoc{listofmyfloats}{chapteratlist}
\begin{document}
\listoffigures
\listofmyfloats
\chapter{First Chapter}
\begin{figure}
\caption{A figure}
\end{figure}
\begin{myfloat}
\caption{A custom float}
\end{myfloat}
\chapter{Second Chapter}
\chapter{Third Chapter}
\chapter{Fourth Chapter}
\chapter{Fifth Chapter}
\chapter{Sixth Chapter}
\chapter{Seventh Chapter}
\chapter{Eight Chapter}
\chapter{Ninth Chapter}
\chapter{Tenth Chapter}
\begin{figure}
\caption{Another figure}
\end{figure}
\begin{myfloat}
\caption{Another custom float}
\end{myfloat}
\end{document}