也许我的问题已经有答案了,但我当时找不到。
\listoffigures
我想要得到右边的页码,最好是|
用标题除以。
\documentclass{scrbook}
\usepackage{graphicx}
\usepackage{caption}
\makeatletter
\AtBeginDocument{
\renewcommand*\l@figure{\@dottedtocline{1}{2.4cm}{.5cm}}
\renewcommand{\@dotsep}{10000}
}
\makeatother
\renewcommand{\thefigure}{\bfseries\arabic{figure}}
\begin{document}
\captionof{figure}{example-image-a}
\captionof{figure}{example-image-b}
\captionof{figure}{example-image-c}
\listoffigures
\end{document}
答案1
该宏\l@figure
实际上有 2 个参数,通常作为最后两个参数传递给 \@dottedtocline
。
\documentclass{scrbook}
\usepackage{graphicx}
\usepackage{caption}
\makeatletter
\AtBeginDocument{
\renewcommand*\l@figure[2]{%
\ifnum 1>\c@tocdepth \else
\addpenalty{-\@highpenalty}%
\vskip \z@ \@plus.2\p@
{\leftskip 2.4cm\relax
\parindent 2.4cm\relax\@afterindenttrue
\interlinepenalty\@M
\leavevmode
\@tempdima 0.5cm\relax
\advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
{#1}~{\normalfont \normalcolor #2}%
\par}%
\fi}
%\renewcommand*{\l@figure}[2]{\@dottedtocline{1}{2.4cm}{.5cm}{#1}{\hbox to \@pnumwidth{#2\hfill}}}
\renewcommand{\@dotsep}{10000}
}
\makeatother
\renewcommand{\thefigure}{\bfseries\arabic{figure}}
\begin{document}
\listoffigures
\captionof{figure}{example-image-a}
\newpage\setcounter{page}{10}
\captionof{figure}{example-image-b}
\newpage\setcounter{page}{100}
\captionof{figure}{example-image-c}
\end{document}