I have the block nodes as below figure. I want to connect them by arrow, with bold font. Could you help me to look at my code and update them? Thank you so much
This is my current result
This is my expected result
One more thing, the graph does not show the center of page. Is it possible to adjust its position?
\documentclass[preprint,12pt, sort&compress]{elsarticle}
\usepackage{tikz}
\usetikzlibrary{trees}
\usepackage{varwidth}
\usetikzlibrary{arrows,shapes,positioning,shadows,trees,calc}
\begin{document}
\begin{figure}[h]
\centering
\begin{tikzpicture}[
every node/.style={draw, rectangle},
edge from parent path={
(\tikzparentnode) |- % Start from parent
($(\tikzparentnode)!0.5!(\tikzchildnode)$) -| % make an ortho line to mid point
(\tikzchildnode)},
second/.style ={level distance=18ex},
third/.style ={level distance=18ex},
fourth/.style ={level distance=10ex},
] % make another ortho to the target
\node (A){This is first block}
[sibling distance=9cm]
child {node (B) {\begin{varwidth}{6cm}The second block 1\end{varwidth}}
[sibling distance=6cm]
child [third]{node {\begin{varwidth}{3cm}Third level block left 2\end{varwidth}}
[sibling distance=3cm]
child [fourth]{node {\begin{varwidth}{3cm}Last block 1\end{varwidth}}}
child [fourth]{node {\begin{varwidth}{3cm}Last block 2\end{varwidth}}}
}
child [second]{node {\begin{varwidth}{3cm}Third level block left 2\end{varwidth}}
[sibling distance=3cm]
child [fourth]{node {\begin{varwidth}{3cm}Last block 3\end{varwidth}}}
child [fourth]{node {\begin{varwidth}{3cm}Last block 4\end{varwidth}}}
}
}
child {node {The second block 2}
[sibling distance=3.5cm]
child [third]{node {\begin{varwidth}{3cm}Third level block right 1\end{varwidth}}}
child [third]{node {\begin{varwidth}{3cm}Third level block right 2\end{varwidth}}}
};
\end{tikzpicture}
\end{figure}
\end{document}
UPDATE: Regarding the ans. of smike. I Obtained the result as below. But it has two problem 1. The figure did not center of the page
- The width line of block look more thick. I want all blocks have same thick





\tikzset{edge from parent/.style={draw,->}}.
I am not sure why the centering is an issue.
– smike Mar 05 '16 at 15:23ultra thickmight show better. Or using a custom line width can also be done:line width=1.5pt. – smike Mar 05 '16 at 15:33line width=x, wherexis the width you want. You can use scope here for that. – smike Mar 05 '16 at 15:38geometrypackage, your graph is automatically centred. That might help.To be sure of that, pass the option
– smike Mar 05 '16 at 15:42framedtotikzpicture(remember to includebackgroundstikzlibrary). The frame around the graph will give you an idea of the placement of the figure with respect to the page.standaloneversion? – smike Mar 05 '16 at 15:51