如何在LaTex中绘制简单的层次关系(附加问题)

如何在LaTex中绘制简单的层次关系(附加问题)

这是来自在此处输入链接描述

在此处输入图片描述

 \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}

我如何添加这个新部分:

在此处输入图片描述

答案1

在此处输入图片描述

\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[water abc][sugar \\contaminated]][non pure fruit[water abc][sugar \\contaminated]]]
\end{forest}
\end{document}

相关内容