GeneralProblem with inserting multiple images.

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
jacek
Posts: 1
Joined: Sat Feb 09, 2013 10:36 pm

Problem with inserting multiple images.

Post by jacek »

Hello everybody,

Recently, I started using Latex to create technical documentation. 
I came across a problem which I can not in any way deal with. 
I spent a lot of time searching for a solution but have not found effective.
The document that I am trying to create contain a lot of pictures.
At the time, when I try to insert more than one picture in a row in one section, subsection or paragraph they appear completely not where they should be.
 An attempt to insert pictures to the listends exactly the same.
Only the first image appears, next appear in different positions later in this document. 
Output format is PDF.
I'm using MiKTeX system with Texmaker. 
The header of my document looks like this:

Code: Select all

\documentclass[12pt, a4paper,titlepage] {article}	
\usepackage [english] {babel}
\usepackage[utf8] {inputenc}  
\usepackage{times}
\usepackage{indentfirst}
%\frenchspacing 		
\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage[margin=3cm]{geometry}
\usepackage{titlepic}
\usepackage{lastpage}
\usepackage[bookmarks=true,pdfborder={0 0 0}]{hyperref}
%\usepackage{makeidx}
\usepackage{enumerate}
 I try to insert a photo like this (part of my document):

Code: Select all

\begin{document}

\begin{enumerate}
\item First, you should open a locker, which should be adjusted. Then, using a standard ring wrench 13mm, you should unscrew head nuts from the top 
and bottom of hinges (see photos below).
\begin{figure}[h]
	\begin{center}
		\includegraphics[width=8cm] {images/Figure32.JPG}
		\caption{Readjusting the lockers I.}
		\label{rys:readjust_lockersI}
	\end{center}
\end{figure}

\item Then you should put a standard ring wrench 13mm and thin ring wrench 13mm into top hinge (like on the below photo). Then, using these 
wrenches, you should loosen the top hinge.
\begin{figure}[h]
	\begin{center}
		\includegraphics[width=8cm] {images/Figure33.JPG}
		\caption{Readjusting the lockers II.}
		\label{rys:readjust_lockersII}
	\end{center}
\end{figure}

\item Next, you should put a standard ring wrench 13mm and thin ring wrench 13mm into bottom hinge (like on the below photos). Then, using these 
wrenches, you should loosen the bottom hinge.
\begin{figure}[h]
	\begin{center}
		\includegraphics[width=8cm] {images/Figure34.JPG}
		\caption{Readjusting the lockers III.}
		\label{rys:readjust_lockersIII}
	\end{center}
\end{figure}

\item Next, you should readjust door - raise or leave.
\begin{figure}[h]
	\begin{center}
		\includegraphics[width=8cm] {images/Figure35.JPG}
		\caption{Readjusting the lockers IV.}
		\label{rys:readjust_lockersIV}
	\end{center}
\end{figure}

\item Then, using a ring wrenches, you should tighten the top and the bottom hinges.
\item You should repeat steps b-e until adjustment the door.
\item At the end, you should screw on head nuts (into the top and the bottom hinges).
\end{enumerate}

\end{document}
Images are displayed correctly only if before each of them before I use the command: \newpage
In the picture you can see the resulting effect:
Image

Please, help me :)

Recommended reading 2024:

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

NEW: TikZ book now 40% off at Amazon.com for a short time.

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Problem with inserting multiple images.

Post by cgnieder »

Hi Jacek,

Welcome to the LaTeX community!

This is expected behavior for the {figure} environment which is a floating environment. This means LaTeX looks where the best place for the figure is, depending on some parameters. If you don't want that behaviour the easiest way is not to use the {figure} environment. You can still add captions, e.g. via the \captionof command provided by the caption package.

More on floats and the floating mechansim can be read here - a very comprehensive summary by Frank Mittelbach: How to influence the position of float environments like figure and table in LaTeX?

Regards
site moderator & package author
Post Reply