tags:

views:

2709

answers:

5

I have a question on inserting images into a LaTeX document. I try to insert images using the keyboard short cut: Ctrl-Alt-G and I'm able to insert images. But the compiled pdf document shows all the images at the end, whereas I want to interleave images with text. Something like the following-

Text1
Image1
Text2
Image2
Text3
Image3

I try to insert images at right positions i.e. in between text, but on compilation, they all appear at the end. I have tried different options provided on the image insertion UI but same result.

Any idea where I'm going wrong.

cheers

Related:

+2  A: 

Hi, Try downsizing the images. Maybe they are too large and so they are moved to the end of the document..

Hope it helps.

Tom
Indeed, it works. Thanks
Andriyev
+3  A: 

What code did you use for the \figure environment? In most cases the "h" option should at least help a little bit there.

Horst Gutmann
+4  A: 

You'll have to use graphicx package:

\usepackage{graphicx}

and then you just use \includegraphics

\includegraphics{myfig.pdf}
\includegraphics[width=60mm]{myfig.png}
\includegraphics[height=60mm]{myfig.jpg}
\includegraphics[scale=0.75]{myfig.pdf}
\includegraphics[angle=45,width=52mm]{myfig.jpg}
vartec
You definitely want to use some variation of the \begin{figure} environment! I don't think the author has any problem with inserting the figures themselves.
Will Robertson
+2  A: 

This is a FAQ: "Moving tables and figures in LaTeX". Note especially the third dot point, which relaxes some of the restrictions LaTeX uses to position floats.

That's the best answer I can give without seeing an example of how large your floats are and how you're inserting them into the document. Provided that they're reasonably-sized, you should have no problem with

\begin{figure}[htbp]
  \includegraphics{myfig}
  \caption{...}
  \label{fig:myfig}
\end{figure}

And note that if the float is too large to fit then it will move to a subsequent page -- this is the whole idea behind getting LaTeX to help you with the formatting. You certainly don't want to end a page prematurely just because there's a figure coming up next that otherwise doesn't fit.

Will Robertson
+1  A: 

Maybe this can help you in general...I just hate the LaTeX way of making everything too advanced (flexible) at all times. Beside, the source looks really awful. It will not solve you initial problem, but since it will be easier to change size of each image you can at least try...

% Easy image insert
%   use as \img{imagename}{caption}{label}
%   will insert image with with 70% of textwidth
%   change below for other width
\newcommand{\img}[3]{
    \begin{figure}[!ht]
     \centering
      \includegraphics[width=0.7\textwidth]{#1}
     \caption{#2}
     \label{fig:#3}
    \end{figure}
}

\img{myimage}{has this caption}{and_this_label}

the label is automatically prefixed with fig:. Good luck! /C