3

With the following code based on @cfr's answer to Specify length of each line in forest, I get the following:

\documentclass{article}
\usepackage{forest, amsmath}
\begin{document}
    \begin{forest}
        for tree = {%
            parent anchor = south,
            child anchor = north,
            s sep = 0em,
            tier/.option = level}
        [, phantom
            [a]
            [r]
            [c]
            [h]
            [i]
            [p]
            [$\stackrel{*}{\text{e}}$
                [$\stackrel{*}{\text{H}}$]]
            [l]
            [a
                [L]]
            [g]
            [o]
        ]
    \end{forest}
\end{document}

enter image description here

My question is simple: how can I suppress the line drawn between a and L? I want the L to be exactly where it is - I just don't want a line to the a. I've browsed through the documentation for forest for how to prevent a line from being drawn, but I can't find anything.

In case anyone wants to know: I'm going to present this in two steps. In step 1 the L on the bottom level is not associated with anything on the top level ( = no line). In step 2 a rule kicks in which associates the L with the a (= line drawn). The code above shows step 2. I want to know how I can get step 1.

Sverre
  • 20,729
  • Are you using Beamer? If so, you can specify the tree just once with a suitable overlay specification. If it is really for article or whatever, obviously, this doesn't apply. – cfr Sep 03 '17 at 20:56
  • s sep'=0mm is quicker (with the quote mark - spacing doesn't matter). parent anchor=children, child anchor=parent is more flexible (though whether this is an advantage or not depends - I doubt it would bring much benefit here). – cfr Sep 03 '17 at 20:58

1 Answers1

4

Just add no edge to the [L] node: (see p. 45 of the docs).

\documentclass{article}
\usepackage{forest, amsmath}
\begin{document}
    \begin{forest}
        for tree = {%
            parent anchor = south,
            child anchor = north,
            s sep = 0em,
            tier/.option = level}
        [, phantom
            [a]
            [r]
            [c]
            [h]
            [i]
            [p]
            [$\stackrel{*}{\text{e}}$
                [$\stackrel{*}{\text{H}}$]]
            [l]
            [a
                [L,no edge]]
            [g]
            [o]
        ]
    \end{forest}
\end{document}

output of code

Alan Munn
  • 218,180