删除图表列表和表格列表中章节分隔符之间的空格

删除图表列表和表格列表中章节分隔符之间的空格

正在为我的论文空间而奋斗;)

已经能够删除目录中章节分隔符之间的垂直空间,但尝试对 LoF 和 LoT 执行同样操作

目前我正在使用 tocloft 包。利用该包中的许多自定义间距,我设法按照自己的喜好调整了目录

但是,我在 LoF 和 LoT 上没有取得同样的成功。在这个 stack exchange 上找到了很多对其他人有用但到目前为止对我不起作用的解决方案。

这是我现在正在使用的序言:(请注意,有几件事被注释掉了,因为我认为当我有命令时它们什么也不做)

\documentclass[10pt, letterpaper, oneside]{book}

\renewcommand{\baselinestretch}{1.5} 


% ####################### PACKAGES TO USE
\usepackage{amsmath} % for equation labelling
\usepackage{amssymb} % for more fancy math symbols
\usepackage[font=footnotesize, labelfont=bf]{caption} % make captions smaller text and make them BOLD 
\usepackage[font=scriptsize,labelfont=bf]{caption}
%\captionsetup{font=scriptsize}
\usepackage[usenames,dvipsnames]{color} % for colOUred text (stupid american spelling...)
\usepackage{enumitem} % to control some lengths in itemized lists
\usepackage{etoolbox}  % various hacks, spacing stuff included
\usepackage{fancyhdr} % for headers on each page (and customization of them)
\usepackage[top=1 in, bottom=1 in, left=1 in, right=1 in]{geometry} % edit individual margins
\usepackage{graphicx} % for figures in general
\usepackage{hyperref} % for "clickable" links to figures/refs/(etc.)
\usepackage{lastpage} % for page __ of __
\usepackage{multicol} % for multiple column environments (in equations and tables)
\usepackage{multirow} % for multiple row environments (in equations and tables)
\usepackage{mdwlist}  % tighter packed bulleted lists
\usepackage[sort&compress,numbers]{natbib} % for getting rid of extra space in references section 
\usepackage{setspace} % for line spacing between lines and also for bibliography
\usepackage{siunitx} % for scientific units (add [scientific-notation=true] for scientific notation always)
\usepackage{tabularx} % to try and get variable-spacing columns
\usepackage{tabu}  % for some fancy table stuff (now with like thicker lines!!)
\usepackage{titlesec}  % for some heading customization (use [compact] option to get rid of white space after section headings)
\usepackage{tocloft} % some TOC customization
\usepackage{threeparttable}
\usepackage{arydshln} % provides dashed lines in tables and arrays



\titleformat{\chapter}[display] {\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{10pt}{\huge}   
\titlespacing*{\chapter}{0pt}{-25pt}{30pt}

% TOC/LOF/LOT spacing changes (uses tocloft package)
\setlength{\cftbeforechapskip}{0.5 em} % space between chapters in TOC only
\setlength{\cftbeforetoctitleskip}{-1em} % space before the TOC title
\setlength{\cftaftertoctitleskip}{2em} % space after TOC title

%\setlength{\cftbeforefigskip}{0.5 em}
\setlength{\cftbeforeloftitleskip}{-1 em} % space before the LoF title
\setlength{\cftafterloftitleskip}{2 em} % space after the LoF title

\setlength{\cftbeforelottitleskip}{-1 em} % space before the LoT title 
\setlength{\cftafterlottitleskip}{2 em} % space after the LoT title



\makeatletter
% \patchcmd{<cmd>}{<search>}{<replace>}{<succes>}{<failure>}
\patchcmd{\@chapter}{\addtocontents{lof}{\protect\addvspace{10\p@}}}{}{}{}% LoF
\addtocontents{toc}{\protect\renewcommand*\protect\addvspace[1]{}}
%\patchcmd{\@chapter}{\addtocontents{lot}{\protect\addvspace{2\p@}}}{}{}{}% LoT
\makeatother


\setlength{\parindent}{2.5em} % first line indent size
\setlist[itemize]{leftmargin=*}
\setlist[enumerate]{leftmargin=*}



\graphicspath
{
    {./img/}
    {./img/chapter1/}
    {./img/chapter2/}
    {./img/chapter3and4/} % chapters 3 and 4 were once one chapter
    {./img/chapter5/}
    {./img/chapter6/}
    {./img/chapter7/}
    {./img/chapter8/}
    {./img/chapter9/}
}



\hypersetup
{
    colorlinks = true,
    citecolor = black,
    linkcolor = blue, % link colour for figure, equation, + table refs
    urlcolor = black, % link colour for websites (mainly in citations)
}


\makeatletter
\patchcmd{\@chapter}{\addtocontents{lof}{\protect\addvspace{10\p@}}}{}{}{}% LoF
\addtocontents{toc}{\protect\renewcommand*\protect\addvspace[1]{}}
\def\ttl@tocsep{}
\def\bstctlcite{\@ifnextchar[{\@bstctlcite}{\@bstctlcite[@auxout]}}
\def\@bstctlcite[#1]#2{\@bsphack
    \@for\@citeb:=#2\do{%
        \edef\@citeb{\expandafter\@firstofone\@citeb}%
        \if@filesw\immediate\write\csname #1\endcsname{\string\citation{\@citeb}}\fi}%
    \@esphack}
\makeatother 


\renewcommand\chaptermark[1]{\markboth{\textsc{Chapter \thechapter:\ #1}}{}}
\fancyhf{}
\fancyhead[L]{\leftmark}
\renewcommand\headrulewidth{0pt}% suppress the header rule
%\fancyfoot[C]{\thepage}
\fancyhead[R]{\thepage}


\renewcommand{\bibname}{References} % ("biblography" is kinda boring)
\renewcommand{\contentsname}{Table of Contents}

答案1

如果你使用memoir(覆盖book类)类而不是book那么答案很简单。在序言中输入:

\renewcommand{\insertchapterspace}{}

它修改了\chapter宏,以便不在 LOF 和 ToC 中放置任何额外的空格。

在你的 MWE 中,你有一个这样的句子

\patchcmd{\@chapter}{\addtocontents{lof}{\protect\addvspace{10\p@}}}{}{}{}

你为什么有两份这份副本?

也许如果你把它...\addvspace{0\p@}...改成

\patchcmd{\@chapter}{\addtocontents{lof}{\protect\addvspace{0\p@}}}{}{}{}

你会在 LoF 中得到你想要的东西。

对于 ToC,类似的宏,{lof}用替换{lot}

相关内容