listoffigures 无法正常工作

listoffigures 无法正常工作

我注意到在我的文档中,\listoffigures和可能\listoftables无法正常工作。列表中的图形编号和文本之间没有空格。此外,如果图形编号在点后有超过 1 位数字,则会与文本重叠。以下是屏幕:

图片列表

以下是我重现该问题的测试代码:

%% Clear sans, courier

% Klasa:
\documentclass[12pt]{mwart}

% Kodowanie:
\usepackage[utf8]{inputenc}

% Czcionki:
\usepackage[sfdefault]{ClearSans} %% option 'sfdefault' activates Clear Sans as the default text font
\usepackage[T1]{fontenc}
\usepackage{courier}
\usepackage[T1]{polski}

% Geometria i style
%\usepackage{showframe} % debug
\usepackage{geometry}
\geometry{a4paper,twoside=true,top=20mm,bottom=30mm,inner=35mm,outer=20mm}
\pagestyle{plain}
\usepackage{float}
\usepackage{afterpage}

% Grafika
\usepackage{graphicx}
\usepackage{epstopdf}

% kody
\usepackage{listings}

% matma
\usepackage{amssymb,amsmath}

% theoremy
\usepackage{amsthm}

% Stopnie
\usepackage{gensymb}

% Numerowanie obiektow wedlug rozdzialow
\usepackage{chngcntr}
\counterwithin{figure}{section}
\numberwithin{equation}{section}

% Linki
\usepackage{url}
\usepackage{fancyref}

% Listy
\usepackage[ampersand]{easylist}
\ListProperties(Hide=100, Hang=true, Progressive=3ex, Style*=-- ,
Style2*=$\bullet$ ,Style3*=$\circ$ ,Style4*=\tiny$\blacksquare$ )

