# Lists of Theorems (XeLaTeX)

I've found out how to use the thmtools package to make lists of theorems. My questions on this are:

1. 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. 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:
.
The same error is obtained by placing a \ref in a label. In fact, \mathbb gives problems anywhere in those [], just like a comma in the middle of a name or label, even within dollars to mark an interval like (0,1). How do I solve that?

1. (should be 2) 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?
• label=<string> defines a string to be used for \ref; it shouldn't contain any command or special character. – egreg Dec 28 '13 at 12:01

The value for the key label should be a mnemonic string to be used in the argument of \ref for referring to this theorem number.

It shouldn't contain any command and any special character (and it will never appear in print). So

\begin{defi}[name=$\mathbb{R}$,label=thm:R-definizione]


is what you need. When you want to refer to this definition, type

\ref{thm:R-definizione}


Please, note that the correct input is \mathbb{R}, not \mathbb R. The fact that the latter gives the same result shouldn't be taken as a proof that the input is valid.

• OK. Why does \mathbb R give problems and \mathbb{R} not give any? And what about point 2? – MickG Dec 28 '13 at 13:24
• @MickG \mathbb{R} in label= gives the same problem as \mathbb R. About point 2, there should be something on the site. – egreg Dec 28 '13 at 13:30
• I meant \mathbb R gives problems in name= and \mathbb{R} doesn't. The error given is in the question. – MickG Dec 28 '13 at 13:39
• @MickG What is suggesting you that the error you got came from name=\mathbb R? It didn't. For the margins in the list of theorems, see tex.stackexchange.com/questions/115265/… or tex.stackexchange.com/questions/53774/… – egreg Dec 28 '13 at 14:01
• This IS strange. Maybe it was trying to update the already existing .loe file and found the error in the label with \mathbb R, even though I had removed \mathbb R` from the label. Could that be? Anyway the error is gone now. – MickG Dec 28 '13 at 14:17