2

How can I align text around forest tree's bottom node?

Fox
\begin{forest}
[PAST [jumped]]
\end{forest}
over fence

enter image description here

Or are there more cleaner ways to insert text above words?

1

Welcome to TeX-SE! You can definitely use forest here and set the baseline wherever you like:

\documentclass{article}
\usepackage{forest}
\begin{document}
Fox
\begin{forest}
[PAST [jumped,baseline]]
\end{forest}
over fence

Fox \tikz[baseline=(j.base),outer xsep=0pt,inner xsep=0pt]{\draw (0,0) node[below] (j){jumped} -- ++ (0,0.5) node[above]{PAST};}
over fence
\end{document}

enter image description here

Depending on what you really want to achieve there are of course other options. But I do not know enough about your goals to make a choice. So I only add a tikz alternative (forest loads tikz as it is based on it).

If you want to just set a word on top of another word there are zillions of options like

\documentclass{article}
\usepackage{amsmath}
\begin{document}
Fox $\stackrel{\textstyle\text{PAST}}{\text{jumped}}$ 
over fence
\end{document}

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.