# how to force the image to be placed inline [duplicate]

despit i specified that the image must be place inline "among the text" using [h] command, at run time, the image is place at the end of the section how to set it right?

latex:

\subsection{item1 Vs item2}
in this comparison......
......
......
......
\begin{figure}[h]
\centering
\includegraphics[width=100mm,scale=0.7]{osm_vs_wikipedia_2}
\caption{caption}
\end{figure}

the rest of the text goes here..
...

• Did you look at the links I posted in comments to your other question? – Torbjørn T. Dec 29 '15 at 13:21
• @TorbjørnT. yes i did, that#s why i used [h]..but [H] generates an error – Elpharaoh Dec 29 '15 at 13:26
• Yes, as mentioned in all the links I posted, you need \usepackage{float} to use H. – Torbjørn T. Dec 29 '15 at 13:29
• If you have the time, read How to influence the position of float environments like figure and table in LaTeX?, and you'll see that h does not mean here, definitely. H on the other hand, disables floating. – Torbjørn T. Dec 29 '15 at 13:32
• Did it work with \usepackage{float}? – Torbjørn T. Dec 29 '15 at 14:57

Not mentioned in the above-mentioned link: a plain TeX macro package, insbox.tex, which defines an \InsertBoxC command. This command is to be used inside a paragraph, lets the current line terminate, then inserts its argument, andafterwards continues the text of the paragraph.

Demo:

\documentclass[11pt]{article}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{xcolor}
\usepackage{cleveref, todonotes}
\input{insbox}

\begin{document}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec varius dapibus metus eget ultrices. Nulla sagittis mauris rutrum, blandit augue eget, laoreet augue. Phasellus enim odio, sagittis in mi sed, fringilla mollis odio. Phasellus quis purus ultricies, tempor purus at, tempus quam. Donec ultricies, ligula ac pretium porttitor, nibh nunc \todo[color=white, linecolor=red]{\color{red}Insertion point}%
%%%