I'm drawing a sequence diagram with pgf-umlsd and I want to incorporate a greek letter in a message description.
Something like \mess[1]{a}{Message $\alpha$}{b}
.
While pgf-umlsd seems to allow $
for using the math mode, it apparently does not allow any \
(so I can't write e.g. \alpha
).
\protect
also doesn't work. Furthermore, I've defined a variable with \def\alph{$\alpha$}
, and used it with \mess[1]{a}{Message \alph}{b}
, but also to no avail.
If the definition is set to \def\alph{$alpha$}
, it works fine but of course doesn't produce an alpha. So, \
is apparently not generally prohibited inside pgf-umlsd message descritiptions.
Is there a possibility to somehow use greek letters?
Here is a minimal example of the problem:
\documentclass{article}
\usepackage{pgf-umlsd}
\begin{document}
\begin{figure} [ht!]
\def\alph{$\alpha$}
\def\bet {$beta$}
\begin{sequencediagram}
\newthread{a}{Alice}{Alice}
\newthread{b}{Bob}{Bob}
\mess[1]{a}{Message \alph}{b} %This doesn't compile
\mess[1]{a}{Message \bet} {b} %This compiles but generates no greek letter
\end{sequencediagram}
\end{figure}
\end{document}
Best Answer
The problem is caused by how
\mess
is defined (from v0.7 ofpgf-umlsd.sty
):The third argument (denoted by
#3
) is the message, but it is also used to define two additional nodes, at the start and end of the arrow, as you can see in the two last lines,I don't know exactly what the limitations are, but having
$\alpha$
in a node name doesn't work at least.Now, if those node names aren't used anywhere, you could just eliminate those nodes, by redefining the command with
but if they are needed, other things won't work, so this may or may not be helpful.