3

I want to annotate some subparts of a language family tree by adding a bracket below them. Taking inspiration from another question, I currently get as far as

\begin{forest}
  for tree={s sep=2mm, inner sep=0, l=4mm},
  for leaves={anchor=west, rotate=-90, tier=attestedlangs},
  delay={for tree={name/.pgfmath=content}},
  forked edges,
  [TAP
    [AP,
      for relative level=1{edge=double},
        [Pantar
          [Western Pantar]
          [Teiwa]
          [Klamu]
        ]
        [Kaera]
        [Straits, tier=dial
          [Blagar]
          [Reta]
        ]
      [W Alor, tier=lang
        [, tier=dial
          [Hamap]
          [Adang-Otvai]
        ]
        [, tier=dial
          [Adang-Lawahing]
          [Kabola]
        ]
      ]
      [Klon]
      [Kafoa]
      [Nuclear Alor
        [, tier=lang
          [Kui]
          [Kiraman]
        ]
        [
          [Abui]
          [
            [Kamang]
            [, tier=lang
              [, tier=dial
                [Kula]
                [Sawila]
              ]
              [Wersing]
            ]
          ]
        ]
      ]
    ]
    [E Timor, tier=lang
      [Makasae]
      [
        [Fataluku, name=Fataluku]
        [Oirata, name=Oirata]
      ]
    ]
    [Bunak]
  ]
  \draw[decorate,decoration={brace,amplitude=1em,mirror}] (Kaera.south east) -- node[below=1em] {*q > k} (Wersing.north east);
  \draw[decorate,decoration={brace,amplitude=1em,mirror}] (Blagar.south east) -- node[below=1em] {*s > h} (Kafoa.north east);

\end{forest}

This produces the top of the following two figures, I would like to achieve the bottom one.

Two tree variants. Result of current output on top, desired output on bottom.

As a workaround, I would just attempt to add more tiers to the tree and connect those, like

[Blagar, rotate=-90, anchor=west, name=Blagar, tier=attestedlangs
 [,name=Blagar1, tier=below1, edge=none 
  [,name=Blagar2, tier=below2, edge=none]]]

and then connect (Blagar2.south west) instead of (Blagar.south east), but that seems like an extremely cumbersome way to build this structure manually, and I don't know how to instead construct it using for leaves and delay and similar Forest automation constructs.

Anaphory
  • 440
  • 2
  • 10

1 Answers1

3

You can use the current bounding box node, which gets updated, along with the |- syntax to do

  \path (current bounding box.south) coordinate (s1);
  \draw[decorate,decoration={brace,amplitude=1em,mirror}] 
    (Kaera.south east|-s1) -- node[below=1em] {*q $>$ k} (Wersing.north east|-s1);
  \path (current bounding box.south) coordinate (s2);
  \draw[decorate,decoration={brace,amplitude=1em,mirror}] 
  (Blagar.south east|-s2) -- node[below=1em] {*s $>$ h} (Kafoa.north east|-s2);

Full MWE:

\documentclass[tikz,border=3mm]{standalone}
\usepackage[edges]{forest}
\usetikzlibrary{decorations.pathreplacing}
\begin{document}
\begin{forest}
  for tree={s sep=2mm, inner sep=0, l=4mm},
  for leaves={anchor=west, rotate=-90, tier=attestedlangs},
  delay={for tree={name/.pgfmath=content}},
  forked edges,
  [TAP
    [AP,
      for relative level=1{edge=double},
        [Pantar
          [Western Pantar]
          [Teiwa]
          [Klamu]
        ]
        [Kaera]
        [Straits, tier=dial
          [Blagar]
          [Reta]
        ]
      [W Alor, tier=lang
        [, tier=dial
          [Hamap]
          [Adang-Otvai]
        ]
        [, tier=dial
          [Adang-Lawahing]
          [Kabola]
        ]
      ]
      [Klon]
      [Kafoa]
      [Nuclear Alor
        [, tier=lang
          [Kui]
          [Kiraman]
        ]
        [
          [Abui]
          [
            [Kamang]
            [, tier=lang
              [, tier=dial
                [Kula]
                [Sawila]
              ]
              [Wersing]
            ]
          ]
        ]
      ]
    ]
    [E Timor, tier=lang
      [Makasae]
      [
        [Fataluku, name=Fataluku]
        [Oirata, name=Oirata]
      ]
    ]
    [Bunak]
  ]
  \path (current bounding box.south) coordinate (s1);
  \draw[decorate,decoration={brace,amplitude=1em,mirror}] 
    (Kaera.south east|-s1) -- node[below=1em] {*q $>$ k} (Wersing.north east|-s1);
  \path (current bounding box.south) coordinate (s2);
  \draw[decorate,decoration={brace,amplitude=1em,mirror}] 
  (Blagar.south east|-s2) -- node[below=1em] {*s $>$ h} (Kafoa.north east|-s2);
\end{forest}
\end{document}

enter image description here