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've found out how to use the thmtools package to make lists of theorems. My questions on this are:

  1. How do I change the title, given that \renewcommand{\listoftheoremname}{...} gives a LaTeX error: \listoftheoremname undefined error?
  2. How do I make multiple lists of different kinds of theorems with different titles?
  3. Adding [name=xxx,label=thm:...] after \begin{yyy} (xxx is a title for the theorem, ... a label appearing in the list, yyy the theorem kind) labels a theorem. If I try to put any maths beyond superscript and subscript (for now I've only tried \mathbb) into a label, I get a missing \endcsname inserted error related to a line of the .aux files. How do I solve that? MWE:

    \documentclass[a4paper]{report}  
    \usepackage{thmtools,amssymb}  
    \declaretheorem[name=Definizione]{defi}  
    \begin{document}  
    \begin{defi}[name=$\mathbb R$,label=thm:$\mathbb R$definizione]  
    Ah beh, s\`i beh.  
    \end{defi}  
    \listoftheorems  
    \end{document}  
    

which gives:
Error message in TeXShop Console.
The same error is obtained by placing a \ref in a label. In fact, \mathbb gives problems anywhere in those [], just like trying to put $(0,1)$ there, because of that comma.

  1. (should be 4) And finally, I'm using theorems with [subsection] numbering. Now, in the list, the number overlaps the theorem kind (i.e. I get 1.2.1.1 overlapping Definizione (Spazio Metrico)). How do I solve that?
share|improve this question
1  
For the first point try this solution: tex.stackexchange.com/a/52896/31058 . The name of the variable is \listtheoremname and not \listoftheoremname. –  Ludovic C. Dec 27 '13 at 10:39
1  
Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  egreg Dec 27 '13 at 10:41
    
Then there is an issue with latex-community.org/forum/viewtopic.php?f=19&t=17679, since there it says \listoftheoremname. The other link's way it works. –  MickG Dec 27 '13 at 11:08
1  
If an answer to a forum is wrong, there's little one can do, except reporting the error in the forum. Since the package documentation mentions \listtheoremname, do you trust a forum better? –  egreg Dec 27 '13 at 11:14
add comment

1 Answer 1

up vote 5 down vote accepted

This could get you started; but without a clear set of specifications from you it's difficult to be more precise.

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

\declaretheorem{theorem}
\declaretheorem[style=definition]{definition}

\begin{document}

\renewcommand{\listtheoremname}{List of theorems}
\listoftheorems[ignoreall,show=theorem]

\renewcommand{\listtheoremname}{List of definitions}
\listoftheorems[ignoreall,show=definition]

\begin{theorem}[Sum]
$1+1=2$
\end{theorem}

\begin{definition}[Nice numbers]
A number is \emph{nice} if it looks beautiful.
\end{definition}

\begin{theorem}[About $C^{1}(0,1)$]
The set $C^{1}(0,1)$ is interesting.
\end{theorem}

\end{document}

enter image description here

share|improve this answer
    
This perfectly solves the first two points. I had no idea one could use \renewcommand inside the document, I thought it was confined to the preamble. Thanks @egreg. Just one questions: why use the package amsthm? And why \declaretheorem and not \newtheorem? Is there any difference? –  MickG Dec 27 '13 at 11:21
    
@MickG I always use amsthm because of the predefined theorem styles. As you're loading thmtools, why not using its interface, that is, \declaretheorem? –  egreg Dec 27 '13 at 11:22
    
You also can define new commands in your preamble, such as \newcommand{\listofdefinitions}{\renewcommand{\listtheoremname}{List of definitions}\listoftheorems[ignoreall,show=definition]}, in order to have a slighly more readable source file. –  Bernard Dec 27 '13 at 11:40
    
I'll answer myself on points 3-4: 3) It seems the shorthands generate problems even here, as every time something must be transfered to a file different from tex and aux (toc, loe, whatever). Maybe it's my TeX distribution that's out of date and presents bugs that produce this effect. Anyway removing the shorthands has solved the problem (apparently, at least). 4) The list shows the name, not the label. –  MickG Dec 27 '13 at 15:44
    
OK just kidding: \mathbb still gives problems. –  MickG Dec 27 '13 at 15:55
show 4 more comments

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.