1

I'm creating a longish document with lots of diagrams, examples, definition etc. and with indexes of them all, but I'm having trouble with the formatting of the lists. - Sorry, I have no proper example code, as I suspect it will be rather long to show the effect. Here are some fragments (I hope this is enough):

\documentclass[a4paper]{report}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{stix}
\usepackage{mathtools}
\usepackage[document]{ragged2e}
\usepackage{wasysym}
\usepackage{booktabs}
\usepackage{enumitem}
\usepackage{pgfplots}
\usepackage{tikz}
\usepackage{float}

...

\newfloat{diag}{htbp}{dia}[section]
\floatname{diag}{Diagram}

\begin{document}
    \listof{diag}{Figures}
...
        \begin{diag}[H]
            \centering
            \begin{tikzpicture}
                \node[circle,fill=black,inner sep=0pt,minimum size=4pt,label=below:0] (0) at (0,0) {};
                \draw[-stealth] (0.center)++(0,.45)++(-120:.35) arc (240:-60:.35);
            \end{tikzpicture}
            \caption{The Category $\mathbb{1}$}
            \label{dia:Category1}
        \end{diag}

...

\end{document}

What I get looks like:

List of diagrams

How can I better separate the numbering from the text in the list?

Edit:

A minimal working example (credits to leandriis):

\documentclass[a4paper]{report} 
\usepackage{float} 
\newfloat{diag}{htbp}{dia}[section] 
\floatname{diag}{Diagram} 
\begin{document} 
    \listof{diag}{Figures} 
    \setcounter{section}{16} 
    \section{text} 
    \begin{diag}[H] 
        \caption{caption text here} 
    \end{diag} 
\end{document}
2
  • A MWE to reproduce the issue would be: \documentclass[a4paper]{report} \usepackage{float} \newfloat{diag}{htbp}{dia}[section] \floatname{diag}{Diagram} \begin{document} \listof{diag}{Figures} \setcounter{section}{16} \section{text} \begin{diag}[H] \caption{caption text here} \end{diag} \end{document}. – leandriis Jan 7 '20 at 15:17
  • @leandriis Thanks! I'll incorporate it in my question. – j4nd3r53n Jan 7 '20 at 16:08
1

Probably not the most elegant solution:

enter image description here

\documentclass[a4paper]{report} 
\usepackage{float} 
\newfloat{diag}{htbp}{dia}[section] 
\floatname{diag}{Diagram} 

\makeatletter
\renewcommand*{\listof}[2]{%
  \@ifundefined{ext@#1}{\float@error{#1}}{%
    \@namedef{l@#1}{\@dottedtocline{1}{1.5em}{3em}}% <-------  replaced 2.3em with 3em here
    \float@listhead{#2}%
    \begingroup\setlength{\parskip}{\z@}%
      \@starttoc{\@nameuse{ext@#1}}%
    \endgroup}}
\makeatother
\begin{document} 
    \listof{diag}{Figures} 
    \setcounter{section}{16} 
    \section{text} 
    \begin{diag}[H] 
        \caption{caption text here} 
    \end{diag} 
\end{document}
1
  • Intriguing - it does look quite daunting, but as long as it works. Thanks! – j4nd3r53n Jan 8 '20 at 8:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.