LaTeX绘制大括号树状结构图

2023-08-06  本文已影响0人  有几米爱音乐

自定义的一个forest环境样式,forest scheme,创建大括号树状结构图

\documentclass{article}
\usepackage{forest}
\usetikzlibrary{decorations.pathreplacing}

\forestset{
  forest scheme/.style={
    for tree={
      inner sep=0pt,
      outer sep=0pt,
      fit=band,
      child anchor=west,
      parent anchor=east,
      grow'=0,
      anchor=west,
      align=left,
      if n=1{
        edge path'={(!u1.west) -- (!ul.west);}
      }{no edge},
      edge={decorate, decoration={brace,amplitude=1.5mm,mirror,raise=2mm}},
    },
  }
}

\begin{document}
\begin{forest}
  forest scheme
  [根据结合力性质的不同
    [化学键
      [离子键(ionic bond)]
      [共价键(covalent bond)]
      [金属键(metallic bond)]
    ]
    [物理键
      [范德华键(Van der Vaals bond)]
      [氢键(hydrogen bond)]
    ]
  ]
\end{forest}
\end{document}

效果

效果图

参考:用 forest 宏包画“大括号”图

上一篇 下一篇

猜你喜欢

热点阅读