Forest: Edge at leftmost character

forest

I am trying to write a join-tree in forest like this:

\begin{forest}
[$\bowtie_{p_{AB}}$
    [A]
    [B]
]
\end{forest}

However, the Bowtie / join symbol is not centered, and instead the edges seem to spawn from the 'p'.

Non-centered join operator

I'm probably missing a simple for tree {} command but I cannot seem to figure out which.

Best Answer

Edges from your root node are going from south coordinate of root node. If I understand you correctly, you like that they start from center of \bowtie simbol, i.e. they start should be shifted to the left. One way, how to achieve this is use \mathrlap defined in mathtools package:

\documentclass[border=3.141592]{standalone}
\usepackage{mathtools}
\usepackage{forest}

\begin{document}
    \begin{forest}
for tree = {inner ysep=1pt,
            math content,
            }
[\bowtie_{\mathrlap{p_\mathit{AB}^{}}}
    [A]
    [B]
]
    \end{forest}
\end{document}

enter image description here

Is this what you after?

Edit:

Considered @egreg's comment the centering of \bowtie is even better:

enter image description here

\documentclass[border=3.141592]{standalone}
\usepackage{mathtools}
\usepackage{forest}

\begin{document}
    \begin{forest}
for tree = {inner ysep=1pt,
            math content,
            }
[\bowtie_{\mathrlap{p_\mathit{AB}^{}}\kern-\scriptspace}
    [A]
    [B]
]
    \end{forest}
\end{document}
Related Question