This is an example modified based on page 1 of the forest
package documentation.
Note the default anchors of the forest
package is not the center of a node, and thus there appear to be white spaces between edges. To fix this, set both parent anchor
and child anchor
to center
, so that they can "connect" with each other. The grow
key specifies the direction to which the tree should grow. Since you want it to grow upwards, grow=north
would do the trick.
\documentclass[border=2pt]{standalone}
\usepackage{forest}
\begin{document}
\pgfmathsetseed{14285}
\begin{forest}
random tree/.style n args={2}{% #1=max levels, #2=max children
if={#1>0}{repeat={random(0,#2)}{append={[,random tree={#1-1}{#2}]}}}{},
parent anchor=center, child anchor=center, grow=north},
[,random tree={4}{3}]
\end{forest}
\end{document}
Update: Attaching tree to another node
This is probably not the best way to attach a forest
tree to another tikz
node, but it's the only thing I can come up with that works.
The idea is to put the forest
tree inside a node, and use node positioning commands to "attach" it to another node. The main imperfection is that you have to manually adjust the yshift
and \scalebox
parameters. (I've tried using inner sep=0pt
and outer sep=0pt
. But those screwed up the forest
picture.)
\documentclass{standalone}
\usepackage{forest}
\begin{document}
\pgfmathsetseed{12987}
\begin{tikzpicture}
\node(s)[circle,fill=red]{some node};
\node[yshift=-5.5pt,anchor=south]at(s.north){
\scalebox{.5}{
\begin{forest}
random tree/.style n args={2}{% #1=max levels, #2=max children
if={#1>0}{repeat={random(0,#2)}{append={[,random tree={#1-1}{#2}]}}}{},
parent anchor=center, child anchor=center, grow=north},
[,random tree={3}{3}]
\end{forest}
}
};
\end{tikzpicture}
\end{document}
You can use double copy shadow
from shadows
tikz library.
An example:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shadows,positioning,calc}
\tikzset{multiple/.style = {double copy shadow={shadow xshift=1ex,shadow
yshift=-1.5ex,draw=black!30},fill=white,draw=black,thick,minimum height = 1cm,minimum
width=2cm},
ordinary/.style = {rectangle,draw,thick,minimum height = 1cm,minimum width=2cm}}
\begin{document}
\begin{tikzpicture}
\node [ordinary] at (0,0) (a) {Some};
\node [multiple,below=3cm of a] (b) {Text};
\draw[-latex] (a) -- coordinate (ab) (b);
\draw (ab) -- ++(0.7,-0.5)coordinate[pos=.3](ab1) coordinate[pos=.6](ab2);
\draw[-latex] (ab1) -- ($(b.north west)!(ab1)!(b.north east)$);
\draw[-latex] (ab2) -- ($(b.north west)!(ab2)!(b.north east)$);
\end{tikzpicture}
\end{document}
Best Answer
I created three new shapes based on diamond. If you need to scale these shapes and if you need to scale the circle, the cross, the + etc..., it would be interesting to choice another way to draw inside the diamond. Only the EB is well defined, for all other you need to draw a path and to fill it. But it's a lot of work.
Picture
Code