2

I want smaller font size for all levels except the far out children (in the example below, everything except I saw Jane.) How do I do that with the forestset?

\documentclass{article}
\usepackage[linguistics, edges]{forest}
\begin{document}
\begin{center}
    \begin{forest}
    forked edges,
    [S
        [subject
            [pronoun [I]]
        ]
        [predicate,before computing xy={s/.average={s}{siblings}}
            [verb [saw]]
        ] [object
            [noun
                [Jane.]
            ]
        ]
    ]
    \end{forest}  
\end{center}
\end{document}

enter image description here

2
1

With use of the forestset:

\documentclass{article}
\usepackage[linguistics, edges]{forest}
\forestset{  % <---
  my tree/.style={for tree={forked edge,
                  where n children=0{font=\large} % <---
                                    {font=\small} % <---
                           }
                 }
          }% end of forestset

\begin{document}
\begin{center}
    \begin{forest} my tree % <---
[S
    [subject
        [pronoun 
            [I]
        ]
    ]
    [predicate,before computing xy={s/.average={s}{siblings}}
        [verb 
            [saw]
        ]
    ] 
    [object
        [noun
            [Jane.]
        ]
    ]
]
    \end{forest}
\end{center}
\end{document}

enter image description here

2

enter image description here

\documentclass{article}
\usepackage[linguistics, edges]{forest}
\begin{document}
\begin{center}
    \begin{forest}for tree={font=\tiny},where n children=0{font=\normalsize}{},
    forked edges,
    [S
        [subject
            [pronoun [I]]
        ]
        [predicate,before computing xy={s/.average={s}{siblings}}
            [verb [saw]]
        ] [object
            [noun
                [Jane.]
            ]
        ]
    ]
    \end{forest}  
\end{center}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.