0

I'm making long index lists of theorems, definitions, etc, and the numbers overlap with the text in the list - here's an example:

\documentclass[a4paper]{report}
\usepackage[english]{babel}
\usepackage[margin=2cm]{geometry}
\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}
\usepackage{thmtools}
\usepackage{mdframed}
\usepackage{etoolbox}

\usetikzlibrary{arrows,bending,calc,patterns}

%\newcommand\irregularcircle[2]{% radius, irregularity
%   \pgfextra {\pgfmathsetmacro\len{(#1)+rand*(#2)}}
%   +(0:\len pt)
%   \foreach \a in {10,20,...,350}{
%       \pgfextra {\pgfmathsetmacro\len{(#1)+rand*(#2)}}
%       -- +(\a:\len pt)
%   } -- cycle
%}

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

\makeatletter
\everymath{\if@display\else\thickmuskip=2mu plus 2mu\fi}
\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}}
\patchcmd\thmt@mklistcmd
    {\thmt@thmname}
    {\check@optarg{\thmt@thmname}}
    {}{}
\patchcmd\thmt@mklistcmd
    {\thmt@thmname\ifx}
    {\check@optarg{\thmt@thmname}\ifx}
    {}{}
\protected\def\check@optarg#1{%
    \@ifnextchar\thmtformatoptarg\@secondoftwo{#1}%
}
\makeatother

\declaretheoremstyle[
spaceabove=6pt, 
spacebelow=6pt,
headfont=\normalfont\bfseries,
postheadspace=1em,
notefont=\bfseries,
notebraces={(}{)},
bodyfont=\itshape
]{thmstyle}

\declaretheorem[style=thmstyle,name=Definition,numberwithin=section]{mydef}

\begin{document}
    \renewcommand{\listtheoremname}{Definitions}
    \addcontentsline{toc}{section}{\listtheoremname}
    \listoftheorems[ignoreall,show=mydef]

    \chapter{Mathematics = Set Theory?}
    \setcounter{section}{16} 
    \section{Set Theory}
    \begin{mydef}[Principle of Comprehension]
        \label{def:PrincipleofComprehension}
        \hfill \break
        If $\phi(x)$ is a property or condition pertaining to objects $x$, then there exists a set whose elements are precisely the objects that have the property $\phi(x)$
    \end{mydef}
\end{document}

This results in:

enter image description here

How can I add some space here, between the number and the text?

j4nd3r53n
  • 499

1 Answers1

0

I'll answer this, to take it off the unswered posts. It turns out to be a duplicate of Horizontal spacing issue in \listoftheorems using amsthm + thmtools, and it is answered there as well.

j4nd3r53n
  • 499