森林等级之间的一致性

森林等级之间的一致性

在 Stack Exchange 网络社区的人们的帮助下,我几乎完成了我的图表。请看我在此处附上的图表。我画了两个小圆圈。能否使这些线对齐?

代码如下。

\documentclass{article}
\usepackage{tikz}
\usepackage{lscape}
\usepackage[edges]{forest}

\begin{document}
    \begin{forest}
        for tree={forked edge, edge=->, draw,
            thick,
            rounded corners, minimum size=8mm, l sep=10mm,align=left,fork sep=5mm,fill=blue!10}
        [Fluids, s sep=0.3cm
        [Ideal Fluids]
        [Real Fluids, s sep=0.3cm, 
        [Non-Newtonian Fluid, s sep=0.3cm
        [Time-Independent Fluids, s sep=0.3cm
        [Pseudo plastic][Dilatant][Bingham plastic]
        ]
        [Visco-elastic Fluids]
        [Time-Dependent Fluids, s sep=0.3cm
        [Thixotropic][Rheopetic]
        ]
        ]
        [Newtonian Fluids]
        ]
        ]
    \end{forest}
    \end{document}

在此处输入图片描述

答案1

谢谢 - 森林树,每个相对层级上都有文件夹

在此处输入图片描述

\documentclass{article}
\usepackage{tikz}
\usepackage{lscape}
\usepackage[edges]{forest}
\forestset{
    calign to midchild or edge midpoint/.style={
        if={isodd(n_children())}{
            calign=child edge,
            calign primary child/.process={
                O+nw+n{n children}{(##1+1)/2}
            },
        }{
            calign=edge midpoint,
        },
    },
}

\begin{document}
    \begin{forest}
        my fork/.style={
%           grow=south, 
            calign to midchild or edge midpoint,
        },  
        for tree={forked edge, edge=->, draw,
            thick,
            rounded corners, 
            minimum size=8mm, 
            l sep=10mm,
            align=left,
            fork sep=5mm,
            fill=blue!10, my fork
            }
        [Fluids, s sep=0.3cm
        [Ideal Fluids]
        [Real Fluids, s sep=0.3cm, 
        [Non-Newtonian Fluid, s sep=0.3cm
        [Time-Independent Fluids, s sep=0.3cm
        [Pseudo plastic][Dilatant][Bingham plastic]
        ]
        [Visco-elastic Fluids]
        [Time-Dependent Fluids, s sep=0.3cm
        [Thixotropic][Rheopetic]
        ]
        ]
        [Newtonian Fluids]
        ]
        ]
    \end{forest}
\end{document}

相关内容