2

I have noticed that in my document the \listoffigures and probaly \listoftables are not working properly. There is no space in between the number of the figure and the text in the list. Also, if the figure number has more than 1 digit after dot, it is then overplapping with the text. Here is a screen:

list of figures

Here is my test code to reproduce the problem:

%% 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}

I dont know how to fix this listing and I would appreciate all help in resolving the problem. If any other information are needed I can add them.

2
  • You are aware that we can't compile this? We don't have the image, so use the [demo] option for graphicx.
    – user31729
    May 28, 2016 at 16:08
  • Sorry, I will remember this for the next time. Thank you for the answer bellow it works. May 28, 2016 at 16:20

1 Answer 1

2

Apparently, the numwidth for figures is too small (which seems the fault of the mwart class.)

Either redefine \l@figure or use

\usepackage{tocloft}

\addtolength{\cftfignumwidth}{10pt}

to add more space, say, 10pt, here. Choose another value at will.

\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}

enter image description here

1
  • Before anybody complains: I solved the main issue, not other things here!
    – user31729
    May 28, 2016 at 16:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .