I am getting the following error when trying to use mathematic symbols as part of a message caption:
Missing \endcsname inserted
Here is a working minimal example:
\documentclass{article}
\usepackage{tikz}
\usepackage{pgf-umlsd}
\usepgflibrary{arrows} % for pgf-umlsd
\usepackage{verbatim}
\begin{comment}
\end{comment}
\begin{document}
\begin{figure}[!h]
\centering
\tikzset{font=\scriptsize}
\begin{sequencediagram}
\footnotesize
\newinst{p}{Prover}
\newinst[2.6]{v}{Verifier}
\mess[0]{p}{{$\epsilon$}}{v}{}; % LOCATION OF ERROR
\node[below {$\epsilon$} to, font=\centering] {$test$};
\end{sequencediagram}
\caption{\scriptsize Sequence diagram of the device authentication protocol.}
\label{fig:protocolsAuth}
\end{figure}
\end{document}
There is no problem if no latex macros are used but numbers, text, etc. inside the math mode instead.
Best Answer
The label in the third argument of
\mess
is also reused as part of a node name. Therefore the text is very restricted. The following example redefines\mess
to make the argument safe for use in node names by using\detokenize
: