2

I want to display text, image, text, image in this order, but from reasons unknown to me, it disply text, text, image, image. I've tried to make images smaller, but nothing change. Here is a part of my tex: ( here is all on pastebin )

\section { Manual de utlilizare }

\subsubsection{Pagina de pornire}

\begin{figure}
   \centering
       \includegraphics[width=1.00\textwidth]{app/eps/Overview.eps}
   \caption{Pagina de pornire}
   \label{fig:Overview}
\end{figure}


\subsubsection{Incarcarea datelor}

Se incarca fisierul apasand pe butonul "Load file" 

\begin{figure}
   \centering
       \includegraphics[width=0.50\textwidth]{app/eps/fileOpened.eps}
   \caption{Incarcarare fisier}
   \label{fig:fileOpened}
\end{figure}

Se alege fisierul dorit

\begin{figure}
   \centering
       \includegraphics[width=0.60\textwidth]{app/eps/LoadFile.eps}
   \label{fig:LoadFile}
   \caption{Selectarea fisierului}
\end{figure}

What am I doing wrong?

Mensch
  • 65,388

1 Answers1

2

If you want to have control over the placement of the figure floats without the floating behaviour, the use the [H]ERE float specification provided by the float package:

enter image description here

\documentclass{report}

\usepackage{graphicx,float}

\begin{document}

\raggedbottom

\chapter{A chapter}

\section{First section}

\subsubsection{First subsection}

\begin{figure}[H]
  \centering
  \includegraphics[width=\linewidth]{example-image}
  \caption{A figure caption}
\end{figure}

\subsubsection{Second subsection}

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

\begin{figure}[H]
  \centering
  \includegraphics[width=.5\linewidth]{example-image-a}
  \caption{A figure caption}
\end{figure}

Phasellus rhoncus risus eu pretium luctus.

\begin{figure}[H]
  \centering
  \includegraphics[width=.5\linewidth]{example-image-b}
  \caption{A figure caption}
\end{figure}

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.

\begin{figure}[H]
  \centering
  \includegraphics[width=.5\linewidth]{example-image-c}
  \caption{A figure caption}
\end{figure}

Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Proin cursus nibh tellus, nec condimentum sem dignissim et.

\begin{figure}[H]
  \centering
  \includegraphics[width=.5\linewidth]{example-image-a}
  \caption{A figure caption}
\end{figure}

Sed quis tellus non quam accumsan fermentum sit amet mollis turpis.

\begin{figure}[H]
  \centering
  \includegraphics[width=.8\linewidth]{example-image-b}
  \caption{A figure caption}
\end{figure}

Quisque rutrum est lectus, vitae tincidunt elit rhoncus non. Integer nec suscipit urna. In eget orci tellus.

\begin{figure}[H]
  \centering
  \includegraphics[width=.8\linewidth]{example-image-c}
  \caption{A figure caption}
\end{figure}

\subsubsection{First subsection}

Donec vel massa orci. Mauris tellus arcu, porttitor a ligula nec, pellentesque rhoncus felis.

\begin{figure}[H]
  \centering
  \includegraphics[width=\linewidth]{example-image-a}
  \caption{A figure caption}
\end{figure}

Praesent vitae mauris ipsum. Donec odio lectus, fermentum eu tempor vitae, congue ultrices felis. Sed pharetra ultricies tortor non vehicula.

\begin{figure}[H]
  \centering
  \includegraphics[width=\linewidth]{example-image-b}
  \caption{A figure caption}

  \includegraphics[width=\linewidth]{example-image-c}
  \caption{A figure caption}
\end{figure}

Nullam at tortor ut lacus consequat pellentesque. Nulla nisl odio, bibendum non risus id, tempus molestie felis.

\begin{figure}[H]
  \centering
  \includegraphics[width=\linewidth]{example-image-a}
  \caption{A figure caption}
\end{figure}

Pellentesque faucibus dui ut nibh bibendum iaculis. Nam sollicitudin nisi massa. Aliquam ac sem ut nisi egestas luctus. Fusce viverra lacinia dolor vitae ultricies.

\begin{figure}[H]
  \centering
  \includegraphics[width=.7\linewidth]{example-image-b}
  \caption{A figure caption}
\end{figure}

Integer non rhoncus odio. Vivamus tellus erat, maximus a sagittis eget, ultrices id dui.

\begin{figure}[H]
  \centering
  \includegraphics[width=.7\textwidth]{example-image-c}
  \caption{A figure caption}
\end{figure}

\subsubsection {Second subsubsection}

\end{document}

Some things to note:

Another option that requires a little more overhead in terms of changing your code, would be to use the caption package and place the images together with their captions using \captionof{figure}. Using float allows you to retain your current layout with minimal modification.

A generic reference regarding float placement - that you should study - can be found here: How to influence the position of float environments like figure and table in LaTeX?

Werner
  • 603,163
  • That is nice. I use the following to do the same, use [!htbp] and also replace \end{figure} with \end{figure}\FloatBarrier, where FloatBarrier is from the placeins package. I just tried it on your code, and got same output. But your solution of just using [H] is simpler. – Nasser Jun 29 '16 at 02:38
  • @Nasser: Yes. [H] turns a figure into a minipage, so it keeps things from floating and some people happy at the same time. – Werner Jun 29 '16 at 02:45