开发者

Consecutive Tables in LaTeX

I wonder how to place several tables consecutively in LaTeX?

The page with the text right before the first table has a little space but not enough for the first table, so the first table is to be placed on the top of the next page, although I use \begin{table}[!h] for it.

The second table does not fit into the place in the rest of the page of the first table, so I think I might use longtable for it to span the rest of the page and the top of the next page. Similarly, I use longtable for the third table.

The LaTeX code is as follows:

... % some text  

\begin{table}[!h]  
\caption{Table 1. \label{tab:1}}  
\begin{center}  
\begin{tabular}{c c}  
...  
\end{tabular}  
\end{center}  
\end{table}     

\begin{center}  
\begin{longtable}{ c c }  
\caption{Ta开发者_如何学编程ble 2. \label{tab:2}}\\   
...  
\end{longtable}  
\end{center}  

\begin{center}  
\begin{longtable}{ c c }  
\caption{Table 3. \label{tab:3}}\\   
...  
\end{longtable}  
\end{center}  

... % some text

In the compiled pdf file it turns out that the order of the tables is messed up. The first table is placed behind the second and third one, and the second one spans the page with text before the tables and the next page with the third one following it.

I would like to know how I can make the three tables appear consecutively in order, and there are no space left blank between them and between the text and the tables?

Or if what I hope is not possible, what is the best strategy then?


EDIT:

Removing [!h] does not make improvement, the first table is still behind the second and the third.


EDIT:

As suggested by one of the following replies, using [H] works for me. Out of curiosity, what is the difference between the effects of [H] and [!h]?


Try to remove [!h]

The thing is that \begin{table} ... \end{table} defines a floating insertion. This insertion appears on one of the following pages. \begin{longtable} defines non-floating table. Longtable appears immediately.

You should to remove \begin{table} ... \end{table} to make first table appears immediatly. [!h] does not make table to be non-floation.


I forget if it's the array or float package that gives you [H], but this has always worked for me:

\begin{table}[H]
...
\end{table}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