LaTeX forum ⇒ Graphics, Figures & Tablesfigure placement

Information and discussion about graphics, figures & tables in LaTeX documents.
pemfir
Posts: 23
Joined: Sun Aug 12, 2012 11:30 pm

figure placement

Postby pemfir » Sat Jun 08, 2013 3:34 pm

Hello,
I have 2 figures in a paper. The figures are in the latest part of the paper and Latex places them after the conclusion section (between conclusion and references). I have tried many options to push the figures back into the main document because it can't just sit after the conclusion section.
i have tried things like
  1. \begin{figure}[h]
  2. \begin{figure}[h!]
  3. \begin{figure}[ht]
  4. ...



I do not know what to do
Last edited by cgnieder on Sat Jun 08, 2013 3:37 pm, edited 1 time in total.
Reason: added code markup

Tags:

User avatar
Johannes_B
Site Moderator
Posts: 4140
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Sat Jun 08, 2013 3:37 pm

Hi, i guess a \clearpage right before your conclusion sould help, but right now i do not have enough information. But a minimal working example would help us. Have you ever heard of it? Click the link and take a look.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

magical marshmallow
Posts: 30
Joined: Mon Jan 21, 2013 11:37 am

Postby magical marshmallow » Thu Apr 03, 2014 1:03 pm

Hey,

I have a chapter of my thesis and I want to put the conclusion on a new page at the end, but I can't seem to sort this out. The very last thing prior to this is an image.
I've tried numerous things - \newpage& \pagebreak have no effect.
I tried \clearpage. This generates a new page, but the figure is then vertically centered in the page which looks awful.

I have also tried \afterpage{\clearpage} which hasn't done the trick either. Does anyone have any advice

  1. \documentclass{scrreprt}
  2. \usepackage{graphicx}
  3. \usepackage{afterpage}
  4. \begin{document}
  5. \section{1}
  6. Some general text
  7. \begin{figure}[htbp]
  8. \includegraphics[width=\linewidth]{Image.png}
  9. \end{figure}\\
  10.  
  11. \clearpage
  12. \section{Conclusion}

User avatar
Johannes_B
Site Moderator
Posts: 4140
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Thu Apr 03, 2014 3:36 pm

scrreprt is a class supporting chapters, each chapter issues a \cleardoublepage and starts a new page.

I guess your image is put on its own float page by LaTeX. Boxes (figures and tables) are usually centered vertically on float pages, but you can change this.

  1. \documentclass{scrreprt}%scrrprt does have chapters,
  2. \usepackage[demo]{graphicx}
  3. \usepackage{showframe}
  4. \usepackage{blindtext}
  5. \makeatletter
  6. \setlength{\@fptop}{0pt}
  7. \makeatother
  8. \begin{document}
  9. \section{1}
  10. \blindtext
  11.  
  12. \begin{figure}[p]
  13. \includegraphics[height=5cm,width=\linewidth]{Image.png}
  14. \caption{a nice little caption}
  15. \end{figure}
  16.  
  17. \clearpage
  18. \section{Conclusion}
  19. \end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

hugovdberg
Posts: 133
Joined: Sat Feb 25, 2012 6:12 pm

Postby hugovdberg » Thu Apr 03, 2014 5:50 pm

This might very well be caused by the placement specification [h!] with the first figure. Since latex tries to place the figures in the order in which you specify it will keep all floats in memory until it can place the first of it. Apparently the first figure can't be placed immediately, and you don't allow it anywhere else so all figures are gobbled up. That is, until the end of the chapter (or in this case document since you don't use chapters), where it will dump all floats in memory.

Therefore you should NEVER only specify [h!] as the only option, always at least specify one other, for example [htb] if you don't want the float to use an entire page of its own, or [htbp] if it may be placed anywhere.

If you don't want a figure to float, don't use a floating environment, but use \includegraphics directly and specify a caption with the \captionof command from the caption package.

EDIT: If floats are necessary and they still float past the conclusion because it's a section and not a chapter you could try \FloatBarrier from the package placeins.
Ubuntu 13.10 + Tex Live 2013 + Texmaker / Windows 7 Pro + MikTex 2.9 + TexnicCenter / Android 4.3 + TexPortal + DroidEdit

magical marshmallow
Posts: 30
Joined: Mon Jan 21, 2013 11:37 am

Postby magical marshmallow » Fri Apr 04, 2014 1:10 am

Cheers for the quick response guys.
No [!h] instances going on. Had to check though.

Johannes, that sorted it right out, Thank you!


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 3 guests