5
\documentclass{article}
\usepackage[margin=.8in]{geometry}
\usepackage{forest}
\usepackage{tikz}

\begin{document}


\begin{forest} baseline, for tree={anchor=center, align=center, l sep+=0em, s sep+=0em} myGP1/.style={
            GP1}
    [
        [$\sigma$ [C [f]] [V [u]]]
        [$\sigma$ [C [m]] [V [e]] [C[N]]]
    ]
    \end{forest}


\end{document}

Hi, I am trying to draw syllabifications (CV skeleton) using Forest Package (with GP1 style), How could I draw the trees without the two branches in the red box?

enter image description here

6

Separating the forests?

\documentclass{article}
\usepackage[margin=.8in]{geometry}
\usepackage{forest}
%\usepackage{tikz} % loaded by forest

\begin{document}


\begin{forest} baseline, for tree={anchor=center, align=center, l sep+=0em, s sep+=0em}
        [$\sigma$ [C [f]] [V [u]]]
\end{forest}
\begin{forest} baseline, for tree={anchor=center, align=center, l sep+=0em, s sep+=0em}
        [$\sigma$ [C [m]] [V [e]] [C[N]]]
\end{forest}


\end{document} 

Output

enter image description here

If you were trying to use the GP1 style, you should first download it at https://github.com/sasozivanovic/forest-styles/blob/master/forest-GP1.sty and use it as in the following example

\documentclass{article}
\usepackage[margin=.8in]{geometry}
\usepackage{forest-GP1}
%\usepackage{tikz} % loaded by forest

\begin{document}


\begin{forest} GP1, baseline, for tree={anchor=center, align=center, calign=center, l sep+=0em, s sep+=0.5em}
    [
        [$\sigma$ [C [f]] [V [u]]]
        [$\sigma$ [C [m]] [V [e]] [C[N]]]
    ]
\end{forest}


\end{document} 

Output

enter image description here

  • Ah....I forgot including GP1.sty in the preamble. Thank you so much! – mango tango Feb 10 '15 at 10:25
  • @mangotango You're welcome. – karlkoeller Feb 10 '15 at 10:26
3

If you just want the empty root without all the other formatting of the GP1 style, you can just use for root={phantom, for children={baseline}}, which sets the root to be empty and redefines the baseline of the tree to be the baseline of the root's children. Below I created an unrooted style that does this.

\documentclass{article}
\usepackage[margin=.8in]{geometry}
\usepackage{forest}
% \usepackage{tikz} % you don't need to load this separately since it's loaded by forest

\begin{document}

\forestset{unrooted/.style={for root={phantom, for children={baseline}}}}

(e.g., example number) % to show vertical alignment
\begin{forest} for tree={anchor=center, align=center, l sep+=0em, s sep+=0em}, unrooted
    [
        [$\sigma$ [C [f]] [V [u]]]
        [$\sigma$ [C [m]] [V [e]] [C[N]]]
    ]
\end{forest}

\end{document}

enter image description here

As a side note, if you want your branches to come to a point under the syllable nodes, you can use the sn edges style defined on p. 8 of the forest documentation. In that case, you would want to remove anchor=center.

  • This is another good answer. Thank you, Jason. I gave up using XeLaTeX because of its slow compiling speed. – mango tango Feb 10 '15 at 16:30
  • @mangotango, You're right that pst-asr is painfully slow with XeLaTeX, but if you're switching to using forest for these kinds of representations, I don't think you'll find nearly as much of a difference in compilation speed. – Jason Zentz Feb 10 '15 at 17:08

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.