如何制作四条边到一条边的路径?
我在这里做了一下:
\documentclass[10pt,a4paper]{article}
\usepackage[margin=2cm]{geometry}
\usepackage{charter}
\usepackage{forest}
\usetikzlibrary{shadows}
\begin{document}
\begin{forest}
for tree={
edge path={
\noexpand\path[line width=1.5pt,\forestoption{edge}]
(\forestOve{\forestove{@parent}}{name}.parent anchor) -- +(0,-16pt) -|
(\forestove{name}.child anchor)\forestoption{edge label};
},
l sep=12pt,
draw,
fill=white,
align=center,edge={->,thick},
drop shadow
}
[Menentukan Tujuan Penilaian
[Memperhatikan Standar Kompetensinya
[Menentukan KD-nya (KD1 + KD2 + KD3 dll)
[Tes
[Menentukan Materi Penting/\\Pendukung KD: UKRK
[Tepat diujikan secara tertulis/lisan?
[Tepat
[Bentuk Objektif\\ (pg{,} isian{,} dll)]
[Bentuk\\ Uraian]
]
[Tidak Tepat
[Tes Perbuatan
[{\textbullet} kinerja (performance)\\
{\textbullet} penugasan (project)\\
{\textbullet} hasil karya (product)\\
{\textbullet} dll]
]]]]]
[NonTes
[{\textbullet} Pengamatan/Observasi (Sikap{,} Portofolio{,} \emph{Life Skills})\\{\textbullet} Tes sikap\\{\textbullet} dll]
]]]]
;
\end{forest}
\end{document}
答案1
我想到了这个想法,也许它可能会有用。
添加“结论”就像一个新节点(我将其命名为(end)
,这允许它相对于树居中),命名每个叶子(branch ..)
然后与边连接。
\documentclass[10pt,a4paper]{article}
\usepackage[margin=2cm]{geometry}
\usepackage{charter}
\usepackage{forest}
\usetikzlibrary{shadows,calc}
\begin{document}
\begin{forest}
for tree={
edge path={
\noexpand\path[line width=1.5pt,\forestoption{edge}]
(\forestOve{\forestove{@parent}}{name}.parent anchor) -- +(0,-16pt) -|
(\forestove{name}.child anchor)\forestoption{edge label};
},
l sep=12pt,
draw,
fill=white,
align=center,edge={->,thick},
drop shadow
}
[Menentukan Tujuan Penilaian
[Memperhatikan Standar Kompetensinya
[Menentukan KD-nya (KD1 + KD2 + KD3 dll)
[Tes
[Menentukan Materi Penting/\\Pendukung KD: UKRK
[Tepat diujikan secara tertulis/lisan?
[Tepat
[Bentuk Objektif\\ (pg{,} isian{,} dll),name=branch 1]
[Bentuk\\ Uraian,name=branch 2]
]
[Tidak Tepat
[Tes Perbuatan
[{\textbullet} kinerja (performance)\\
{\textbullet} penugasan (project)\\
{\textbullet} hasil karya (product)\\
{\textbullet} dll,name=branch 3]
]]]]]
[NonTes
[{\textbullet} Pengamatan/Observasi (Sikap{,} Portofolio{,} \emph{Life Skills})\\{\textbullet} Tes sikap\\{\textbullet} dll,name=branch 4]
]]]]
\path let \p1=($(current bounding box.east)-(current bounding box.west)$), \n1={veclen(\x1,\y1)} in
([yshift=-5mm]current bounding box.south) node
[ minimum width=\n1, % Width of node equals to width of previous tree
anchor=north,
draw,
fill=white,
align=center,
drop shadow] (end)
{Ikuti Kaidah Penulisan Soal Dan Sunsunla Pedoman Penskorannya};
\foreach \i in {1,...,4} {\draw[->,thick](branch \i)--(branch \i|-end.north);}
\end{forest}
\end{document}
结果
答案2
例如,你可以做这样的事情:
\documentclass[10pt,a4paper]{article}
\usepackage[margin=2cm]{geometry}
\usepackage{charter}
\usepackage{forest}
\usetikzlibrary{shadows}
\begin{document}
\begin{forest}
for tree={
edge path={
\noexpand\path[line width=1.5pt,\forestoption{edge}]
(\forestOve{\forestove{@parent}}{name}.parent anchor) -- +(0,-16pt) -|
(\forestove{name}.child anchor)\forestoption{edge label};
},
l sep=12pt,
draw,
fill=white,
align=center,edge={->,thick},
drop shadow
}
[Menentukan Tujuan Penilaian
[Memperhatikan Standar Kompetensinya
[Menentukan KD-nya (KD1 + KD2 + KD3 dll)
[Tes
[Menentukan Materi Penting/\\Pendukung KD: UKRK
[Tepat diujikan secara tertulis/lisan?
[Tepat
[Bentuk Objektif\\ (pg{,} isian{,} dll), name=parent1]
[Bentuk\\ Uraian, name=parent2]
]
[Tidak Tepat
[Tes Perbuatan
[{{\textbullet} kinerja (performance)\\
{\textbullet} penugasan (project)\\
{\textbullet} hasil karya (product)\\
{\textbullet} dll}, parent anchor=south, l sep+=5pt, child anchor=north
[Text of final node here which is supposed to be long and so take up a large amount of horizontal space., name=final child]
]
]]]]]
[NonTes
[{\textbullet} Pengamatan/Observasi (Sikap{,} Portofolio{,} \emph{Life Skills})\\{\textbullet} Tes sikap\\{\textbullet} dll, name=parent4]
]]]]
;
\draw [->, thick] (parent1.south) -- (final child.north -| parent1.south);
\draw [->, thick] (parent2.south) -- (final child.north -| parent2.south);
\draw [->, thick] (parent4.south) -- (final child.north -| parent4.south);
\end{forest}
\end{document}