I got a solution for my quoestion about Smaller roofs for forest but I want to pass a command instead of text to a procedure and this causes an error:
! Argument of \@rsbox has an extra }.
<inserted text>
\par
l.45 \end{forest}
?
This is the code:
\documentclass{minimal}
\usepackage{forest}
\forestset{
with translation/.style={
l sep=0,inner xsep=0,
append translation/.expanded/.wrap pgfmath arg={\gettranslation{##1}}{content},
content/.expanded/.wrap pgfmath arg={\gettext{##1}}{content},
},
append translation/.style={append={[#1,no edge,l=0,inner xsep=0,inner ysep=0,outer ysep=0,before
computing xy={l-=2pt}]}},
sn edges/.style={for tree={parent anchor=south, child anchor=north,align=center,base=top},
where n children=0{tier=word,delay=with translation}{}
}
}
\def\gettext#1{\gettextA#1;;\endget}
\def\gettextA#1;#2;{\removesep#1;}
\def\gettranslation#1{\gettranslationA#1;;\endget}
\def\gettranslationA#1;#2;{\removesep#2;}
\def\removesep#1;#2\endget{#1}
\newcommand{\trace}{\raisebox{0.2ex}{\_}\rule{0cm}{0.7em}}
\begin{document}
\begin{forest}
sn edges
[NP
[Det [eine;a] ]
[N$'$
[A [kluge;smart] ]
[N$'$
[N [\trace ] ] ] ] ]
\end{forest}
\end{document}
\end{forest}
Is there a way to allow such commands in translated trees? I do not understand the code, so I am a bit helpless here ...
\newsavebox\mybox \savebox\mybox{\trace}
in advance of the forest and then use\usebox{\mybox}
inside the forest.\noexpand\trace
instead\trace
in forest environment. But I don't know what is your intend. Your code generates overlapping text and I don't understand the mentioned package.forest
in an effective way. This involvestikz
and both packages are very powerful. I learn from the examples by going then back to the manual and try to understand what is going on. The code is not mine and of course people would have done it differently if they new all the possible ways I wanted to use and misuse it. In any case I am very grateful to all the help I got here. By you and others. Thanks again!