I am using forest to typeset some trees that contain many repetitive structures. For example:
\begin{forest}
[ [ NP [ N : \textit{John} ] ]
[ VP
[ V : \textit{ate} ]
[ NP
[ NP [ N : \textit{apples} ] ]
[ Conj : \textit{and} ]
[ NP [ N : \textit{bananas} ] ]
]
]
]
\end{forest}
In particular, note the [ NP [ N : \textit{...} ] ] construction that appears three times (John, apples, bananas).
I am hoping to use some abstraction (a macro, or forest's own options engine, etc.) to avoid having to type out the whole [ NP [ N : \textit{...} ] ] chunk each time, to the effect of something similar to (pseudo-example that doesn't actually work):
\newcommand{\NPN}[1]{[ NP [ N : \textit{#1} ] ]}
\begin{forest}
[ \NPN{John}
[ VP
[ V : \textit{ate} ]
[ NP
\NPN{apples}
[ Conj : \textit{and} ]
\NPN{bananas}
]
]
]
\end{forest}
Is this possible? Ideally, I'd like to use forest here, but if other tree-drawing packages offer this capability, I could be interested in seeing how to do that as well.
