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

What is the best way to draw those two semantical relations with TikZ? I’ve seen it in a paper describing relations within wordnets.



share|improve this question
If you would like that, you can make an exact copy using tikz, then define a command to make it easier to use. Is it an one-off illustration or do you plan to make extensive use of such drawings? If you do not need exactly the same result, you can also try mindmapping library as in texample.net/tikz/examples/computer-science-mindmap – ipavlic Apr 12 '11 at 13:39
I plan using it just once for a report, but I think eventually I’ll want to use it in an article. The result doesn't have to be exactly the same. However, the size of the circles and the dashes connecting them are meaningful. For instance, checkmate and xeque-mate have the same circle size and the same dash size because they share a direct synonym relation. – rberaldo Apr 12 '11 at 13:55
up vote 4 down vote accepted

You might try with




\tikzstyle{superset}=[normal,inner sep=1em]

    \matrix [column sep=3em,row sep=1em]
    \node (a) [normal] {Subset}; & \node (b) [superset] {Superset}; \\
    \node (a caption) {\parbox{6em}{\textbf{\{Caption\}}\\Lorem ipsum}}; & \node (b caption) {\parbox{6em}{\textbf{\{Caption\}}\\Lorem ipsum}};\\
        \fill (a.center) -- (b.north east) -- (b.south east) -- (a.center);

    \matrix [column sep=3em,row sep=1em]
    \node (c) [normal] {One set}; & \node (d) [normal] {One set}; \\
    \node (c caption) {\parbox{6em}{\textbf{\{Caption\}}\\Lorem ipsum}}; & \node (d caption) {\parbox{6em}{\textbf{\{Caption\}}\\Lorem ipsum}};\\
        \draw [line width=0.8em] (c.center) -- (d.center);


But you have to be careful and use minimum width or text width key-values when needed to achieve the sizes you really need.



share|improve this answer
What if I wanted to put a caption above node b? Is that possible? – rberaldo Apr 12 '11 at 14:59
All the nodes are contained inside a matrix, so you can just rearrange them however you see fit -- instead of a matrix a & b \\ a caption & b caption you could create a matrix [empty] & b caption \\ a & b \\ a caption & [empty] – ipavlic Apr 12 '11 at 15:55

You can use the mindmap library; a little example:


  \node [annotation,below] (#1) at (#2.south) {\textbf{ \{#3\}}\\#4};


\tikzset{concept color=red!50,%
    every annotation/.style={text width=4cm,text badly centered,font=\large}}

  \node [concept] (vodka) {WN.Pr}
    child[grow=left] {node[concept] (caipi) {WN.Br}};
  \MyAnn{fn}{vodka}{vodka}{text text text text.};
  \MyAnn{sn}{caipi}{caipirosca}{text text text text.};

  \begin{scope}[every node/.append style={minimum size=3.5cm,font=\large},mindmap]
  \node [concept] (chek) {WN.Br} 
    child[grow=right] {node[concept] (xeque) {WN.Pr}};
  \MyAnn{fn}{chek}{chekmate}{text text text text.};
  \MyAnn{sn}{xeque}{xeque-mate}{text text text text.};
  \node [style=double arrow,draw,fill=black,scale=0.5] at ($(fn)+(2.4,0.25)$) {dblarrow};


EDIT: I've changed the code to include the second example.

enter image description here

share|improve this answer
I think I’ll go with that by now. How do I control font size with TikZ? Or should I use regular LaTeX commands, such as \small and \normalsize? Thank you! – rberaldo Apr 12 '11 at 14:16
@Rafael Beraldo: of course, you can use the standard font switches; I've added a second example code showing how to change the annotations style. – Gonzalo Medina Apr 12 '11 at 19:48

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.