1

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:
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 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?
lockstep
  • 250,273
MickG
  • 5,426
  • 2
    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

1 Answers1

3

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.

egreg
  • 1,121,712
  • 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 http://tex.stackexchange.com/questions/115265/how-to-adust-margin-in-listoftheorem or http://tex.stackexchange.com/questions/53774/horizontal-spacing-issue-in-listoftheorems-using-amsthm-thmtools – 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
  • @MickG When you corrected the label, the first LaTeX run still had the incorrect one in the aux file, whence the error. If you went past it, a new .aux file was created, without the erroneous entry. – egreg Dec 28 '13 at 14:21
  • The tip in http://tex.stackexchange.com/questions/115265/how-to-adust-margin-in-listoftheorem solves the problem. Just one last question: what are \makeatletter and \makeatother for? – MickG Dec 28 '13 at 14:41
  • @MickG http://tex.stackexchange.com/questions/8351/what-do-makeatletter-and-makeatother-do – egreg Dec 28 '13 at 14:48
  • Is there a way to put a comma in a name? – MickG Dec 28 '13 at 17:33
  • @MickG name={x, y, z} – egreg Dec 28 '13 at 17:41