3

Trying to have a theorem with [name=Dominio e codominio dell'operatore $D^{\vct{q}}$,label=thm:oss:DomCodomDq] gives the following error:

The error on the TeXShop console

The error is given by the following MWE:

\documentclass[a4paper]{report}  
\usepackage{amsmath,amssymb,thmtools}  
\newtheorem{oss}{Osservazione}  
\begin{document}  
\begin{oss}[name=Dominio e codominio dell'operatore $D^{\overrightarrow{q}}$,label=thm:oss:DomCodomDq]  
\end{oss}  
\end{document}

where \vct has been replaced by its primitive name \overrightarrow. The error is apparently related to \vct, as removing that removes the error. What does that mean and how do I solve it?

Torbjørn T.
  • 206,688
MickG
  • 5,426

1 Answers1

1

define a dummy:

\documentclass[a4paper]{report}  
\usepackage{amsmath,amssymb,thmtools}  
\newtheorem{oss}{Osservazione}  
\begin{document}  
\def\dummy{$D^{\overrightarrow{q}}$}
\begin{oss}[name=Dominio e codominio dell'operatore \protect\dummy,label=thm:oss:DomCodomDq]  
\end{oss}  
\end{document}

or use:

$D^{\protect\overrightarrow{q}}
  • The \dummy thing, I think, goes against the What You See Is What You Mean principle, so I prefer the direct thing. In any case @egreg, what exactly does this \protect command do? – MickG Dec 30 '13 at 12:43
  • http://tex.stackexchange.com/questions/4736/what-is-the-difference-between-fragile-and-robust-commands –  Dec 30 '13 at 12:46