tags:

views:

593

answers:

3

What is the correct way to cause a \tikzpicture to be centered, using LaTeX? By default it appears to be aligned with the left margin.

+1  A: 

\hbox to \hsize{\hfil{Anything}\hfil}

Alexey Malistov
+4  A: 
\begin{figure}[!h]
\centering
\tikz
\end{figure}
Mica
This seems to work well, thanks!
Jacob Gabrielson
+1  A: 

When the picture doesn't need to be put in a figure (i.e. when it doesn't need a caption), I use

\begin{center}
 \begin{tikzpicture}
  ....
 \end{tikzpicture}
\end{center}
David Zaslavsky