我需要图形条目列表看起来像上图一样。我在标题图片中使用了格式,但它不会显示。我还尝试过:
\renewcommand{\cftfigpresnum}{\textbf{Fig. }}
\renewcommand{\cftfigaftersnum}{:}
\renewcommand{\cftfigaftersnumb}{\quad}
我使用过的一些代码是:
\documentclass[12pt,a4paper]{article}
\usepackage{graphicx}
\usepackage{float}
\usepackage{tocloft}
\usepackage{float}
\usepackage{amsmath}
\usepackage{chngcntr}
\counterwithin{figure}{section}
\renewcommand{\thefigure}{\thesection-\arabic {figure}\hspace{.3em}}
\renewcommand{\figurename}{Figure}
\begin{document}
\newpage
{
\listoffigures
}
\newpage
\section{intro}
\begin{figure}[H]
\centering
\includegraphics{}
\caption{This is figure}
\end{figure}
\end{document}
答案1
可以使用包提供的命令来完成tocloft
。
\documentclass[12pt,a4paper]{article}
\usepackage{graphicx}
\usepackage{float}
\usepackage{tocloft} % needed <<<<<<<<<<<<<<<<
\usepackage{float}
\usepackage{amsmath}
\usepackage{chngcntr}
\counterwithin{figure}{section}
\renewcommand{\thefigure}{\thesection-\arabic {figure}\hspace{.3em}}
\renewcommand{\figurename}{Figure}
%************************************** added <<<<<<<<<<<<
\renewcommand{\cftfigpresnum}{\figurename~}% before the figure number
\renewcommand{\cftfigaftersnum}{:}% after figure number
\setlength{\cftfigindent}{0pt}% no indent
\newlength{\extrawidth}% extra width of the box with the figure number
\settowidth{\extrawidth}{\cftfigpresnum} %
\addtolength{\cftfignumwidth}{\extrawidth} % add the extra width
\renewcommand{\cftfigdotsep}{1.0}% dot separation
\renewcommand{\cftfigafterpnum}{\bigskip}
%**************************************
\begin{document}
\newpage
{
\listoffigures
}
\newpage
\section{intro}
\begin{figure}[H]
\centering
\includegraphics{example-image}
\caption{This is figure}
\end{figure}
\newpage
\setcounter{page}{10}% test 2-digit page number
\begin{figure}[H]
\centering
\includegraphics{example-image}
\caption{This is another figure}
\end{figure}
\end{document}
请参阅软件包文档更多细节。