# Siblings of a Tikz tree don't align properly

It appears that the siblings of a tree I made in Tikz don't align properly. The text line for each sibling level doesn't seem right.

I'm not sure how to fix this; thanks for any help.

\begin{figure*}
\centering
\begin{tikzpicture}[level 1/.style={sibling distance=8cm},level 2/.style={sibling distance=4cm},level 3/.style={sibling distance=2cm}]
child {node {Red}
child {node {Cloth}
child {node {Standard}}
child {node {Leather}
child {node {Standard}}
child {node {Blue}
child {node {Cloth}
child {node {Standard}}
child {node {Leather}
child {node {Standard}}
;
\end{tikzpicture}
\end{figure*}

• Please don't post code fragments. Instead put your fragment into a complete compilable document that people can play with. – Alan Munn Jan 15 '18 at 17:29

You could use something like

every node/.append style={anchor=mid}


added to the options you pass tikzpicture.

Or Forest aligns them by default:

\documentclass[border=9pt]{standalone}
\usepackage{forest}

\begin{document}
\begin{forest}
[Red
[Cloth
[Standard]
]
[Velvet
[Standard]
]
]
[Blue
[Cloth
[Standard]
]
[Velvet
[Standard]
]
]
]
\end{forest}
\end{document}


The descenders of the letters p and g in Upgraded force the node to be higher than Standard, whose letters do not have descenders. You can fix this by adding the option anchor=north to the nodes, which will align the siblings as they have the same cap height.

Another solution is to put \vphantom{p} after Standard in every such node, which provides a vertical space the height of the letter p with no horizontal width.

• Thank you for pointing out the descenders of the letters like p and g. Another solution is to use text depth option in TikZ. – InSung Cho Jan 21 '18 at 11:32

This is just an example to use the istgame package:

Revised: To correct the alignment of the last texts, I inserted [text depth=.25ex]and exchanged the picture accordingly.

\documentclass{standalone}

\usepackage{istgame}

\begin{document}

\begin{istgame}
\tikzset{oval node/.style={ellipse node,draw=none}}
% start
\xtdistance{15mm}{80mm}
\istrooto(0){Buying a car} \istb \istb \endist
% Red or Blue
\xtdistance{15mm}{40mm}
\istrooto(1)(0-1){Red} \istb \istb \endist
\istrooto(2)(0-2){Blue} \istb \istb \endist
% Cloth or Leather
\xtdistance{15mm}{20mm}
\istrooto(a)(1-1){Cloth} \istb \istb \endist
\istrooto(b)(1-2){Leather} \istb \istb \endist
\istrooto(c)(2-1){Cloth} \istb \istb \endist
\istrooto(d)(2-2){Leather} \istb \istb \endist