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.

I was wondering what is the right way to include a long table in between pages?

I have a table that is an A4 page long, if I use \begin{table}[h] it pushes the table to the very end of the document, and if I use \begin{table}[h!] it forced some extra white space at some paragraphs.

Thanks for the help.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

It is not very clear from your question what you are asking for. From what I gather from your question, you want to put a table in an independent page. The table is a page long. You do not want it on some fixed page, some approximate location will be just fine.

If the above is your scenario, then you need to use [!p] as your position specifier. Here, p means page of float and LaTeX will try to honor the placement with respect to actual place. By putting an ! before p you insist on this placement. This overrides internal parameters LaTeX uses for determining good float positions.

Please try the following code, check the output, and let us know whether it suits your purpose.

\documentclass{article}

\usepackage{lipsum}

\begin{document}

\section{One}

\lipsum[11]

\section{Two}

\lipsum[12]

\begin{table}[!p]
  \centering
  \begin{tabular}[c]{|c|c|p{0.75\textwidth}|l|}
    \hline
    1&1&\raggedright\lipsum[1]&One\\\hline
    2&2&\raggedright\lipsum[2]&Two\\\hline
    3&3&\raggedright\lipsum[3]&Three\\\hline
  \end{tabular}
  \caption{A table one page long}
  \label{tab:long}
\end{table}

\section{Three}

\lipsum[13]

\section{Four}

\lipsum[14]
\lipsum[15]
\lipsum[16]



\end{document}
share|improve this answer
    
Yes, that's exactly what I need. I need it to be as close as possible with the original text where I cited the table. If I use [h] it will go to the very end of the document which is like 10 pages away. –  cherhan Nov 6 '13 at 2:32
    
@cherhan Great. Glad of the of assistance. Now you can accept the answer :-) In most of the cases ! does the trick. I make it a rule to use !tbp for all my float location specifiers. –  MMA Nov 6 '13 at 2:34
    
what if it causes extra whitespace around paragraphs around the float? –  cherhan Nov 6 '13 at 3:00
    
@cherhan Not very clear. Are you talking about the spaces before and after the float? If that this the case this will help. –  MMA Nov 6 '13 at 3:04
    
I will try to create a MWE to show you. Just that some times, for example after section 2 (lipsum[12]) it might show a large white in order to push the table to another page. It's ok if you don't understand :) –  cherhan Nov 6 '13 at 4:41
show 1 more comment

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.