Using tikz-qtree
helps a bit with automatic spacing of siblings. It also provides a simpler input method. Here's your second tree done in that way:
\documentclass[landscape]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[margin=1in]{geometry}
\usepackage{tikz-qtree}
\usetikzlibrary{shadows,trees}
\begin{document}
\tikzset{font=\small,
edge from parent fork down,
level distance=1.75cm,
every node/.style=
{top color=white,
bottom color=blue!25,
rectangle,rounded corners,
minimum height=8mm,
draw=blue!75,
very thick,
drop shadow,
align=center,
text depth = 0pt
},
edge from parent/.style=
{draw=blue!50,
thick
}}
\centering
\begin{tikzpicture}
\Tree [.Paletizador
[.{Inicialização\\de sistema}
[.{Sensor X} ]
[.{Acção Y} ] ]
[.Sacos
[.{Linha/Coluna}
[.{Garra} ]
[.{Rodar Garra} ]
[.{Acção Y2} ] ]
[.{Euro Pallet} ]
[.{Disposição $xyz$}
[.{$x=?$} ]
[.{$y=?$} ]
[.{$z=?$} ] ] ]
[.{Sistema de despacho}
[.{Sensor de peso\\/contador} ]
[.{Tapete rolante\\de saída} ] ]
]
\end{tikzpicture}
\end{document}
I don't really get the question so I hope this is what you wanted. If you include a full document (such that we copy paste and see the problem on our systems) things are much more easier.
Here, you can change the default setting within a scope but your block
style had a node distance
which was resetting every time it is issued. I've made it 2mm such that we can see the difference easier.
\documentclass[tikz]{standalone}
\usetikzlibrary{arrows,shapes.geometric,positioning}
\begin{document}
\begin{tikzpicture}[decision/.style={diamond, draw, text width=4.5em, text badly centered, node distance=3.5cm, inner sep=0pt},
block/.style ={rectangle, draw, text width=6em, text centered, rounded corners, minimum height=4em, minimum height=2em},
cloud/.style ={draw, ellipse, minimum height=2em},
line/.style ={draw,-latex'},
node distance = 1cm,
auto]
\node [block] (1st) {1st};
\node [block, right= of 1st] (2nd1) {2nd1};
\begin{scope}[node distance=2mm and 10mm]%Here we change it for everything inside this scope
\node [block, above= of 2nd1] (2nd2) {2nd2};
\node [block, below= of 2nd1] (2nd3) {2nd3};
\node [block, right= of 2nd1] (3rd1) {3rd1};
\node [block, above= of 3rd1] (3rd2) {3rd2};
\node [block, above= of 3rd2] (3rd3) {3rd3};
\end{scope}
\node [block, below= of 3rd1] (3rd4) {3rd4};
\node [block, below= of 3rd4] (3rd5) {3rd5};
\path [line] (1st) -- (2nd1);
\path [line] (2nd1) -- (2nd2);
\path [line] (2nd1) -- (2nd3);
\path [line] (2nd2) -- (3rd3);
\path [line] (2nd1) -- (3rd1);
\path [line] (1st) -- (2nd1);
\end{tikzpicture}
\end{document}
Best Answer
A blank line is mark-up for a paragraph break. As you probably know, it is the standard, recommended way to indicate that a new paragraph is required in text. It is no different here.
Moreover,
\[...\]
puts the contents in display maths mode, which will centre the contents with vertical space above and below.You don't need to put a
tikzpicture
in maths mode and it is probably a bad idea. So just don't use\[...\]
and remove the blank lines.\tikzstyle{}
is deprecated and, in your examples, is simply repeating settings you've already configured anyway.To keep formatting of the 'heap's consistent, consider using a TikZ style, set here using
\tikzset
and namedheap
: