Graphics, Figures & TablesProblem with Figure Location

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
elingeniero
Posts: 12
Joined: Mon Feb 13, 2012 12:30 pm

Problem with Figure Location

Post by elingeniero »

I have the exact same problem. I'm new to LaTeX and to this forum, I understand why this problem happens but I want to the best way of creating space between my figures and the next section, I tried \newpage many times but it didn't work:

Here's my code:

Code: Select all

\documentclass[12pt]{article}
\usepackage{syntonly}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage{amsmath}

%\syntaxonly
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}

\begin{document}

\input{./title.tex}
\newpage
\vspace*{\fill}
\tableofcontents
\vspace*{\fill}
\newpage
\section{Abstract}

\ldots

\section{Introduction}
\ldots
\section{Mythodology}

\ldots

\section{Results}
\input{./results.tex}
\newpage
\newpage
\newpage
\newpage
\newpage
\
\section{Discussion}

\ldots

\section{Conclusion}
\ldots
\section{Appendix}
\end{document}
my figures are in results.tex:

Code: Select all

\renewcommand{\thefigure}{1.\arabic{figure}}
\addtocounter{figure}{0}
\begin{figure}[h!tb]
\centerline{\includegraphics[width=1\textwidth,viewport=0 0 580 480,clip]{pipet1}}
\caption{Pressure distribution at low Reynolds number}
\label{re1}
\end{figure}
\begin{figure}[h!tb]
\centerline{\includegraphics[width=1\textwidth,viewport=0 0 580 480,clip]{pipet2}}
\caption{Pressure distribution at intermedediete Reynolds number}
\label{re2}
\end{figure}
\begin{figure}[h!tb]
\centerline{\includegraphics[width=1\textwidth,viewport=0 0 580 480,clip]{pipet3}}
\caption{Pressure distribution at high Reynolds number}
\label{re2}
\end{figure}
the first and second figure are fine, they come before the Discussion section but the third one is placed in the last page!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Stefan Kottwitz
Site Admin
Posts: 10350
Joined: Mon Mar 10, 2008 9:44 pm

Problem with Figure Location

Post by Stefan Kottwitz »

Hi elingeniero,

welcome to the board!

It would be fine if you would open a new topic for your own question. I think we will split the topic later.

You don't need so many \newpage. Use \clearpage if you want, since this command forces the output of figures and floats in general, respectively. However, restricting figures and tables (floats) to sections could easily be achieved using the placeins package:

Code: Select all

\usepackage[section]{placeins}
Stefan
LaTeX.org admin
elingeniero
Posts: 12
Joined: Mon Feb 13, 2012 12:30 pm

Re: Problem with Figure Location

Post by elingeniero »

Thanks, this worked great. And sorry for not starting a new topic, I wanted to leave this for my next questions (when I finish typing the report) :D
Post Reply