2

How to make four edges to one edge path?

enter image description here

I have made ​​it up here:

enter image description here

\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}
  • Draw the node as the child of any one of its parents and add the arrows from the other 3 parents after finishing the tree (but before closing the forest environment). – cfr Aug 18 '14 at 17:11
3

I came up with this idea, maybe it could be useful.

Add the "conclusion" like a new node (i named it (end), this allows center it regarding to the tree), name each leaf (branch ..) and after join with edges.

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

Result

enter image description here

  • (+1) This does a nicer job of placement than my answer! (Though I don't understand what it does exactly....) – cfr Aug 18 '14 at 22:04
  • @cfr What I do is to measure (width) of the @kalakay's tree and save in the \n1 register (using the let operation), then to create a new node with this measurement as minimum width (inconvenient because i must pass all options, unless i create a new style). I put this new node centered fixing it in ([yshift=-5mm]current bounding box.south), then i reference it (which you also did, with parent) and i draw the arrows. – skpblack Aug 18 '14 at 22:28
  • Thanks! I think it is the let operation I need to look at (and maybe current bounding box but that seems relatively self-explanatory). – cfr Aug 18 '14 at 22:41
1

For example, you could do something like this:

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

many parents, one child

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.