GeneralMy figures are always going to last page

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
HypnosiS
Posts: 20
Joined: Sun Sep 21, 2008 2:58 pm

My figures are always going to last page

Post by HypnosiS »

Hello,

I am using *.png figures in my document. Most of the time even if I use [ht!] my figures are always going to the last page of the document. Then I solved this problem with \usepackage{float} and typing [H].

Now,

I have two big figures and I wanted to rotate them by \usepackage{rotating}. Now pictures are rotating and captions are also rotating. However, now [H] parameter doesnt work and again these 2 pictures are going to back even if I use [ht!].

Can anyone solve my problem? Why my figures always want to go back?

Code: Select all

\begin{sidewaysfigure}[ht!]
  \centering
    \includegraphics[width=0.95\textwidth]{matrix}
    \caption{Full correlation matrix for 2 countries}
    \label{correlation}
\end{sidewaysfigure}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

My figures are always going to last page

Post by Stefan Kottwitz »

Hi,

you could force the output of your figures a some place by inserting \clearpage or \cleardoublepage.

Stefan
LaTeX.org admin
HypnosiS
Posts: 20
Joined: Sun Sep 21, 2008 2:58 pm

My figures are always going to last page

Post by HypnosiS »

Hi,

Thank you very much. I used \clearpage but it didnt work. Then I searched from google and a guy said (http://people.cs.uu.nl/piet/floats/node1.html) I need to use afterpage package with \clearpage. When I used it, my big pictures are replaced to where I want.

Code: Select all

\usepackage{afterpage}
...
\afterpage{\clearpage}
\begin{sidewaysfigure}[h!]
  \centering
    \includegraphics[width=0.95\textwidth]{matrix}
    \caption{Full correlation matrix for 2 countries}
    \label{correlation}
\end{sidewaysfigure}
Also I did this one:

Code: Select all

\begin{document}
\include{intro}
\include{ch2}
\include{ch3}
\include{ch4}
\end{document}
In that case, figures are not going back but going at the end of each chapter. I wrote here since some people might read and find useful.
fatra2
Posts: 126
Joined: Fri May 01, 2009 1:43 pm

Re: My figures are always going to last page

Post by fatra2 »

Hi there,

From what I get, by rotating your big picture LaTeX does not find any way to include the graphics inside your text. Instead of \clearpage, have you tried something like: \newpage or \pagebreak before and after your graphics.

It might be that you need to give LaTeX the chance and the space to include your graphics in your text. Therefore, even [H] or [!h] want do the trick, mainly because it only strongly encourages to put the figure there.

Cheers
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Re: My figures are always going to last page

Post by sommerfee »

A sidewaysfigure or sidewaystable always uses a whole page, so options like !ht are rarely useful but often destructive here. Without optional argument it will usually be placed on the very next page.
HypnosiS
Posts: 20
Joined: Sun Sep 21, 2008 2:58 pm

My figures are always going to last page

Post by HypnosiS »

Hi fatra, it didnt help to solve the problem. Again big pistures are going to back.
sommerfee wrote:A sidewaysfigure or sidewaystable always uses a whole page, so options like !ht are rarely useful but often destructive here. Without optional argument it will usually be placed on the very next page.
Hi sommerfee,
This is cool. Without any parameters, I again get the same solution. Thank you very much. Sometimes thinking simple is more helpful. Im astonished, why didnt I try that :mrgreen:
Post Reply