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 have a huge table that needs to be in the paper and I want to fit it at the top of a page. How can I align in such a way, at the top of the page?

share|improve this question
1  
Have you tried using \begin{table*}[h]...\end{table*} ? –  Mario S. E. Oct 5 '13 at 15:32
    
what is * meaning ? –  Erogol Oct 5 '13 at 15:34
2  
In a two-column document, table* and figure* environments take up the width of two columns, whereas their unstarred siblings take up just one column. Starred floats must be placed at the top of a page -- but that's what you want anyway, right? –  Mico Oct 5 '13 at 15:48
    
yes it solves my problem thank you :) –  Erogol Oct 5 '13 at 15:50
    
By the way this solution puts the table to end of the document. Is there any additional setting to put it where it is defined –  Erogol Oct 5 '13 at 16:54
show 3 more comments

1 Answer 1

To summarize the series of comments: In a two-column document, one can typeset a "wide float" -- i.e., one that's as wide as two columns -- using the table* and figure* environments. (In a two-column document, the table and figure environments occupy the width of a single column.) The only real restriction is that double-wide floats must be placed at the top of a page; however, this wouldn't appear to a constraint in your case, right? A side effect of this restriction is that the h and b location specifiers have no effect, and shouldn't be used, when setting up double-wide floats.

The fraction of a two-column page that may be occupied by a (double-wide) float is limited by the LaTeX parameter \dbltopfraction. In most document classes I'm familiar with, the default value of this parameter is 0.7, i.e., the height of a table* or figure* environment must not exceed 0.7\textheight. If the height of your table* environment does exceeed this threshold, you need to take one of the following actions to prevent it from "floating" all the way to the back of the document:

  • use the [tp] location specifier to instruct LaTeX that it's permissible to try and place the bulky float on a page by itself (as well as at the top of a page);

  • use the [t!] location specifier to override the effect of \dbltopfraction for this particular float; or

  • increase the value of \dbltopfraction to a suitably large number (say, 0.9) via a \renewcommand directive: \renewcommand{\dbltopfraction}{0.9}. This may be your best choice if you have several large double-wide floats that are supposed to be placed on pages with some text still appearing at the bottom.

What if these methods all fail, i.e., what if LaTeX still places that float at the very end of the document? In that case, your float is probably taller than a page, and your first line of action should almost certainly be to find ways to reduce its height. However, if the table* environment is only a tiny amount taller than a page, you can try the following: Load the afterpage package and encase the double-wide float in something like the following code:

\afterpage{%
\clearpage  % flush out any accumulated floats
\begin{table*}[t!]
...
\end{table*}
\clearpage%  % flush out the big float, i.e., force LaTeX to typeset it right here
} % end of afterpage{} group
... remainder of document code

You should only do this as a last-resort, desperate measure...

share|improve this answer
    
I did first two choices but did not work. I don't know about \renewcommand, will search about –  Erogol Oct 5 '13 at 17:30
add 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.