TeX - LaTeX Asked by Dasha Poliakova on January 30, 2021
I am using forest package to write some algebra with planar trees. However, when I combine automatically sized brackets with my forest picture, the bracket size and position is completely wrong: it goes all the way below the forest. How do I get the adequately sized and positioned brackets?
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{forest}
begin{document}
$$left ( begin{forest}
for tree = {grow'=90,circle, fill, minimum width = 4pt, inner sep = 0pt, s sep = 13pt}
[{},phantom
[{},name = one [[]] [[][]] ]
[{},name = two [[]] [[]] ]
]
draw[black] (one) -- (two);
end{forest},
begin{forest}
for tree = {grow'=90,circle, fill, minimum width = 4pt, inner sep = 0pt, s sep = 13pt}
[{},phantom
[{},name = one [[]] [[][]] ]
[{},name = two [[]] [[]] ]
[{},name = three [ [][]]]
[{},name = four [ [] [] []] [[]] ]
]
draw[black] (one) -- (two) -- (three) -- (four);
end{forest} right )$$
end{document}
Do not use $$ ... $$
but use [ ... ]
instead. You need to center the tree vertically, which can be done with vcenter
.
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{forest}
begin{document}
[left (vcenter{hbox{begin{forest}
for tree = {grow'=90,circle, fill, minimum width = 4pt, inner sep = 0pt, s sep = 13pt}
[{},phantom
[{},name = one [[]] [[][]] ]
[{},name = two [[]] [[]] ]
]
draw[black] (one) -- (two);
end{forest},
begin{forest}
for tree = {grow'=90,circle, fill, minimum width = 4pt, inner sep = 0pt, s sep = 13pt}
[{},phantom
[{},name = one [[]] [[][]] ]
[{},name = two [[]] [[]] ]
[{},name = three [ [][]]]
[{},name = four [ [] [] []] [[]] ]
]
draw[black] (one) -- (two) -- (three) -- (four);
end{forest}}} right )]
end{document}
Answered by user228539 on January 30, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP