美文网首页
LaTeX绘制大括号树状结构图

LaTeX绘制大括号树状结构图

作者: 有几米爱音乐 | 来源:发表于2023-08-06 18:47 被阅读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 宏包画“大括号”图

相关文章

网友评论

      本文标题:LaTeX绘制大括号树状结构图

      本文链接:https://www.haomeiwen.com/subject/qsjwpdtx.html