I'm following the tutorial/MWE provided at this link : http://www.texample.net/tikz/examples/filesystem-tree/

I would like to have to nodes at the same line, for example :


So far I only found the way having the [properties] on below [undermain], but not at the same line.

Thank you in advance for your help.


The easiest to do this is to add the property nodes later to a named node.

The solution consists of the keys

  • property direction,
  • properties,

and the styles

  • every property and
  • every property edge.

After the tree has been built, the properties are used via late options.


  property direction/.initial=mid right,
    append after command={
      \foreach \pgf@temp[count=\qrr@tikz@fig@prop from 0] in {#1} {
        node [
          every property/.try,
          \pgfkeysvalueof{/tikz/property direction}=of \qrr@tikzlastnode\qrr@tikz@fig@suffix,
          name=\qrr@tikzlastnode-\qrr@tikz@fig@prop] {\pgf@temp}
        edge[every property edge/.try] (\qrr@tikzlastnode\qrr@tikz@fig@suffix)
  every property/.style={
    node distance=.25cm,
  every property edge/.style={densely dotted,-}
  every node/.append style={draw=black,thick,anchor=west,text height=\heightof{A}, text depth=+0pt},
  grow via three points={one child at (0.5,-0.7) and two children at (0.5,-0.7) and (0.5,-1.4)},
  edge from parent path={(\tikzparentnode.south) |- (\tikzchildnode.west)}
  \node (texmf) {texmf}
    child { node (doc) {doc} }
    child { node {fonts} }
    child { node {source}}
    child { node [selected] {tex}
      child { node {generic}}
      child { node [optional] {latex}}
      child { node {plain}}
    child [missing] {}
    child [missing] {}
    child [missing] {}
    child {node {texdoc}};

    \path [late options={name=doc,properties={a,b,c}}];

    \path [late options={name=texmf-1,properties={d,e,f}}];


enter image description here

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.