I want to be able to put items to the left or right of the tree structure in the following example. How can I do that? At the moment each tree occupies a line.



\Tree [.X X Y ]


enter image description here

  • Because the tikzpicture is an hbox, simply before \begin{tikzpicture} \Tree [.X X Y ] \end{tikzpicture} after will place text to the left and right of the tree. Am I misunderstanding? – Steven B. Segletes Jun 11 '15 at 16:38
  • It didn't seem to work before. ;) – user65526 Jun 11 '15 at 16:40
  • If you had blank lines above/below the tikzpicture, it would interpret it as a paragraph boundary and surrounding text would therefore be above and below, as opposed to either side. Welcome to the site. – Steven B. Segletes Jun 11 '15 at 16:59

Just some pictures...

bark of the shark

  The base of the following tree is aligned with the baseline \begin{tikzpicture}[baseline=(current bounding box.south)]
    \Tree [.X X Y ]
  \end{tikzpicture}, whereas the top of the next is aligned with the baseline \tikz[baseline=(current bounding box.north)]{\Tree [.X X Y ]} and the baseline is aligned with the centre of the next one \tikz[baseline=(current bounding box.center)]{\Tree [.X X Y ]}.

    parent anchor=south,
    child anchor=north,
      before drawing tree={
        content/.wrap value={##1,},
        typeset node
    baseline/.append style={text=red},
  Any node of a tree may be aligned with the baseline quite easily.
  For example,
  \begin{forest}[A, baseline, mycomma [B [D] [E]] [C [F] [G]]]\end{forest}
  \begin{forest}[A [B, baseline, mycomma [D] [E]] [C, mycomma [F] [G]]]\end{forest}
  \begin{forest}[A [B [D, baseline, mycomma] [E, mycomma]] [C [F, mycomma] [G, mycomma]]]\end{forest}
  and   \begin{forest}[A [B [D] [E [H., baseline]]] [C [F] [G]]]\end{forest}

    This is some information

    about the tree

    on the right

    which is quite


    --- for a tree.
    This is the weft

    from the left

    --- not the warp

    or the gawp.
    Far on the side,

    safe from the tide,

    shark of the bark.


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.