I installed forest 2016/03/04 v2.0.2 and started experimenting with recent forest features by modifying the source code from https://tex.stackexchange.com/a/302713/82730.
With the following code,
\documentclass[convert={size=640}]{standalone}
\usepackage{microtype}
\usepackage[T1]{fontenc}
% forest
\usepackage{forest}
% parsing tree
\forestset{
declare toks={wff}{},
declare toks={connective}{},
parsing tree/.style={
declare dimen register={parsing tree sep},
parsing tree sep=5pt,
% Append the current root to a new phantom root.
for root'={
replace by={[,phantom,append=!last dynamic node]}
},
% `for tree` applies only to the subtree of the new phantom root.
for tree={
math content,
parent anchor=children,
child anchor=parent,
inner sep=0pt,
if n children=1{!first.calign with current edge}{},
delay={
content=\circ,
insert before/.wrap pgfmath arg={
[##1,no edge,math content,anchor=base east,
before computing xy={
s/.pgfmath={s("!n")-\forestregister{parsing tree sep}}
}]
}{wff},
if connective={}{connective/.option=wff}{},
insert after/.wrap pgfmath arg={
[##1,no edge,math content,anchor=base west,
before computing xy={
s/.pgfmath={s("!p")+\forestregister{parsing tree sep}}
}]
}{connective},
}
}
}
}
\begin{document}
\begin{forest}
parsing tree
[,wff=p_0\wedge q_0,connective=\wedge
[,wff=p_0] [,wff=q_0 []]]
\end{forest}
\end{document}
comes
If I take if connective={}{connective/.option=wff}{} out of delay as below,
\documentclass[convert={size=640}]{standalone}
\usepackage{microtype}
\usepackage[T1]{fontenc}
% forest
\usepackage{forest}
% parsing tree
\forestset{
declare toks={wff}{},
declare toks={connective}{},
parsing tree/.style={
declare dimen register={parsing tree sep},
parsing tree sep=5pt,
% Append the current root to a new phantom root.
for root'={
replace by={[,phantom,append=!last dynamic node]}
},
% `for tree` applies only to the subtree of the new phantom root.
for tree={
math content,
parent anchor=children,
child anchor=parent,
inner sep=0pt,
if n children=1{!first.calign with current edge}{},
if connective={}{connective/.option=wff}{},
delay={
content=\circ,
insert before/.wrap pgfmath arg={
[##1,no edge,math content,anchor=base east,
before computing xy={
s/.pgfmath={s("!n")-\forestregister{parsing tree sep}}
}]
}{wff},
insert after/.wrap pgfmath arg={
[##1,no edge,math content,anchor=base west,
before computing xy={
s/.pgfmath={s("!p")+\forestregister{parsing tree sep}}
}]
}{connective},
}
}
}
}
\begin{document}
\begin{forest}
parsing tree
[,wff=p_0\wedge q_0,connective=\wedge
[,wff=p_0] [,wff=q_0 []]]
\end{forest}
\end{document}
I see
It seems declared node options are available only after a delay. Am I right?




The keys given in the bracket representation are processed. In detail, default preamble is processed first, then the given preamble (both in the context of the (formal) root node) and finally the keylists given to individual nodes.I couldn't imagine the implications of forest stages when I read it. – May 04 '16 at 22:39