# Equivalent of CSS “float:left;” for images

What I am try here is have the image on the left side and it should be surrounded by text on the right and bottom side.

For example how can below image_3.png float to left?

\usepackage{lipsum}
\begin{document}

\includegraphics[scale=0.5]{./images/image_3.png}
\lipsum[1]

\end{document}

-
Depending on your distribution, you can either look at the wrapfig package or the picins package. –  Werner Oct 20 '11 at 19:20
If you want to use URLs in your text, use the url package to provide you with a consistent format: \url{http://ftp.dante.de/tex-archive/help/Catalogue/entries/pgf.html} –  Werner Oct 20 '11 at 19:35
@Werner thanks! oh, the url screw up is totally was my fault. I just put a text there to illustrate the point. –  tugberk Oct 20 '11 at 19:42

As Werner mentions you can use the wrapfig package:

\documentclass{article}
\usepackage[demo]{graphicx}% Don't use [demo] option in your real example
\usepackage{wrapfig}
\usepackage{lipsum}% for dummy text

\begin{document}
\begin{wrapfigure}{l}{0.5\textwidth}\centering
\includegraphics[scale=0.5]{./images/image_3.png}
\caption{Image3.png}
\end{wrapfigure}
\lipsum[1]
\end{document}

-
thanks! one problem I am having is to setting the right and bottom margins. I can control bottom margin with \vspace but how I can control the right one or left? –  tugberk Oct 20 '11 at 19:41
Does adjust the width {0.6\textwidth} not do what you want? –  Peter Grill Oct 20 '11 at 19:53

You can insert the image using wrapfig, and adjust the left and right margins through modification of \leftskip and \rightskip.

\documentclass{article}
%\usepackage{graphicx}% http://ctan.org/pkg/graphicx
\usepackage[showframe]{geometry}% http://ctan.org/pkg/geometry
\usepackage{wrapfig}% http://ctan.org/pkg/wrapfig
\usepackage{url}% http://ctan.org/pkg/url
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\begin{document}

\lipsum[1]

% \begin{wrapfigure}[<number of narrow lines>]{<placement>}[<overhang>]{<width>} <stuff> \end{wrapfigure}
\begin{wrapfigure}[6]{l}{5em}
\rule{5em}{4\baselineskip}% place your image here using \includegraphics
\end{wrapfigure}
\noindent You can draw graphics directly with TeX commands using the \verb!tikz! package:
\url{http://ftp.dante.de/tex-archive/help/Catalogue/entries/pgf.html} It comes
with very good documentation with many examples.
You can draw graphics directly with TeX commands using the \verb!tikz! package:
\url{http://ftp.dante.de/tex-archive/help/Catalogue/entries/pgf.html} It comes
with very good documentation with many examples.

\lipsum[2]
\end{document}​


If you're after modifying the margins of the actual image that you included, you need to modify the parameters of the wrapfigure environment:

\begin{wrapfigure}[<number of narrow lines>]{<placement>}[<overhang>]{<width>}
<stuff>
\end{wrapfigure}


Increasing <number of narrow lines> will push the bottom further down, while increasing <width> will push the right margin further in.

For completeness, I've included lipsum for dummy text as well as url since you had an URL in your MWE. geometry (with the package option showframe) was also included to show the margin adjustment with respect to the other document elements.

-