I'd like to have a diagram like in this answer:

What I have

The difference is, that the box shouldn't conatin all of the text, but parts of it. The text afterwards has to go undecorated.

I tried making the whole diagram plain and adding decoration manually, but it didn't compile.

I don't care about wich library is used to generate the tree.

  • Welcome to TeX.SX! Could you give also a rough representation of what you need? – egreg Nov 21 '16 at 16:03
  • Just imagine the coloured box of each node in the picture only contain the word "tex" and the "t1.1" being classic black on white. – piegames Nov 21 '16 at 16:38

It is virtually impossible to tell what you really want: you give no code and a description which doesn't make much sense. Apparently, you want to split words into a bit in a coloured box and a bit not in a coloured box, where the word being split is inexplicably always text. Oh, well.

bizarre tree

Looks bizarre to me, but I suppose it takes all sorts, if not necessarily the liquorice kind.


  my label/.style={
  for tree={% addaswyd o gôd Gonzalo Medina: http://tex.stackexchange.com/a/270761/
    minimum height=0.75cm,
    if level=0{fill=ForestGreen}{fill/.wrap pgfmath arg={SlateBlue#1}{int(4-(mod((level()-1),4)))}},
    rounded corners=4pt,
    edge={ForestGreen,rounded corners,line width=1pt},
  before typesetting nodes={
    for tree={
      split option={content}{:}{content,my label},
  • Thank you, that's exactly what I needed. I got the following errors while compiling: "Package pgfkeys Error: I do not know the key '/forest/package@options/edges' and I am going to ignore it. Perhaps you misspelled it. ...fPackageOptions{/forest/package@options}" "Package pgfkeys Error: I do not know the key '/tikz/split option', to which ys you misspelled it. \end{forest}" – piegames Nov 22 '16 at 8:24
  • 1
    @piegames Your TeX installation is out of date and you have an old version of Forest. You need to update. – cfr Nov 22 '16 at 15:53
  • Adapted from tex.stackexchange.com/a/340354. – cfr Jan 5 '17 at 22:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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