[Tex/LaTex] Draw multiple tikz pictures in line

tikz-pgf

I want to draw a few pictures in line using tikz. I added a few pictures for your understanding. The first pictures is fine, but in the second is some kind of line break which I don't want.

1

2

The code I'm using is:

\documentclass{article}
\usepackage{tikz}
\usepackage[active,tightpage]{preview}
\setlength\PreviewBorder{5pt}

\begin{document}
  \begin{preview}

    \begin{tikzpicture}[font=\sffamily]
      % draw 1
    \end{tikzpicture}
    \hspace*{10pt}
    \begin{tikzpicture}[font=\sffamily]
      % draw 2
    \end{tikzpicture}
    \hspace*{10pt}
    \begin{tikzpicture}[font=\sffamily]
      % draw 3
    \end{tikzpicture}
  \end{preview}

\end{document}

Do you have any ideas how to draw these pictures in line?

Best Answer

TeX will treat "end-of-line" as additional white spaceā€”and these white spaces allow line breaks.

Does it help to add % after \end{tikzpicture} and after \hspace*{10pt}? This should disable the white space caused by end-of-line tokens.