0

How can I change the format of an entry in \listoftheorems of thmtools? With the following MWE:

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

\declaretheorem[]{definition}

\begin{document}
\listoftheorems

\begin{definition}[Name]
    bla
\end{definition}

\end{document}

I get this:

MWE

But i want something like:

Definition 1 "Name" ................... 1

Thank you very much for your help

1 Answer 1

0

I found an answer to my question:

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

\declaretheorem[]{definition}

% to reformat the (Name) to ''Name''
\renewcommand\thmtformatoptarg[1]{ ''#1''}

% to swap number with "Definition" 
\makeatletter
\def\ll@definition{%
    \thmt@thmname~
    \protect\numberline{\csname the\thmt@envname\endcsname}%
    \ifx\@empty
        \thmt@shortoptarg
    \else
        \protect\thmtformatoptarg{\thmt@shortoptarg}
    \fi
}
\makeatother

\begin{document}
\listoftheorems

\begin{definition}[Name]
    bla
\end{definition}

\end{document}

So I got:

enter image description here

To make the space between 1 and "Name" smaller, I added

\makeatletter
\renewcommand*{\numberline}[1]{\hb@xt@1em{#1}}
\makeatother

Maybe there is a better way, I would like to know!

And finally I wanted to change the definition style, to match the listofdefinitions:

\declaretheoremstyle[
headfont=\bfseries, 
headpunct={:},
notefont=\bfseries\itshape, 
notebraces={''}{''}, 
%headformat=\NAME~\NUMBER \NOTE, 
]{definition}

\declaretheorem[style=definition]{definition}

This is the result:

enter image description here

You must log in to answer this question.

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