Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

i'm stuck and have no glue whats the problem. I'd like to draw a UML class diagram with tkz-uml package. Sadly my result is not how it should be. I try to get the example running, using following code:

\documentclass[12pt,a4paper,article,oneside]{memoir}

%% Package
\usepackage[utf8]{inputenc} 
\usepackage[backend=biber,bibencoding=utf8,sorting=nyt,language=ngerman, style=alphabetic]{biblatex}
\usepackage[breaklinks=true]{hyperref}
\usepackage[german]{babel}
\usepackage{tikz}
\usepackage{tikzscale}
\usepackage{tikz-uml}
\usepackage{graphicx}
\usepackage{subfloat}
\usepackage{eurosym}
\usepackage{bbding}
\usepackage{listings} 
\usepackage{epstopdf}
\usepackage{pgfgantt}
\usepackage{wrapfig}
\usepackage{mathtools}
\usepackage{amsmath}


%% TiKz Stuff %%%
\usetikzlibrary{calc, decorations.pathmorphing,decorations.pathreplacing, fadings, shadings, shapes, arrows, positioning,patterns,automata}
\pgfdeclarelayer{background}
\pgfdeclarelayer{foreground}
\pgfsetlayers{background,main,foreground}


\begin{document}

\begin{tikzpicture}

\begin{umlpackage}{p}
\begin{umlpackage}{sp1}
\umlclass[template=T]{A}{n : uint \\ t : float}{}
\umlclass[y=-3]{B}{  d : double}{  \umlvirt{setB(b : B) : void} \\ getB() : B}
\end{umlpackage}
\begin{umlpackage}[x=10,y=-6]{sp2}
\umlinterface{C}{  n : uint \\ s : string}{}
\end{umlpackage}
\umlclass[x=2,y=-10]{D}{  n : uint  }{}
\end{umlpackage}

\umlassoc[geometry=-|-, arg1=tata, mult1=*, pos1=0.3, arg2=toto, mult2=1, pos2=2.9, align2=left]{C}{B}
\umlunicompo[geometry=-|, arg=titi, mult=*, pos=1.7, stereo=vector]{D}{C}
\umlimport[geometry=|-, anchors=90 and 50, name=import]{sp2}{sp1}
\umlaggreg[arg=tutu, mult=1, pos=0.8, angle1=30, angle2=60, loopsize=2cm]{D}{D}
\umlinherit[geometry=-|]{D}{B}
\umlnote[x=2.5,y=-6, width=3cm]{B}{Kommentar zu classe B}
\umlnote[x=7.5,y=-2]{import-2}{blubber die blub}

\end{tikzpicture}

\end{document}

The output looks like this:

LaTex output

But it should look similar to this example:

enter image description here

Somebody a constructive idea?

Thanks!

share|improve this question
    
Instead of saying that you are using \documentclass… compose a full MWE. Does the problem persist if you use article or even standalone? Anyways, with tikz-uml v0.99 the output is as expected (blue background, connecting lines, …). –  Qrrbrbirlbel Feb 3 '13 at 15:43
    
yes, the blue background and the lines are missing. this is my actual problem. i'll post a full MWE in a minute –  Alex Feb 3 '13 at 15:46
add comment

1 Answer 1

up vote 4 down vote accepted

Load tikz-uml after you declared your layers.

Code

\documentclass[tikz]{standalone}
\usepackage{tikzscale}
\pgfdeclarelayer{background,foreground}
\pgfsetlayers{background,main,foreground}
\usepackage{tikz-uml}

\begin{document}
\begin{tikzpicture}
\begin{umlpackage}{p}
\begin{umlpackage}{sp1}
\umlclass[template=T]{A}{n : uint \\ t : float}{}
\umlclass[y=-3]{B}{  d : double}{  \umlvirt{setB(b : B) : void} \\ getB() : B}
\end{umlpackage}
\begin{umlpackage}[x=10,y=-6]{sp2}
\umlinterface{C}{  n : uint \\ s : string}{}
\end{umlpackage}
\umlclass[x=2,y=-10]{D}{  n : uint  }{}
\end{umlpackage}

\umlassoc[geometry=-|-, arg1=tata, mult1=*, pos1=0.3, arg2=toto, mult2=1, pos2=2.9, align2=left]{C}{B}
\umlunicompo[geometry=-|, arg=titi, mult=*, pos=1.7, stereo=vector]{D}{C}
\umlimport[geometry=|-, anchors=90 and 50, name=import]{sp2}{sp1}
\umlaggreg[arg=tutu, mult=1, pos=0.8, angle1=30, angle2=60, loopsize=2cm]{D}{D}
\umlinherit[geometry=-|]{D}{B}
\umlnote[x=2.5,y=-6, width=3cm]{B}{Kommentar zu classe B}
\umlnote[x=7.5,y=-2]{import-2}{blubber die blub}
\end{tikzpicture}
\end{document}

Output

enter image description here

share|improve this answer
    
thanks, 1 min ago i figured out that the source of trouble is the {pgflayers}-environment. Your tip worked very well. :D –  Alex Feb 3 '13 at 16:09
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.