Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
3  
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. –  Marco Daniel Apr 29 '12 at 23:59
    
Perhaps this is related: Spacing for \listtheorems in ntheorem –  Werner Apr 30 '12 at 5:19
    
Does putting \makeatletter\thmt@listnumwidth{4.3em}\makeatother help? I'm not 100% clear which space you mean (and haven't looked at that code for a while either). –  Ulrich Schwarz Apr 30 '12 at 9:32
    
without an example, it's not clear what the file name is, but in the file from which the list of theorems is set, there are presumably lines like this: \contentsline {theorem}{\numberline {1.1}{...}}{2}. if this is so, then redefining the command \l@theorem should do the job: \renewcommand{\l@theorem}{\@tocline{0}{3pt plus2pt}{0pt}{3.5em}{}} where 3.5em is the width of the space provided for the "head". (be sure to wrap this in \makeatletter ... \makeatother) –  barbara beeton Apr 30 '12 at 13:39

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer
    
I've tried it, but I get the following error: \thmt@listnumwidth undefined. In which file should I find this command? –  varun May 2 '12 at 12:39
    
@varun \thmt@listnumwidth is defined by thmtools. Do you have a recent version of the package? –  Gonzalo Medina May 2 '12 at 18:23
    
Yes, I bet that's the problem. I work on ubuntu and I think that texlive2009 (not 2011) is delivered by default. I should install a newer version. –  varun May 2 '12 at 22:37
    
@varun Most probably... using TeX Live2011 my example code compiles OK. Do you also get the error with my simple document? –  Gonzalo Medina May 2 '12 at 22:38
    
Yes, I also get the error with your example. I'll try TexLive2011. –  varun May 2 '12 at 22:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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