2

I have this figure:

\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{fit,arrows,calc,positioning}

\begin{document}
\tikzstyle{b} = [rectangle, draw, fill=white, node distance=1cm, text width=6em, text centered, rounded corners, minimum height=4em, thick]
\tikzstyle{l} = [draw, -latex',thick]

\begin{tikzpicture}[auto]
    \node [b] (box1) {box1};
    \node [b, right=of box1] (box2) {box2};
    \path [l] (box1) -- (box2);

\end{tikzpicture}
\end{document}

Why is there more margin on the left compared to the right?

1 Answers1

5

It's the style declarations and the empty line that is counted as whitespace.

Remove the blank line and put the styles in the TikZ environment and it will be OK again.

And please have a look at Should \tikzset or \tikzstyle be used to define TikZ styles?

The easiest is to use a simple

\tikzset{
    b/.style={rectangle, draw, fill=white, node distance=1cm, text width=6em, text centered, rounded corners, minimum height=4em, thick},
    l/.style={draw, -latex',thick}
}

in the preamble and it would be valid everywhere afterwards.

percusse
  • 157,807