考虑以下代码:
\documentclass[12pt]{book}
\usepackage{graphicx,caption}
\usepackage[T1]{fontenc} % Allows one to make bold smallcaps.
\usepackage{tocloft}
\renewcommand{\listfigurename}{\LARGE\textbf \hfill LIST OF ILLUSTRATIONS \hfill}
\newcommand\NewCaption[2]{\caption[#1]{\textbf{\scshape{#2 #1}}}}
\makeatletter
\renewcommand*{\l@figure}{% % Figure label command
\scshape % Small caps
\bfseries % Bold
\@dottedtocline{1}{1.5em}{2.3em} % Dotted line
}
\makeatother
\begin{document}
\thispagestyle{empty}
\begin{figure}[!htb]
\centering
\includegraphics[width=.75\linewidth,angle=0]{example-image-a}
\captionsetup{labelformat=empty} \vspace{10pt}
\NewCaption{ImageA Caption}{\Large}
\label{fig:Image Caption}
\end{figure}
\begin{figure}[!htb]
\centering
\includegraphics[width=.75\linewidth,angle=0]{example-image-b}
\captionsetup{labelformat=empty} \vspace{10pt}
\NewCaption{ImageB Caption}{\Large}
\label{fig:Image Caption}
\end{figure}
\listoffigures
\end{document}
产生
问:在插图列表 显示,我该如何移动数字 1 和 2,使它们位于标题左侧 15pt 处?我想让标题垂直对齐,直接位于标题下方 --- 因此我询问如何将项目编号向右移动。
谢谢。
答案1
只需更改 的参数,即可实现几乎相同的效果\@dottedtocline
。主要区别在于数字通常在框内左对齐。
\documentclass[12pt]{book}
\usepackage{graphicx,caption}
\usepackage[T1]{fontenc} % Allows one to make bold smallcaps.
%\usepackage{tocloft}% redundant
\usepackage{showframe}% alignment tool
\renewcommand{\listfigurename}{\makebox[\linewidth]{\LARGE\textbf LIST OF ILLUSTRATIONS}}
\newcommand\NewCaption[2]{\caption[#1]{\textbf{\scshape{#2 #1}}}}
\makeatletter
\renewcommand*{\l@figure}{% % Figure label command
\scshape % Small caps
\bfseries % Bold
\def\numberline##1{\hb@xt@\@tempdima{\hfil ##1\hskip 15pt}}% right justified
\@dottedtocline{1}{1.5em}{2.3em} % #1 = tocdepth check, #2 = left margin, #3 = \@tempdima
}
\makeatother
\begin{document}
\thispagestyle{empty}
\begin{figure}[htp]
\centering
\includegraphics[width=.75\linewidth,angle=0]{example-image-a}
\captionsetup{labelformat=empty} \vspace{10pt}
\NewCaption{ImageA Caption}{\Large}
\label{fig:Image Caption}
\end{figure}
\begin{figure}[htp]
\centering
\includegraphics[width=.75\linewidth,angle=0]{example-image-b}
\captionsetup{labelformat=empty} \vspace{10pt}
\NewCaption{ImageB Caption}{\Large}
\label{fig:Image Caption}
\end{figure}
\listoffigures
\end{document}