I'm trying to draw the a structure that has multiple chains from the start, based on this example http://www.texample.net/tikz/examples/assignment-structure/
What I have so far is:
\documentclass[]{article}
\usepackage{tikz}
\usetikzlibrary{calc,trees,positioning,arrows,chains,shapes.geometric,%
decorations.pathreplacing,decorations.pathmorphing,shapes,%
matrix,shapes.symbols}
\tikzset{
>=stealth',
punktchain/.style={
rectangle,
rounded corners,
% fill=black!10,
draw=black, very thick,
text width=10em,
minimum height=3em,
text centered,
on chain},
line/.style={draw, thick, <-},
element/.style={
tape,
top color=white,
bottom color=blue!50!black!60!,
minimum width=8em,
draw=blue!40!black!90, very thick,
text width=10em,
minimum height=3.5em,
text centered,
on chain},
every join/.style={->, thick,shorten >=1pt},
decoration={brace},
tuborg/.style={decorate},
tubnode/.style={midway, right=2pt},
}
\begin{document}
\begin{figure}[h]
\centering
\begin{tikzpicture}[node distance=.8cm,
start chain=1 going below, start chain=2 going below]
\node[punktchain, join] (start) {Static MC};
\node[punktchain, join] (probf) {Uniform Generator};
\node[punktchain, join] (u) {U};
\node[punktchain, join] (rules) {Transformation Rules};
\node[punktchain, join, ] (simrv) {Simulated r.v. X};
\node (loop) [punktchain ] {Simulation algorithm (loop)};
%Left Branch
\begin{scope}[start branch=left,
every join/.style={->, thick, shorten <=1pt}, ]
\node[punktchain, on chain=going left, join=by {<-}] (var) {Variance Reduction};
\end{scope}
%Lower branch
\node[punktchain, join] (paths) {Sample paths};
\node[punktchain, join] (law) {Law of large numbers};
\node[punktchain, join] (estim) {Monte Carlo Estimation};
\draw[tuborg] let
\p1=(loop.west), \p2=(loop.east) in
($(\x1,\y1+2.5em)$) -- ($(\x2,\y2+2.5em)$) node[below, midway] {};
\end{tikzpicture}
\caption{}
\label{fig:6forces}
\end{figure}
\end{document}
Which looks like this so far
What I'd like to do from here on, is what I've sketched above in black color. That is, I want another chain to the right of the existing that links up at the (loop) node and has a fork in it as well.
Can somebody give me some help? I've been going over the tikz manual but I'm not getting very far.
Cheers,
Christos
Best Answer
This is a first trial since I didn't understood well how you would like to connect the two chains near the loop node.
My solution leads to:
Here is the code:
The key points in my solution are:
x
) placed with in positionright=2cm of start
;trees
to separate the chain in two sub-chains from nodez
;small punktchain
, to represent nodes in the sub-chains; it basically is a replica of the stylepunktchain
just a bit small;calc
library to connect the two sub-chains with the initial chain (this part could be improved as soon as more details will be provided).