if
s. Second, you need to assign to more than one key (and even that, only in some of the if
branches). I'll post several pieces of code below. if
s. Second, you need to assign to more than one key (and even that, only in some of the if
branches). I'll post several pieces of code below. \begin{forest} delay={ tempcounta=1, content/.process={ _R= ? O } {1}{tempcounta} {parent anchor}{child anchor} } [X,parent anchor=south,child anchor=north] \end{forest}
?
, either the true or the false argument, remains on the right, you can directly use it as an option name of O
. if iteration
is done within .process
(but only for the current node's edge label
). The complicated call of .process
is commented, I hope that helps. \begin{forest} for tree={ math content, grow'=0, calign primary child=1, calign primary angle=-30, calign=last, delay={ if iteration={}{iteration/.option=level, is auto iteration}{}, }, }, before typesetting nodes={ for tree={ if n=1{ if content={}{ content/.process={Ow}{iteration}{w_#1}, if is auto iteration={ edge label/.process={ Ow+n % compute "iteration-1", even if we don't need it in all cases
\begin{forest} for tree={ math content, grow'=0, calign primary child=1, calign primary angle=-30, calign=last, delay={ if iteration={}{iteration/.option=level, is auto iteration}{}, }, }, this edge label/.style 2 args={% #1 = additional node options, #2 = denominator edge label={node [midway, anchor=south east, xshift=-2.5pt, font=\scriptsize, #1] {$\frac{2}{#2}$}} }, parent edge label/.style 2 args={% #1 = numerator, #2 = denominator !u.edge label={node [midway, below, font=\scriptsize] {$\frac{#1}{#2}$}},
calign=last
essentially overrides all the previous calign
related keys. This is what works: \begin{forest} for tree={ math content, grow'=0, calign primary angle=0, calign secondary angle=30, calign=fixed edge angles, delay={ if iteration={}{iteration/.option=level, is auto iteration}{}, }, }, this edge label/.style 2 args={% #1 = additional node options, #2 = denominator edge label={node [midway, anchor=south east, xshift=-5pt, font=\scriptsize, #1] {$\frac{2}{#2}$}} }, parent edge label/.style 2 args={% #1 = numerator, #2 = denominator
process
instruction u
have one layer of braces too many. This doesn't cause a problem for in the code above, but it could be a problem in some other situations. P
(pgfmath) currently does not accept forestmath expressions, i.e. you cannot start your pgfmath expression by >
to indicate that it's actually a(n embedded) call to the argument processor. I have no idea why I thought this would be wise. Allowing forestmath there would make it possible to nest conditionals in .process
. I'll send you the new forest runtime files and an example once I have the issue fixed. for tree={ math content, grow'=0, calign primary angle=0, calign secondary angle=30, calign=fixed edge angles, delay={ if iteration={}{iteration/.option=level, is auto iteration}{}, }, },
ignore edge
for the entire tree. (And you will want to increase s sep
.) \begin{forest} for tree={ math content, grow'=0, calign primary angle=0, calign secondary angle=30, calign=fixed edge angles, delay={ if iteration={}{iteration/.option=level, is auto iteration}{}, }, }, this edge label/.style 2 args={% #1 = additional node options, #2 = denominator edge label={node [midway, anchor=south east, xshift=-5pt, font=\scriptsize, #1] {$\frac{2}{#2}$}} }, parent edge label/.style 2 args={% #1 = numerator, #2 = denominator
beamer
presentation. I like a tree structure when trying to explain things to people, so this package makes my life so easy! Thank you very much @Sašo and everybody that makes this package possible! forest
diagrams: vimeo.com/187525063 :)