LoT 中的 vspace 与加星标的章节

LoT 中的 vspace 与加星标的章节

编辑:我原本以为这是tocloft在 LoT 中创建不同章节之间的空间。我错了。我编辑了标题,但保留了原始问题。

我目前面临以下问题:我正在tocloft为我的 ToC、LoT 和 LoF 使用该包。默认情况下 (?),它会在不同章节的表格和图片之间添加 10pt 的垂直间距。但是,这似乎不适用于带星号的章节。以下是 MWE:

\documentclass[a4paper, oneside, 11pt]{report}
\usepackage{tocloft}

\begin{document}

    \listoftables

    \newpage

    \tableofcontents

    \newpage

    \chapter{This is chapter one}

    \begin{table}
        \caption[Table 1]{This is table 1}
    \end{table}


    \chapter{This is chapter two}

    \begin{table}
        \caption[Table 2]{This is table 2}
    \end{table}

    \chapter*{Appendix\markright{Appendix}}
    \addcontentsline{toc}{chapter}{Appendix} 
    \renewcommand{\thetable}{A\arabic{table}}
    \setcounter{table}{0}

    \begin{table}
        \caption[Appendix Table]{This is a table in the appendix.}
    \end{table}


\end{document}

下面是显示该问题的屏幕截图:

LoT 中缺少垂直空间

从屏幕截图中可以看出,表 2.1 和表 A1 之间的 vspace 丢失了。有人有解决方案吗?

答案1

它是\chapter将空格添加到 LoF 和 LoT 的命令,但\chapter*并没有这样做。您可以定义一个新的宏来添加空格,并在使用时调用它\chapter*

\documentclass{report}
\newcommand{\addloflotspace}{%
  \addtocontents{lof}{\protect\addvspace{10pt}}%
  \addtocontents{lot}{\protect\addvspace{10pt}}%
}
% ...
\chapter*{No number}
\addloflotspace
This chapter ...

相关内容