我有几个很长的图标题,它们跨越了图列表中的多行。我该如何删除第一行的缩进?我试过了,\setlength{\cftfignumwidth}{6 em}
但这会改变条目所有行的间距。(见下文 - 注意:我想保留完整的标题,因此使用短标题不是一个选择)
梅威瑟:
\documentclass[a4paper, 12pt]{report}
\usepackage[titles]{tocloft}
\setlength{\cftfignumwidth}{6 em}
\setlength{\cftfigindent}{0 em} % remove indentation from figures in lof
\renewcommand{\cftfigfont}{\footnotesize{Fig. }}
\renewcommand\cftfigpagefont{\footnotesize}
\begin{document}
\tableofcontents
\addcontentsline{toc}{chapter}{\listfigurename}
\listoffigures
\newpage
\begin{figure}[h!]
\caption{This figure has an extremely long title spanning more than one line in the list of figures}
\end{figure}
\begin{figure}[h!]
\caption{This figure has a short title}
\end{figure}
\end{document}
答案1
该命令\cftfigfont
用于定义条目的格式,而不是添加材料。将相应的行替换为
\renewcommand\cftfigfont{\footnotesize}
\renewcommand\cftfigpresnum{Fig. }
那么数字列表看起来正如预期的那样:
笔记您必须在\addcontentsline
图表列表前加上\clearpage
命令,否则图表列表的目录条目将显示错误的页码。
\documentclass[a4paper, 12pt]{report}
\usepackage[titles]{tocloft}
\setlength{\cftfignumwidth}{6 em}
\setlength{\cftfigindent}{0 em} % remove indentation from figures in lof
\renewcommand\cftfigfont{\footnotesize}
\renewcommand\cftfigpresnum{Fig. }
\renewcommand\cftfigpagefont{\footnotesize}
\begin{document}
\tableofcontents
\clearpage
\addcontentsline{toc}{chapter}{\listfigurename}
\listoffigures
\newpage
\begin{figure}[h!]
\caption{This figure has an extremely long title spanning more than one line in the list of figures}
\end{figure}
\begin{figure}[h!]
\caption{This figure has a short title}
\end{figure}
\end{document}