我在 LoF 中添加了图形标签,但标题被挂住了,这是我的 MWE:
\documentclass{book}
\usepackage{amsmath}
%i tried this solution
\usepackage[titles]{tocloft}
\cftsetindents{figure}{0em}{2.5em}
\cftsetindents{table}{0em}{2.5em}
\begin{document}
{% to add label/ figure to LoF
\let\oldnumberline\numberline%
\renewcommand{\numberline}{\figurename~\oldnumberline}%
\listoffigures%
}
\begin{figure}
\caption{stuff The second instruction, i.e., the resetting of the indentation amount for the entries in the List of Tables, isn't strictly necessary for your}
\label{fig:first9}
\end{figure}
\begin{figure}
\caption{stufThe second instruction, i.e., the resetting of the indentation amount for the entries in the List of Tables, isn't strictly necessary for you}
\label{fig:first11}
\end{figure}
\end{document}
答案1
该软件包tocloft
提供了一些命令来实现您想要的操作,而无需修改的含义\numberline
。
您可以简单地使用\listoffigures
以下几行并将其添加到您的序言中:
\renewcommand\cftfigpresnum{\figurename~}
\newlength\mylength
\settowidth\mylength{\cftfigpresnum}
\addtolength\cftfignumwidth{\mylength}
梅威瑟:
\documentclass{book}
\usepackage{amsmath}
%i tried this solution
\usepackage[titles]{tocloft}
\cftsetindents{figure}{0em}{2.5em}
\renewcommand\cftfigpresnum{\figurename~}
\newlength\mylength
\settowidth\mylength{\cftfigpresnum}
\addtolength\cftfignumwidth{\mylength}
\cftsetindents{table}{0em}{2.5em}
\begin{document}
\listoffigures
\begin{figure}
\caption{stuff The second instruction, i.e., the resetting of the indentation amount for the entries in the List of Tables, isn't strictly necessary for your}
\label{fig:first9}
\end{figure}
\begin{figure}
\caption{stufThe second instruction, i.e., the resetting of the indentation amount for the entries in the List of Tables, isn't strictly necessary for you}
\label{fig:first11}
\end{figure}
\end{document}
输出:
如果您需要相同的行为\listoftables
,也请添加以下几行:
\renewcommand\cfttabpresnum{\tablename~}
\settowidth\mylength{\cfttabpresnum}
\addtolength\cfttabnumwidth{\mylength}