# TikZ-UML classes with same name but different node names

I'm using TikZ-UML to draw a class diagram with multiple packages, and classes with the same name but located in different packages. The thing is, I want to put relations on those classes, but I can't reference one in particular because they have the same name.

I already tried using the name option of the \umlclass macro to change the node name, but I can't seem to be able to reference the node name from the \umlrelation arguments. Here is a minimal (non-)working example:

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

\begin{document}
\begin{tikzpicture}
\umlsimpleclass[name=a]{A}
\umlsimpleclass[x=2, name=b]{A}
\umlassoc{a}{b}
\end{tikzpicture}
\end{document}


You can use alias instead.

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

\begin{document}
\begin{tikzpicture}
\umlsimpleclass[alias=a]{A}
\umlsimpleclass[x=2, alias=b]{B}
\umlassoc{a}{b}
\end{tikzpicture}
\end{document}


• Thanks for the quick response, had been stuck on this for 2 hours :-) – Champitoad Jun 12 '16 at 21:16