% Zmienne srodowiskowe:
\newcommand{\tocLessLeft}[1]{\textsc{\textbf{\large \flushleft{#1}}} \vspace{3mm} \\ \indent }
\newcommand{\tocLessLeftNorm}[1]{\textsc{\textbf{\normalsize \flushleft{#1}}} \vspace{0mm} \\ \indent }
\newcommand{\tocLessCenter}[1]{\textsc{\textbf{\large \centerline{#1}}} \vspace{3mm} \\ \indent }
\newcommand{\insertImg}[3]{%
\begin{figure}[h]
    \centering
    \includegraphics[height=50mm]{#1}
    \caption{#2} \flushleft{Źródło: Na podstawie \cite{#3}}
    \label{#1}
\end{figure}
}
\newcommand{\insertImgSetSize}[4]{%
\begin{figure}[h]
    \centering
    \includegraphics[height=#2mm]{#1}
    \caption{#3} \flushleft{Źródło: Na podstawie \cite{#4}}
    \label{#1}
\end{figure}
}

% Indeksowanie w pdfie wyjsciowym
\usepackage{hyperref}

% Naprawienie referencji do figur
\renewcommand{\theHfigure}{figure.section.thesection.\thefigure}

% START:
\begin{document}

\insertImg{stepper_nema17.png}{text}{fake_cite}
\insertImg{stepper_nema17.png}{text}{fake_cite}
\insertImg{stepper_nema17.png}{text}{fake_cite}
\insertImg{stepper_nema17.png}{text}{fake_cite}
\insertImg{stepper_nema17.png}{text}{fake_cite}
\insertImg{stepper_nema17.png}{text}{fake_cite}
\insertImg{stepper_nema17.png}{text}{fake_cite}
\insertImg{stepper_nema17.png}{text}{fake_cite}
\insertImg{stepper_nema17.png}{text}{fake_cite}
\insertImg{stepper_nema17.png}{text}{fake_cite}
\insertImg{stepper_nema17.png}{text}{fake_cite}
\insertImg{stepper_nema17.png}{text}{fake_cite}
\insertImg{stepper_nema17.png}{text}{fake_cite}

\listoffigures

\end{document}

我不知道如何修复此列表,如果能帮助我解决问题,我将不胜感激。如果需要任何其他信息,我可以添加它们。

答案1

显然,numwidth数字太小了(这似乎是班级的错误mwart。)

重新定义\l@figure或使用

\usepackage{tocloft}

\addtolength{\cftfignumwidth}{10pt}

要添加更多空间,请10pt在此处输入 。请随意选择其他值。

\documentclass[12pt]{mwart}

% Kodowanie:
\usepackage[utf8]{inputenc}

\usepackage{tocloft}

\addtolength{\cftfignumwidth}{10pt}

% Czcionki:
\usepackage[sfdefault]{ClearSans} %% option 'sfdefault' activates Clear Sans as the default text font
\usepackage[T1]{fontenc}
\usepackage[T1]{polski}
\usepackage{courier}

% Geometria i style
%\usepackage{showframe} % debug
\usepackage{geometry}
\geometry{a4paper,twoside=true,top=20mm,bottom=30mm,inner=35mm,outer=20mm}
\pagestyle{plain}
\usepackage{float}
\usepackage{afterpage}

% Grafika
\usepackage[demo]{graphicx}
\usepackage{epstopdf}

% kody
\usepackage{listings}

% matma
\usepackage{amssymb,amsmath}

% theoremy
%\usepackage{amsthm}

% Stopnie
\usepackage{gensymb}

% Numerowanie obiektow wedlug rozdzialow
\usepackage{chngcntr}
\counterwithin{figure}{section}
\numberwithin{equation}{section}

% Linki
\usepackage{url}
\usepackage{fancyref}

% Listy
\usepackage[ampersand]{easylist}
\ListProperties(Hide=100, Hang=true, Progressive=3ex, Style*=-- ,
Style2*=$\bullet$ ,Style3*=$\circ$ ,Style4*=\tiny$\blacksquare$ )

% Zmienne srodowiskowe:
\newcommand{\tocLessLeft}[1]{\textsc{\textbf{\large \flushleft{#1}}} \vspace{3mm} \\ \indent }
\newcommand{\tocLessLeftNorm}[1]{\textsc{\textbf{\normalsize \flushleft{#1}}} \vspace{0mm} \\ \indent }
\newcommand{\tocLessCenter}[1]{\textsc{\textbf{\large \centerline{#1}}} \vspace{3mm} \\ \indent }
\newcommand{\insertImg}[3]{%
\begin{figure}[h]
    \centering
    \includegraphics[height=50mm]{#1}
    \caption{#2} \flushleft{Źródło: Na podstawie \cite{#3}}
    \label{#1}
\end{figure}
}
\newcommand{\insertImgSetSize}[4]{%
\begin{figure}[h]
    \centering
    \includegraphics[height=#2mm]{#1}
    \caption{#3} \flushleft{Źródło: Na podstawie \cite{#4}}
    \label{#1}
\end{figure}
}

% Indeksowanie w pdfie wyjsciowym
\usepackage{hyperref}

% Naprawienie referencji do figur
\renewcommand{\theHfigure}{figure.section.thesection.\thefigure}

% START:
\begin{document}

\section{Foo}

\insertImg{stepper_nema17.png}{text}{fake_cite}
\insertImg{stepper_nema17.png}{text}{fake_cite}
\insertImg{stepper_nema17.png}{text}{fake_cite}
\insertImg{stepper_nema17.png}{text}{fake_cite}
\insertImg{stepper_nema17.png}{text}{fake_cite}
\insertImg{stepper_nema17.png}{text}{fake_cite}
\insertImg{stepper_nema17.png}{text}{fake_cite}
\insertImg{stepper_nema17.png}{text}{fake_cite}
\insertImg{stepper_nema17.png}{text}{fake_cite}
\insertImg{stepper_nema17.png}{text}{fake_cite}
\insertImg{stepper_nema17.png}{text}{fake_cite}
\insertImg{stepper_nema17.png}{text}{fake_cite}
\insertImg{stepper_nema17.png}{text}{fake_cite}

\listoffigures

\end{document}

在此处输入图片描述

相关内容