在尝试正确设置论文格式时,我遇到了一个问题,即图表列表中的图表标题重叠。我花了相当多的时间尝试创建 MWE,因为大学模板包含大量我看不懂的代码。此外,这个错误似乎特别险恶,随机变化似乎会导致它出现和消失。
以下是我可以管理的 MWE......
\documentclass[12pt]{report}
\usepackage{mwe}
\usepackage[letterpaper]{geometry}
\geometry{verbose, margin = 1in}
\usepackage[doublespacing]{setspace}
\usepackage{tocloft}
\usepackage{etoolbox}
\preto\figure{% Removes the extra space added before new chapters
\ifnum\value{figure}=0\addtocontents{lof}{\vskip-10pt}\fi
}
\begin{document}
\listoffigures
\pagebreak
\begin{figure}
\centering
\includegraphics[width=2cm]{example-image-a.png}
\caption{dummy text 1}
\end{figure}
\chapter{Beginning}
\begin{figure}
\centering
\includegraphics[width=2cm]{example-image-a.png}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=2cm]{example-image-a.png}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=2cm]{example-image-a.png}
\caption{dummy text 2}
\end{figure}
\end{document}
答案1
看看这是否适合你的大学。请注意,LOF 仍然是双倍行距(除非你删除 setspace),但至少它不是三倍行距。(看看你是否能说服他们双倍行距只适用于打字机。)
\documentclass[12pt]{report}
\usepackage{mwe}
\usepackage[letterpaper]{geometry}
\geometry{verbose, margin = 1in}
\usepackage[doublespacing]{setspace}
\usepackage{tocloft}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\@chapter}{\addtocontents{lof}{\protect\addvspace{10\p@}}}{}{}{}
\makeatother
\begin{document}
\listoffigures
\pagebreak
\begin{figure}
\centering
\includegraphics[width=2cm]{example-image-a.png}
\caption{dummy text 1}
\end{figure}
\chapter{Beginning}
\begin{figure}
\centering
\includegraphics[width=2cm]{example-image-a.png}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=2cm]{example-image-a.png}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=2cm]{example-image-a.png}
\caption{dummy text 2}
\end{figure}
\end{document}