# How can I center horizontally but not vertically?

This centers both horizontally and vertically, but I do not want vertical centering. I want the grid to be at the top of the page. (The geometry package works well at defining margins though).

\documentclass{article}
\usepackage{tikz}
\usepackage{caption}

\begin{document}
\begin{figure}[ht]
\begin{centering}

\begin{tikzpicture}[scale=(3/10)]

\draw[help lines] (0,0) grid (670mm,700mm);

\end{tikzpicture}

\caption{some caption here}

\end{centering}
\end{figure}
\clearpage
\end{document}


Thanks

-
Do you need it to be floating or should it be in a fixed position in the document? –  Stefan Kottwitz Nov 30 '10 at 22:25
Not sure, but I do need room at bottom for captions. I think fixed is ok cause evry page will be the same , just one picture. –  Douglass Nov 30 '10 at 22:26
In this case a figure environment is not required. figures like here may be vertically centered on float pages. But I edit my answer to be more detailed. –  Stefan Kottwitz Nov 30 '10 at 22:31

One single character would make a difference: try \begin{figure}[ht!] instead. By adding this option the picture would float to the top of the page.

However, because the picture doesn't need to float across page borders and should be just at the top, you don't need a figure environment. Instead, you could use the \captionof command of the caption package, which you're already loading. Here's a small example based on your code:

\documentclass{article}
\usepackage{tikz}
\usepackage{caption}
\begin{document}
\begin{centering}
\begin{tikzpicture}[scale=(3/10)]
\draw[help lines] (0,0) grid (670mm,700mm);
\end{tikzpicture}
\captionof{figure}{some caption here}
\end{centering}
\end{document}

-
OK that worked - thanks Stefan –  Douglass Nov 30 '10 at 22:34