# tikz-uml sequence diagram “Extra \or” error

I was compiling the following code which uses the tikz-uml package.

\documentclass{article}
%\usepackage{pgf}
%\usepackage{tikz}
\usepackage{tikz-uml}

\begin{document}
\begin{tikzpicture}
\begin{umlseqdiag}
\umlobject{a}
\begin{umlcall}{a}{a}
\begin{umlcall}{a}{a}           % line 11
\end{umlcall}                   % line 12
\end{umlcall}
\end{umlseqdiag}
\end{tikzpicture}
\end{document}


It compiles on one machine without any problems. However, on another one, it gives an error. Both machines use Windows 7 64-bit, MikTeX 2.9 64-bit. Error message:

! Extra \or.
\ifthenelse #1->\toks@ {#1}\TE@repl \or
\TE@or \TE@repl \and \TE@and \TE@rep...
l.12            \end{umlcall}
I'm ignoring this; it doesn't match any \if.


Anyone knows the reason for it and how to resolve it? I know it's due to an umlcall environment inside another one. It's actually enough to uncomment lines 11 and 12 to make the error disappear, but the result is not the same obiously.

The problem doesn't depend on including PGF or TikZ packages, nor on defining inputenc or fontenc. It doesn't depend on the fact that the a object calls itself neither.

EDIT 1: I was mistaken, the code that I tested and that worked on other machine was actually a bit different (precisely: everything inside the tikzpicture environment was a part of a bigger file).

The solution is to add \usepackage[language]{babel} in the preamble. But why does the documentation not say anything about it...?

EDIT 2: The wanted result is:

-
About tags: I wanted to add [tikz-uml] tag, but it doesn't exist and I can't do this on my own. –  Marek Kurdej Feb 16 '12 at 14:27
You need to include a diagram of what you expect your code to produce. As it is, it looks like everything is referring to the same object, i.e. the nested umlcall is probably a mistake. –  qubyte Feb 16 '12 at 15:15
Please read the question carefully, a nested umlcall is NOT a mistake. The same error appears when there are two umlobjects. –  Marek Kurdej Feb 16 '12 at 17:38
@Curdeius: Please include the diagram. I'd be interested to see what the successful compilation yields. In addition, we need version numbers on the tikz-uml package that you are using for each machine, since a difference would be one probable cause of success on one machine and not the other. –  qubyte Feb 16 '12 at 18:45
You can include images as usual and remove the preceding ! from the image link. Users with edit privileges will correct this. Regardless, we'd like to keep answers separate from questions, so you should write a separate answer instead of editing your answer into the question. Self-answers are perfectly admissible, and a well-written answer may earn you additional reputation. –  Werner Feb 16 '12 at 22:43

The solution is to use the babel package with the language of your choice, i.e. add one line to the preamble:

\usepackage[english]{babel}


Of course, you can change english to use different language.

The documentation of the tikz-uml package says nothing about this issue, nothing like "required packages" is mentioned there.

UPDATE: I have removed the necessity of loading babel package by modifying the file tikz-uml.sty. Indeed, the problem is somewhere in the definition of umlcall environment and the cause is \ifthenelse command. I have therefore changed the line 3397 from:

\ifthenelse{\equal{\tikzumlCallStartNodeName}{\tikzumlCallEndNodeName}}{%


to

\ifstrequal{\tikzumlCallStartNodeName}{\tikzumlCallEndNodeName}{%


after having added the following line to the beginning of the package file:

\RequirePackage{etoolbox}


I have also performed a similar modification in the line 3403, obtaining:

  \ifstrequal{\tikzumlcallreturn}{tikzumlEmpty}{%

-
Actually, this is mentioned on the home page. "For still unknown reasons, TikZ-UML works fine if you have already included the babel package with the language of your choice." ensta-paristech.fr/~kielbasi/tikzuml/… –  iX3 Feb 21 '13 at 20:59