3

I have some definitions and theorems inside subsubsubsection. When latex generates the listoftheorems, the last digit of the subsubsubsection overlaps the first letter of the name of the theorem, definition, etc. How could I adjust the space between the number of the definitions and its label when I am generating the list of theorems using \listoftheorem of the package thmtools

Thanks,

Here is the example:

\documentclass{article}


\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{xcolor}

\declaretheoremstyle[
            spaceabove=6pt, 
            spacebelow=6pt,
            headfont=\normalfont\bfseries,
            notefont=\mdseries,            %da ainda para incluir outros argumentos, como \color{red}, 
            notebraces={(}{)},
            bodyfont=\normalfont\itshape,
            postheadspace=\newline,
            numberwithin=subsubsection,
            shaded={rulecolor=black,
                        rulewidth=.4pt, 
                        bgcolor=grey!20}]{defStyle}
\declaretheorem[name=Definition,style=defStyle]{definition}
%=================================================

\begin{document}
\listoftheorems


\section{First}
    \subsection{First}
      \subsubsection{First}
      \end{subsection}
      \subsubsection{Second}
                \begin{definition}[name]
                 adslkjafhsldfkh asdfhkh adfadsfa $f(x)$
                \end{definition}
        \end{subsection}
        \end{subsection}
  \end{subsubsection}

\end{section}

\end{document}
  • What are you doing? \end{subsection} etc. are no valid commands. – Marco Daniel May 20 '13 at 17:32
4

The width reserved to typeset the sectional unit number is controlled by \thmt@listnumwidth, with a default value of 2.3em. You can increase this value according to your needs (I used 3.5em in my example below):

\documentclass{article}
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{xcolor}


\declaretheoremstyle[
            spaceabove=6pt, 
            spacebelow=6pt,
            headfont=\normalfont\bfseries,
            notefont=\mdseries, 
            notebraces={(}{)},
            bodyfont=\normalfont\itshape,
            postheadspace=\newline,
            numberwithin=subsubsection,
            shaded={rulecolor=black,
                        rulewidth=.4pt, 
                        bgcolor=gray!20}]{defStyle}
\declaretheorem[name=Definition,style=defStyle]{definition}
%=================================================

\makeatletter
\renewcommand\thmt@listnumwidth{3.5em}
\makeatother

\begin{document}
\listoftheorems


\section{First}
\subsection{First}
\subsubsection{First}
\subsubsection{Second}
\begin{definition}[Test]
Test
\end{definition}

\end{document}

enter image description here

By the way, there's no such thing as \end{section}, \end{subsection}, etc. I delete those from your code (otherwise, one gets errors).

|improve this answer|||||

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.