如何在 LaTex 中绘制简单的层次关系

如何在 LaTex 中绘制简单的层次关系

知道如何用 LaTex 书写吗:

在此处输入图片描述

答案1

在此处输入图片描述

    \documentclass{standalone}
\usepackage[edges]{forest}
\begin{document}
\begin{forest}
for tree={
    draw,
    semithick,
    rounded corners,
    text width=6em,
    text badly centered,
    minimum height=4ex,
    edge={
            draw=blue},
    anchor= north,
    grow=south,
    forked edge,
    s sep=4mm,
    l sep=12mm,
    fork sep=6mm,
}
[sample number 1[pure fruit][non pure fruit[water abc][sugar \\contaminated]]]
\end{forest}
\end{document}

编辑相同尺寸的盒子

    \documentclass{standalone}
\usepackage[edges]{forest}
\begin{document}
\begin{forest}
for tree={
    draw,
    semithick,
    rounded corners,
    text width=6em,
    text badly centered,
    minimum height=6ex,
    edge={draw=blue},
    anchor= north,
    grow=south,
    forked edge,
    s sep=4mm,
    l sep=5mm,
    fork sep=3mm,
    inner sep=1pt
}
[sample number 1[pure fruit][non pure fruit[water abc][sugar \\contaminated]]]
\end{forest}
\end{document}

在此处输入图片描述

相关内容