tocloft는 다른 장의 테이블 항목 사이에 자동으로 추가 공간을 추가하는 것 같습니다. 테이블 목록의 모든 항목 사이에 단일 공백을 원합니다. 지금은 같은 장의 항목 사이에 공백이 하나 있고 다른 장의 항목 사이에 공백이 두 개 있습니다. 여기 제가 가지고 있는 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
한 가지 가능한 해결책은 이 명령을 재정의하여 추가 간격을 억제하는 것입니다. 아래 코드는 표준 클래스에 대한 재정의를 보여줍니다 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}
비표준 클래스를 사용하고 있으므로 위의 해결책이 적합하지 않을 수 있습니다. 그런 경우에는 학급에서 이 공간을 어떻게 추가하는지 확인해야 합니다.