Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to put a figure on the top of a page on its own in latex?

Tags:

layout

latex

One of the figures appear in the middle of a page (on its own) when the figure does not fit the other text. How to show it on top of the new page?

like image 211
never shown Avatar asked Jan 05 '10 22:01

never shown


People also ask

How do I keep a figure on top of a page in LaTeX?

In general text you can force a LaTeX image to stay where it is placed in the code using the [! h] command in the figure environment. A slight modification of this which allows the image to move to the top of the next page if there is an overhang is the [! ht] command.

How do I put an image on top of LaTeX?

Including images in your LaTeX document requires adding: \usepackage{graphicx} to the beginning/preamble of your document. \includegraphics{ } command tells LaTeX to insert the image. To upload an image, click the upload button, and upload your image file.

How do I change the position of a figure in LaTeX?

The short answer: use the “float” package and then the [H] option for your figure. The longer answer: The default behaviour of figures is to float, so that LaTeX can find the best way to arrange them in your document and make it look better. If you have a look, this is how books are often typeset.

How do you keep a figure from floating in LaTeX?

If you really don't want LaTeX to move your float at all, then use the float package with the command \restylefloat{figure} in the preamble. This allows you to specify [H] as the position parameter which means “Here and only Here”.


2 Answers

If all else fails, just add \vspace*{3in} to the bottom of your figure below the \caption. Then by trial and error change the 3in dimension until you get the look you want. This is of course pure brute force, but sometimes that's a lot easier than trying to get LaTeX to do things the "right" way.

When in doubt, use brute force.

--- Ken Thompson

like image 56
Norman Ramsey Avatar answered Oct 12 '22 23:10

Norman Ramsey


I think I misunderstood your question. Are you asking "how do I get floats on pages by themselves to be at the top of the page, rather than vertically centred?"?.

If so, here's how to customise the float page. From source2e, glue is inserted at the top and bottom of the page, and between each float on the page. This inserted glue is given by the following parameters:

\setlength\@fptop{0\p@ \@plus 1fil} 
\setlength\@fpsep{8\p@ \@plus 2fil} 
\setlength\@fpbot{0\p@ \@plus 1fil}

Simply redefine these to get the output you like. For example, for top- and bottom- aligned floats: (untested)

\makeatletter
\setlength\@fptop{0pt} 
\setlength\@fpsep{8pt plus 1fil} 
\setlength\@fpbot{0pt}
\makeatother
like image 44
Will Robertson Avatar answered Oct 13 '22 01:10

Will Robertson