5
\documentclass{article} 
\usepackage{forest}

\begin{document}
\begin{forest}
[Z [$K[2]$] ]
\end{forest}
\end{document}

How can I use brackets in a node name? Not necessarily inside math. The above just yiels weird errors.

7

From page 4 of the forest documentation or Ex. (4), "If you need a square bracket as part of a node’s content, use braces." To view the documentation for a package, try texdoc <package name> from a command line.

\documentclass{article} 
\usepackage{forest}
\begin{document}
\begin{forest}
[Z [{$K[2]$}] ]
\end{forest}
\end{document}

enter image description here

  • 1
    Oh gee... I looked into the manual but only searched for escaping etc. Thanks! :) – letmaik Feb 10 '15 at 16:18

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.