5

I am using the command \listoftheorems with packages amsthm and thmtools. The problem is that the theorem's head and its optional title overlap. How can I make this space bigger to avoid overlapping?


Thank you all. I include an example below (maybe not minimal). I've tried \makeatletter\thmt@listnumwidth{4.3em}\makeatother but I get errors. Same thing with \renewcommand{\l@theorem}{\@tocline{0}{3pt plus2pt}{0pt}{3.5em}{}}. Any other clues? Should I try working with ntheorem instead?

%% LyX 2.0.0 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[12pt,a4paper,english,titlepage, fleqn,numbers=noenddot]{scrbook}
\usepackage[osf]{mathpazo}
\usepackage{helvet}
\usepackage{courier}
\renewcommand{\familydefault}{\rmdefault}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\pagestyle{headings}
\setcounter{tocdepth}{3}
\setlength{\parskip}{\medskipamount}
\setlength{\parindent}{0pt}
\usepackage{babel}
\usepackage{setspace}
\onehalfspacing
\usepackage[unicode=true,
 bookmarks=true,bookmarksnumbered=true,bookmarksopen=true,bookmarksopenlevel=4,
 breaklinks=false,pdfborder={0 0 0},backref=false,colorlinks=false]
 {hyperref}
\hypersetup{pdftitle={},
   pdfkeywords={music cognition, categorization, embodiment}}

\makeatletter

\pdfpageheight\paperheight
\pdfpagewidth\paperwidth

\usepackage{amsthm}
\usepackage{thmtools}

\declaretheorem[style=remark, name={}]{Example}
\renewcommand{\theExample}{\bf{Def. \thechapter.\arabic{Example}}}

\makeatletter
\def\th@remark{%
\thm@headpunct{:}
  \thm@notefont{\bfseries\itshape}}
\makeatother

\makeatletter
\def\thmhead@plain#1#2#3{%
  \thmname{#1}\thmnumber{\@ifnotempty{#1}{ }\@upn{#2}}%
  \thmnote{ {\the\thm@notefont#3}}}
\let\thmhead\thmhead@plain
\def\swappedhead#1#2#3{%
  \thmnumber{#2}%
  \thmname{\@ifnotempty{#2}{~}#1}%
  \thmnote{ {\the\thm@notefont#3}}}
\makeatother

\newcounter{genero}
\setcounter{genero}{1}

\AtBeginDocument{
  \def\labelitemi{\normalfont\bfseries{--}}
  \def\labelitemii{\(\star\)}
  \def\labelitemiii{\(\cdot\)}
}

\makeatother

\begin{document}
\listoftheorems

\begin{Example}[Género musical \thegenero]\stepcounter{genero}

first example.

\end{Example}

\begin{Example}[Género musical \thegenero]\stepcounter{genero}

second example.

\end{Example}

\begin{Example}[Género musical \thegenero]\stepcounter{genero}

third example.

\end{Example}
\end{document}
varun
  • 55

1 Answers1

4

Simply use

\renewcommand\thmt@listnumwidth{4.3em}

after loading thmtools (and enclosing it within \makeatletter, \makeatother). Here's your document with some modifications to the preamble (I change the order of packages loading and suppressed some redundant and suppressed some redundant \makeatletter, \makeatother pairs):

\documentclass[12pt,a4paper,english,titlepage, fleqn,numbers=noenddot]{scrbook}
\usepackage[osf]{mathpazo}
\usepackage{helvet}
\usepackage{courier}
\renewcommand{\familydefault}{\rmdefault}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\pagestyle{headings}
\setcounter{tocdepth}{3}
\setlength{\parskip}{\medskipamount}
\setlength{\parindent}{0pt}
\usepackage{babel}
\usepackage{setspace}
\onehalfspacing
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage[unicode=true,
 bookmarks=true,bookmarksnumbered=true,bookmarksopen=true,bookmarksopenlevel=4,
 breaklinks=false,pdfborder={0 0 0},backref=false,colorlinks=false]
 {hyperref}
\hypersetup{pdftitle={},
 pdfkeywords={music cognition, categorization, embodiment}}

\pdfpageheight\paperheight
\pdfpagewidth\paperwidth

\declaretheorem[style=remark, name={}]{Example}
\renewcommand{\theExample}{\bf{Def. \thechapter.\arabic{Example}}}

\makeatletter

\renewcommand\thmt@listnumwidth{4.3em}

\def\th@remark{%
\thm@headpunct{:}
  \thm@notefont{\bfseries\itshape}}

\def\thmhead@plain#1#2#3{%
  \thmname{#1}\thmnumber{\@ifnotempty{#1}{ }\@upn{#2}}%
  \thmnote{ {\the\thm@notefont#3}}}
\let\thmhead\thmhead@plain
\def\swappedhead#1#2#3{%
  \thmnumber{#2}%
  \thmname{\@ifnotempty{#2}{~}#1}%
  \thmnote{ {\the\thm@notefont#3}}}
\makeatother

\newcounter{genero}
\setcounter{genero}{1}

\AtBeginDocument{
  \def\labelitemi{\normalfont\bfseries{--}}
  \def\labelitemii{\(\star\)}
  \def\labelitemiii{\(\cdot\)}
}

\begin{document}
\listoftheorems

\begin{Example}[Género musical \thegenero]\stepcounter{genero}

first example.

\end{Example}

\begin{Example}[Género musical \thegenero]\stepcounter{genero}

second example.

\end{Example}

\begin{Example}[Género musical \thegenero]\stepcounter{genero}

third example.

\end{Example}
\end{document}

enter image description here

On a side note, I find somehow odd that you load thmtools but apparently do not use all of its features as a front-end (or, at least that's the impression I got from a quick look to your code) to help you define your structures; perhaps, if I find some time, I will give you some suggestion about this also, but I can't promise anything.

varun
  • 55
Gonzalo Medina
  • 505,128