从上图可以看出,图 1.3 和 2.1 的条目间距与同一章的图的条目间距不同。表格列表也是如此。我希望所有条目的间距完全相同
解决方案删除 LoF 中各章节图片之间的间距 此处不起作用。尝试将其添加到下面的示例中
\makeatletter
\patchcmd{\@chapter}{\addtocontents{lof}{\protect\addvspace{10\p@}}}{}{}{}% LoF
\patchcmd{\@chapter}{\addtocontents{lot}{\protect\addvspace{10\p@}}}{}{}{}% LoT
\makeatother
您将得到相同的输出。我认为这是因为上一个问题中的示例没有tocloft
包含包。
\documentclass[11pt]{book}
\usepackage{calc}
\usepackage[x11names]{xcolor}
% BEGIN_FOLD
\usepackage[a4paper]{geometry}
% BEGIN_FOLD
\geometry{twoside=false, showframe=false,inner=1.05in,outer=1.05in,includemp=true,asymmetric=true,bindingoffset=0mm,marginparsep=0mm, marginparwidth=0mm}
\geometry{bottom=0.9in,vmarginratio=3:5,includehead=true, includefoot=true,headheight=8pt, headsep=14pt,footskip=10.9mm}
% END_FOLD
\usepackage{fontspec}
\usepackage[TS1]{fontenc}
\setmainfont{Georgia}
\usepackage[Omega]{gensymb}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{hyperref}
\hypersetup{colorlinks=true, linkcolor=DodgerBlue2}
% ========== Table of Content Packages ==========
% BEGIN_FOLD
\usepackage{tocloft}
% BEGIN_FOLD
% TOC customization
% Set lengths
\newlength{\toclabeltonamel}
\setlength{\toclabeltonamel}{2mm} % length from label to the name of title
\newlength{\toclineskipl}
\setlength{\toclineskipl}{0.5\baselineskip} % nominal skip betweek lines
% Spacing
% Chapters, sections, and subsections
\setlength{\cftbeforechapskip}{1.5\toclineskipl}
\setlength{\cftbeforesecskip}{\toclineskipl}
\setlength{\cftbeforesubsecskip}{0mm}
% Main title
\setlength{\cftbeforetoctitleskip}{0\toclineskipl} % (default: around 9\toclineskipl)
\setlength{\cftaftertoctitleskip}{5\toclineskipl} % (default: around 7\toclineskipl)
% Spacing between lines
\renewcommand{\cftchapafterpnum}{\vspace{\toclineskipl}} % for spacing after each entry
\renewcommand{\cftsecafterpnum}{\vspace{\toclineskipl}} % for spacing after each entry
\renewcommand{\cftsubsecafterpnum}{\vspace{\toclineskipl}} % for spacing after each entry
% Entries indentations
% Labels widths
\setlength{\cftchapnumwidth}{0mm}
\newlength{\widthcftsecnumwidth}
\setlength{\widthcftsecnumwidth}{\widthof{1.2.3.~}}
\setlength{\cftsecnumwidth}{\widthcftsecnumwidth}
\newlength{\widthcftsubsecnumwidth}
\setlength{\widthcftsubsecnumwidth}{\widthof{1.2.3.~~}}
\setlength{\cftsubsecnumwidth}{\widthcftsubsecnumwidth}
% prelabel content
\renewcommand{\cftchappresnum}{\chaptername}
\renewcommand{\cftsecpresnum}{}
\renewcommand{\cftsubsecpresnum}{}
% Post label contents (usually empty space or new line)
\renewcommand{\cftchapaftersnumb}{\vspace{\toclineskipl}\par}
% Labels indentations
\setlength{\cftchapindent}{0mm}
\setlength{\cftsecindent}{\widthof{\cftchapaftersnumb}}
\setlength{\cftsubsecindent}{\cftsecindent + \widthof{\cftsecaftersnumb} + \cftsecnumwidth}
% amount of left margin to the label
% Margins (see the LateX Companion, 51 for more details)
\cftsetpnumwidth{8mm}
\cftsetrmarg{2.5em plus 1fil}
% Fonts
% Definitions
\newcommand{\toctitlefont}{\Large \bfseries} % font of the titles of lists (e.g., List of Tables)
\newcommand{\tocchapfont}{\large \bfseries}
\newcommand{\tocchappagefont}{\large \bfseries}
\newcommand{\tocsecpagefont}{\large}
\newcommand{\tocsubsecpagefont}{\normalfont}
% Titles and labels
\renewcommand{\cfttoctitlefont}{\toctitlefont}
\renewcommand{\cftchapfont}{\tocchapfont}
\renewcommand{\cftsecfont}{\large}
\renewcommand{\cftsubsecfont}{\normalfont}
% Numbering
\renewcommand{\cftchappagefont}{\tocchappagefont}
\renewcommand{\cftsecpagefont}{\tocsecpagefont}
\renewcommand{\cftsubsecpagefont}{\tocsubsecpagefont}
% Dots and spacing
% Definitions
\newcommand{\tocchapleaderformat}{\bfseries\cftdotfill{\cftdotsep}}
\newcommand{\tocsecleaderformat}{\cftdotfill{\cftdotsep}}
% Dots
\renewcommand{\cftchapleader}{\tocchapleaderformat}
% To remove chapters dots from LoF and LoT, use
% \renewcommand{\cftchapleader}{\hfill}
% Before \listoffigures and \listoftables
% Leaders are also available for parts, sections, subsections, figures, and tables
\renewcommand{\cftsecleader}{\tocsecleaderformat}
% Names
\renewcommand{\cftchappresnum}{\color{\colorlink}\chaptername~} % chapter names
\renewcommand{\contentsname}{\uppercase{Table of Contents}}
\renewcommand{\listfigurename}{\uppercase{List of Figures}}
\renewcommand{\listtablename}{\uppercase{List of Tables}}
% LoF and LoT customization
% Spacing
% Chapters, sections, and subsections
\setlength{\cftbeforefigskip}{\toclineskipl}
\setlength{\cftbeforetabskip}{\toclineskipl}
% Main title
\setlength{\cftbeforeloftitleskip}{0\toclineskipl}
\setlength{\cftafterloftitleskip}{5\toclineskipl}
\setlength{\cftbeforelottitleskip}{0\toclineskipl}
\setlength{\cftafterlottitleskip}{5\toclineskipl}
% Spacing between lines
\renewcommand{\cftfigafterpnum}{\vspace{\toclineskipl}}
\renewcommand{\cfttabafterpnum}{\vspace{\toclineskipl}}
% Entries indentations
% Labels widths
\newlength{\widthcftfignumwidth}
\setlength{\widthcftfignumwidth}{\widthof{1.2.3~}}
\setlength{\cftfignumwidth}{\widthcftfignumwidth}
\newlength{\widthcfttabnumwidth}
\setlength{\widthcfttabnumwidth}{\widthof{1.2.3~}}
\setlength{\cfttabnumwidth}{\widthcfttabnumwidth}
% Labels indentations
\setlength{\cftfigindent}{0mm}
\setlength{\cfttabindent}{0mm}
% amount of left margin to the label
% Fonts
% Titles and labels
\renewcommand{\cftloftitlefont}{\toctitlefont}
\renewcommand{\cftfigfont}{\tocsecpagefont}
\renewcommand{\cftlottitlefont}{\toctitlefont}
\renewcommand{\cfttabfont}{\tocsecpagefont}
% Numbering
\renewcommand{\cftfigpagefont}{\tocsecpagefont}
\renewcommand{\cfttabpagefont}{\tocsecpagefont}
% link colors
\newcommand{\colorlink}{DodgerBlue3}
% END_FOLD
% END_FOLD
\begin{document}
\pagestyle{plain}
\frontmatter
{
\centering
\listoffigures
\clearpage
\listoftables
\clearpage
\tableofcontents
}
\mainmatter
\newcommand{\figureandtable}{
\begin{figure}
\caption{Impact of impedance ratios with different angles in the same quadrant on grid strength at the reference POI.}
\end{figure}
\begin{table}
\caption{Top Five Weakest Combinations of POIs Identified with Exhaustive Search Method and the Proposed Method}
\end{table}
}
\chapter{Introduction}
\section{Background}
\subsection{Review of Control or Compensation Based Techniques to Mitigate Grid Weakness Symptoms}
\section{Background About Round-Off Errors During the Inversion of Ill-Conditioned Matrices}
\figureandtable
\figureandtable
\figureandtable
\chapter{A Method to Identify Weak Points of Interconnection of Renewable Energy Resources}
\section{Proposed Method to Update ${Z}_{bus}$ to Account for Changes in the Series Impedance of a Branch}
\figureandtable
\figureandtable
\figureandtable
\chapter{Vector-Based Approach to Analyze Transmission Network Effect on Interaction Among Renewables}
\section{A Mathematical Basis for Understanding the Relationship Between Interaction and Structural Changes in Power Grid}
\figureandtable
\figureandtable
\figureandtable
\subsection{Combined Effect of $\bar{w}_{ij}$ Angle and Magnitude Near When its Angle is Near $\pm 90^{\degree}$}
\end{document}
答案1
使用{\renewcommand*{\addvspace}[1]{}\listoffigures}
和{\renewcommand*{\addvspace}[1]{}\listoftables}
\documentclass[11pt]{book}
\usepackage{etoolbox}
\usepackage{calc}
\usepackage[x11names]{xcolor}
% BEGIN_FOLD
\usepackage[a4paper]{geometry}
% BEGIN_FOLD
\geometry{twoside=false, showframe=false,inner=1.05in,outer=1.05in,includemp=true,asymmetric=true,bindingoffset=0mm,marginparsep=0mm, marginparwidth=0mm}
\geometry{bottom=0.9in,vmarginratio=3:5,includehead=true, includefoot=true,headheight=8pt, headsep=14pt,footskip=10.9mm}
% END_FOLD
\usepackage{fontspec}
\usepackage[TS1]{fontenc}
\setmainfont{Georgia}
\usepackage[Omega]{gensymb}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{hyperref}
\hypersetup{colorlinks=true, linkcolor=DodgerBlue2}
% ========== Table of Content Packages ==========
% BEGIN_FOLD
\usepackage{tocloft}
% BEGIN_FOLD
% TOC customization
% Set lengths
\newlength{\toclabeltonamel}
\setlength{\toclabeltonamel}{2mm} % length from label to the name of title
\newlength{\toclineskipl}
\setlength{\toclineskipl}{0.5\baselineskip} % nominal skip betweek lines
% Spacing
% Chapters, sections, and subsections
\setlength{\cftbeforechapskip}{1.5\toclineskipl}
\setlength{\cftbeforesecskip}{\toclineskipl}
\setlength{\cftbeforesubsecskip}{0mm}
% Main title
\setlength{\cftbeforetoctitleskip}{0\toclineskipl} % (default: around 9\toclineskipl)
\setlength{\cftaftertoctitleskip}{5\toclineskipl} % (default: around 7\toclineskipl)
% Spacing between lines
\renewcommand{\cftchapafterpnum}{\vspace{\toclineskipl}} % for spacing after each entry
\renewcommand{\cftsecafterpnum}{\vspace{\toclineskipl}} % for spacing after each entry
\renewcommand{\cftsubsecafterpnum}{\vspace{\toclineskipl}} % for spacing after each entry
% Entries indentations
% Labels widths
\setlength{\cftchapnumwidth}{0mm}
\newlength{\widthcftsecnumwidth}
\setlength{\widthcftsecnumwidth}{\widthof{1.2.3.~}}
\setlength{\cftsecnumwidth}{\widthcftsecnumwidth}
\newlength{\widthcftsubsecnumwidth}
\setlength{\widthcftsubsecnumwidth}{\widthof{1.2.3.~~}}
\setlength{\cftsubsecnumwidth}{\widthcftsubsecnumwidth}
% prelabel content
\renewcommand{\cftchappresnum}{\chaptername}
\renewcommand{\cftsecpresnum}{}
\renewcommand{\cftsubsecpresnum}{}
% Post label contents (usually empty space or new line)
\renewcommand{\cftchapaftersnumb}{\vspace{\toclineskipl}\par}
% Labels indentations
\setlength{\cftchapindent}{0mm}
\setlength{\cftsecindent}{\widthof{\cftchapaftersnumb}}
\setlength{\cftsubsecindent}{\cftsecindent + \widthof{\cftsecaftersnumb} + \cftsecnumwidth}
% Margins (see the LateX Companion, 51 for more details)
\cftsetpnumwidth{8mm}
\cftsetrmarg{2.5em plus 1fil}
% Fonts
% Definitions
\newcommand{\toctitlefont}{\Large \bfseries} % font of the titles of lists (e.g., List of Tables)
\newcommand{\tocchapfont}{\large \bfseries}
\newcommand{\tocchappagefont}{\large \bfseries}
\newcommand{\tocsecpagefont}{\large}
\newcommand{\tocsubsecpagefont}{\normalfont}
% Titles and labels
\renewcommand{\cfttoctitlefont}{\toctitlefont}
\renewcommand{\cftchapfont}{\tocchapfont}
\renewcommand{\cftsecfont}{\large}
\renewcommand{\cftsubsecfont}{\normalfont}
% Numbering
\renewcommand{\cftchappagefont}{\tocchappagefont}
\renewcommand{\cftsecpagefont}{\tocsecpagefont}
\renewcommand{\cftsubsecpagefont}{\tocsubsecpagefont}
% Dots and spacing
% Definitions
\newcommand{\tocchapleaderformat}{\bfseries\cftdotfill{\cftdotsep}}
\newcommand{\tocsecleaderformat}{\cftdotfill{\cftdotsep}}
% Dots
\renewcommand{\cftchapleader}{\tocchapleaderformat}
% To remove chapters dots from LoF and LoT, use
% \renewcommand{\cftchapleader}{\hfill}
% Before \listoffigures and \listoftables
% Leaders are also available for parts, sections, subsections, figures, and tables
\renewcommand{\cftsecleader}{\tocsecleaderformat}
% Names
\renewcommand{\cftchappresnum}{\color{\colorlink}\chaptername~} % chapter names
\renewcommand{\contentsname}{\uppercase{Table of Contents}}
\renewcommand{\listfigurename}{\uppercase{List of Figures}}
\renewcommand{\listtablename}{\uppercase{List of Tables}}
% LoF and LoT customization
% Spacing
% Chapters, sections, and subsections
\setlength{\cftbeforefigskip}{\toclineskipl}
\setlength{\cftbeforetabskip}{\toclineskipl}
% Main title
\setlength{\cftbeforeloftitleskip}{0\toclineskipl}
\setlength{\cftafterloftitleskip}{5\toclineskipl}
\setlength{\cftbeforelottitleskip}{0\toclineskipl}
\setlength{\cftafterlottitleskip}{5\toclineskipl}
% Spacing between lines
\renewcommand{\cftfigafterpnum}{\vspace{\toclineskipl}}
\renewcommand{\cfttabafterpnum}{\vspace{\toclineskipl}}
% Entries indentations
% Labels widths
\newlength{\widthcftfignumwidth}
\setlength{\widthcftfignumwidth}{\widthof{1.2.3~}}
\setlength{\cftfignumwidth}{\widthcftfignumwidth}
\newlength{\widthcfttabnumwidth}
\setlength{\widthcfttabnumwidth}{\widthof{1.2.3~}}
\setlength{\cfttabnumwidth}{\widthcfttabnumwidth}
% Labels indentations
\setlength{\cftfigindent}{0mm}
\setlength{\cfttabindent}{0mm}
% amount of left margin to the label
% Fonts
% Titles and labels
\renewcommand{\cftloftitlefont}{\toctitlefont}
\renewcommand{\cftfigfont}{\tocsecpagefont}
\renewcommand{\cftlottitlefont}{\toctitlefont}
\renewcommand{\cfttabfont}{\tocsecpagefont}
% Numbering
\renewcommand{\cftfigpagefont}{\tocsecpagefont}
\renewcommand{\cfttabpagefont}{\tocsecpagefont}
% link colors
\newcommand{\colorlink}{DodgerBlue3}
% END_FOLD
% END_FOLD
\begin{document}
\pagestyle{plain}
\frontmatter
{
\centering
{
\renewcommand*{\addvspace}[1]{}
\listoffigures
}
\clearpage
{
\renewcommand*{\addvspace}[1]{}
\listoftables
}
\clearpage
\tableofcontents
}
\mainmatter
\newcommand{\figureandtable}{
\begin{figure}
\caption{Impact of impedance ratios with different angles in the same quadrant on grid strength at the reference POI.}
\end{figure}
\begin{table}
\caption{Top Five Weakest Combinations of POIs Identified with Exhaustive Search Method and the Proposed Method}
\end{table}
}
\chapter{Introduction}
\section{Background}
\subsection{Review of Control or Compensation Based Techniques to Mitigate Grid Weakness Symptoms}
\section{Background About Round-Off Errors During the Inversion of Ill-Conditioned Matrices}
\figureandtable
\figureandtable
\figureandtable
\chapter{A Method to Identify Weak Points of Interconnection of Renewable Energy Resources}
\section{Proposed Method to Update ${Z}_{bus}$ to Account for Changes in the Series Impedance of a Branch}
\figureandtable
\figureandtable
\figureandtable
\chapter{Vector-Based Approach to Analyze Transmission Network Effect on Interaction Among Renewables}
\section{A Mathematical Basis for Understanding the Relationship Between Interaction and Structural Changes in Power Grid}
\figureandtable
\figureandtable
\figureandtable
\subsection{Combined Effect of $\bar{w}_{ij}$ Angle and Magnitude Near When its Angle is Near $\pm 90^{\degree}$}
\end{document}