TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

AFAIK pgf-umlcd does not support classes with template parameter (std::vector<T> for instance).

Does anybody have a workaround allowing the drawing of such classe? Is there a simple PGF/Tikz trick to do so?

I would achieve something roughly equivalent to MetaUML rendering. See MetaUML documentation page 8/9, section 2.5 "Parametrized Classes (Templates)".


share|improve this question
I have edited the question to take your comment into account: I would like something close to MetaUML template classes. – Thomas Moulard Sep 10 '12 at 13:36
up vote 3 down vote accepted

Here's a new style template parameter that adds a dashed box to the upper right corner of the diagram:

    template parameter/.style={
        append after command={
            node [draw, densely dashed, umlcolor, font=\ttfamily]
                at (\tikzlastnode.north east)
        \begin{interface}[template parameter=std::vector<T>,text width=7cm]{TestInterface}{0,0}
share|improve this answer
This is almost what I want. Is there a way to replace std::vector<T> by the content of the parameter automatically? – Thomas Moulard Sep 10 '12 at 14:11
@ThomasMoulard: Yes, sorry, I had accidentally left a static value in the code. The edited version of my answer uses the parameter value. – Jake Sep 10 '12 at 14:13
Perfect, thanks! – Thomas Moulard Sep 10 '12 at 14:15

Your Answer


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.