![表のリスト内の章間の間隔](https://rvso.com/image/254688/%E8%A1%A8%E3%81%AE%E3%83%AA%E3%82%B9%E3%83%88%E5%86%85%E3%81%AE%E7%AB%A0%E9%96%93%E3%81%AE%E9%96%93%E9%9A%94.png)
tocloft は、異なる章の表エントリ間に余分なスペースを自動的に追加するようです。表のリスト内のすべてのエントリ間に 1 つのスペースを入れたいのですが、現在、同じ章のエントリ間には 1 つのスペースがあり、異なる章のエントリ間には 2 つのスペースがあります。これが、私が持っている MWE です。
\documentclass[11pt, letterpaper]{thesis}
\usepackage[lmargin=1.5in, rmargin=1.0in, tmargin=2.0in, bmargin=1.0in]{geometry}
\renewcommand{\thechapter}{\Roman{chapter}}
\renewcommand{\thesection}{\arabic{section}}
\renewcommand{\thetable}{\arabic{chapter}.\arabic{table}}
\usepackage{tocloft}
\addtocontents{lot}{Table \hfill\ {Page} \par}
\usepackage{titlesec}
\usepackage{caption}
\usepackage{ctable}
\usepackage{tabularx}
\begin{document}
% List of Tables
\renewcommand{\cftlottitlefont}{\normalfont}
\renewcommand\listtablename{\centerline{TABLES}}
\renewcommand{\cfttabaftersnum}{.}
\setlength{\cfttabindent}{0pt}
\setlength\cftbeforechapskip{0pt}
\setlength\cftbeforetabskip{11pt}
\listoftables
% End List of Tables
\chapter{Chapter One}
\begin{table}[htbp]
\centering
\begin{tabular}{lll}
\toprule
& Col 1 & Col 2 \\
\midrule
Row 1 & 11 & 12 \\
Row 2 & 21 & 22 \\
\bottomrule
\end{tabular}
\caption{This is table 1.1.}
\end{table}
\begin{table}[htbp]
\centering
\begin{tabular}{lll}
\toprule
& Col 1 & Col 2 \\
\midrule
Row 1 & 11 & 12 \\
Row 2 & 21 & 22 \\
\bottomrule
\end{tabular}
\caption{This is table 1.2.}
\end{table}
\chapter{Chapter Two}
\begin{table}[htbp]
\centering
\begin{tabular}{lll}
\toprule
& Col 1 & Col 2 \\
\midrule
Row 1 & 11 & 12 \\
Row 2 & 21 & 22 \\
\bottomrule
\end{tabular}
\caption{This is table 2.1.}
\end{table}
\begin{table}[htbp]
\centering
\begin{tabular}{lll}
\toprule
& Col 1 & Col 2 \\
\midrule
Row 1 & 11 & 12 \\
Row 2 & 21 & 22 \\
\bottomrule
\end{tabular}
\caption{This is table 2.2.}
\end{table}
\end{document}
を使用しています\setlength\cftbeforechapskip{0pt}
が、効果がないようです。次のものを見つけました:図表リストの行間隔を変更するにはどうすればよいですか?いくつかの提案を試してみましたが、どれもうまくいきませんでした。何かアイデアはありますか?
答え1
そのスペースは によって生成されるのではtocloft
なく、使用されるクラスによって生成されます。通常は の定義で生成さ\@chapter
れます (少なくとも標準クラスでは)。1 つの解決策としては、このコマンドを再定義して追加のスペースを抑制することが挙げられます。以下のコードは、標準クラスのこの再定義を示していますbook
(LoF と LoT にスペースを追加する行はコメント アウトされ、 でマークされています%NEW
)。
\documentclass[11pt, letterpaper]{book}
\usepackage[lmargin=1.5in, rmargin=1.0in, tmargin=2.0in, bmargin=1.0in]{geometry}
\renewcommand{\thechapter}{\Roman{chapter}}
\renewcommand{\thesection}{\arabic{section}}
\renewcommand{\thetable}{\arabic{chapter}.\arabic{table}}
\usepackage{tocloft}
\addtocontents{lot}{Table \hfill\ {Page} \par}
\usepackage{titlesec}
\usepackage{caption}
\usepackage{ctable}
\usepackage{tabularx}
\makeatletter
\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\refstepcounter{chapter}%
\typeout{\@chapapp\space\thechapter.}%
\addcontentsline{toc}{chapter}%
{\protect\numberline{\thechapter}#1}%
\else
\addcontentsline{toc}{chapter}{#1}%
\fi
\else
\addcontentsline{toc}{chapter}{#1}%
\fi
\chaptermark{#1}%
% \addtocontents{lof}{\protect\addvspace{10\p@}}% NEW
% \addtocontents{lot}{\protect\addvspace{10\p@}}% NEW
\if@twocolumn
\@topnewpage[\@makechapterhead{#2}]%
\else
\@makechapterhead{#2}%
\@afterheading
\fi}
\makeatother
\begin{document}
% List of Tables
\renewcommand{\cftlottitlefont}{\normalfont}
\renewcommand\listtablename{\centerline{TABLES}}
\renewcommand{\cfttabaftersnum}{.}
\setlength{\cfttabindent}{0pt}
\setlength\cftbeforechapskip{0pt}
\setlength\cftbeforetabskip{11pt}
\listoftables
% End List of Tables
\chapter{Chapter One}
\begin{table}[htbp]
\centering
\begin{tabular}{lll}
\toprule
& Col 1 & Col 2 \\
\midrule
Row 1 & 11 & 12 \\
Row 2 & 21 & 22 \\
\bottomrule
\end{tabular}
\caption{This is table 1.1.}
\end{table}
\begin{table}[htbp]
\centering
\begin{tabular}{lll}
\toprule
& Col 1 & Col 2 \\
\midrule
Row 1 & 11 & 12 \\
Row 2 & 21 & 22 \\
\bottomrule
\end{tabular}
\caption{This is table 1.2.}
\end{table}
\chapter{Chapter Two}
\begin{table}[htbp]
\centering
\begin{tabular}{lll}
\toprule
& Col 1 & Col 2 \\
\midrule
Row 1 & 11 & 12 \\
Row 2 & 21 & 22 \\
\bottomrule
\end{tabular}
\caption{This is table 2.1.}
\end{table}
\begin{table}[htbp]
\centering
\begin{tabular}{lll}
\toprule
& Col 1 & Col 2 \\
\midrule
Row 1 & 11 & 12 \\
Row 2 & 21 & 22 \\
\bottomrule
\end{tabular}
\caption{This is table 2.2.}
\end{table}
\end{document}
非標準クラスを使用しているため、上記のソリューションは適切ではない可能性があります。その場合、クラスがこのスペースをどのように追加しているかを確認する必要があります。