Quantcast
Channel: Forest have label for nodes that is separate from content - TeX - LaTeX Stack Exchange
Viewing all articles
Browse latest Browse all 3

Answer by cfr for Forest have label for nodes that is separate from content

$
0
0

I think I ought not answer do-it-for-mes like this one, especially ones asked by those clearly capable of posting code. I'm going to regardless because I like trees.

I provide answers to do-it-for-mes on a strictly as-is basis. I answer these questions not just because I want to but only, solely and purely for that reason. Expect me to be less than sympathetic to requests for explanations or adjustments. I spent the time setting the problem up. If you'd wanted me to explain, you'd have helped me to help you.

\documentclass[border=10pt,multi,tikz]{standalone}\usepackage[edges]{forest}\begin{document}\begin{forest}  forked edges,  for tree={    align=center,    draw,    rounded corners,    l sep'+=15pt,  },  my label/.style={    label={[anchor=south east]above:#1},  },  before typesetting nodes={    for descendants={      temptoksa/.option=n,      for nodewalk={        while={>On>{level}{1}}{u,+temptoksa=.,+temptoksa/.option=n}      }{},      my label/.register=temptoksa,    },  }  [Things it is time to speak of \dots    [Shoes      [An invention designed to\\protect the wealthy and\\trample the poor.]    ]    [Ships      [Occasionally to be\\found in bottles.]    ]    [Sealing was      [Not to be confused\\with ceiling wax.]    ]    [Cabbages      [{A traditional medicine for\\poverty, everywhere believed\\efficacious by the rich\\and known ineffective\\by the poor.}]    ]    [Kings      [Hereditary obsolescence.]    ]    [Why the sea is boiling hot      [\emph{Non sequitur}.]    ]    [Whether pigs have wings      [Falsehood.        [\emph{A posteriori.}]        [Contingent.]      ]    ]  ]\end{forest}\end{document}

auto-numbering


Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>