如何对齐图表列表中的数字

如何对齐图表列表中的数字

当我超过 10 时,我的 LOF 的数字和标题之间就会出现令人讨厌的覆盖。有人遇到过同样的问题吗?

我的 MWE:

\documentclass[spanish, a4paper, 12pt, twoside, openany]{book} 

\counterwithin{table}{section}                  
\counterwithin{figure}{section}                
\usepackage{setspace}  
\usepackage{tikz}
\begin{document}
\newpage
{\setstretch{1.0} 
\listoffigures}
\newpage
\chapter{Chap1}   
\section{Sect1}

\begin{figure}[h]
    \centering
    \includegraphics{Images/01.png}
    \caption{XXXXX.}
\end{figure}

...(this goes till the 12 figure)...

\begin{figure}[h]
    \centering
    \includegraphics{Images/12.png}
    \caption{XXXXX.}
\end{figure}

这是我得到的:

覆盖

在我达到第十个数字之前,一切都很顺利。

答案1

用于tocloft更改排版标题数字所允许的空间宽度。

\documentclass[spanish, a4paper, 12pt, twoside, openany]{book} 
\usepackage{tocloft}
\usepackage{calc}
\setlength{\cftfignumwidth}{\widthof{M.M.MM}}
\counterwithin{table}{section}                  
\counterwithin{figure}{section}                
\usepackage{setspace}  
\usepackage{tikz}
\begin{document}
\newpage
{\setstretch{1.0} 
\listoffigures}
\newpage
\chapter{Chap1}   
\section{Sect1}

\begin{figure}[h]
    \centering
    \includegraphics{example-image.pdf}
    \caption{XXXXX.}
\end{figure}

...(this goes till the 12 figure)...

\begin{figure}[h]
    \centering
    \includegraphics{example-image.pdf}
    \caption{XXXXX.}
\end{figure}

\begin{figure}[h]
  \centering
  \includegraphics{example-image.pdf}
  \caption{XXXXX.}
\end{figure}
\begin{figure}[h]
  \centering
  \includegraphics{example-image.pdf}
  \caption{XXXXX.}
\end{figure}
\begin{figure}[h]
  \centering
  \includegraphics{example-image.pdf}
  \caption{XXXXX.}
\end{figure}
\begin{figure}[h]
  \centering
  \includegraphics{example-image.pdf}
  \caption{XXXXX.}
\end{figure}\begin{figure}[h]
  \centering
  \includegraphics{example-image.pdf}
  \caption{XXXXX.}
\end{figure}\begin{figure}[h]
  \centering
  \includegraphics{example-image.pdf}
  \caption{XXXXX.}
\end{figure}\begin{figure}[h]
  \centering
  \includegraphics{example-image.pdf}
  \caption{XXXXX.}
\end{figure}\begin{figure}[h]
  \centering
  \includegraphics{example-image.pdf}
  \caption{XXXXX.}
\end{figure}\begin{figure}[h]
  \centering
  \includegraphics{example-image.pdf}
  \caption{XXXXX.}
\end{figure}\begin{figure}[h]
  \centering
  \includegraphics{example-image.pdf}
  \caption{XXXXX.}
\end{figure}
\end{document}

在此处输入图片描述

相关内容