Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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[margin=5pt,nohead]{geometry}
\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

share|improve this question
    
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

1 Answer 1

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[margin=5pt,nohead]{geometry}
\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}
share|improve this answer
    
OK that worked - thanks Stefan –  Douglass Nov 30 '10 at 22:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.