Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Positioning table captions in LaTeX

Tags:

latex

When I try centering my table & getting a caption so that it reads something like "Table 1. This is the caption." the table appears at the top of the page no matter what I do. If I don't do the caption then I can get it in the part of the document that I want. How do I fix this problem?

\begin{table}
    \caption{This is the caption.}
    \begin{center}
        \begin{tabular}{ | l | l | l | l |}
        \hline

        ...

        \hline
        \end{tabular}
    \end{center}
\end{table}
like image 894
rosalia Avatar asked May 19 '10 02:05

rosalia


People also ask

How do I move a table caption in LaTeX?

You can also try \usepackage{float} which gives you the extra positioning command H , which is really forces LaTeX to put the figure right where you specified. If you do use float, make sure to declare your labels after your captions. In terms of making your figures apear "here", H > h! > h .

Do captions go above or below tables?

Figure captions are generally placed below the figures, while table captions must be placed above the tables. This is because we generally read tables from the top down, and therefore want to see the caption at the top. Figures are not always read top down.


2 Answers

Try

\begin{table}[h]
   ...
\end{table}

That tells latex "put the table here" instead of letting it float.

I also use

\usepackage{array}

in the preamble for pretty much all my latex documents, but pr0wl informs us that it is not necessary. Thanks pr0wl!

like image 155
Norman Ramsey Avatar answered Sep 27 '22 21:09

Norman Ramsey


You can also try \usepackage{float} which gives you the extra positioning command H, which is really forces LaTeX to put the figure right where you specified. If you do use float, make sure to declare your labels after your captions.

In terms of making your figures apear "here", H>h!>h. But H! does nothing.

like image 22
Perkee Avatar answered Sep 27 '22 21:09

Perkee