TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to place an image on my document and have it appear, say, on the right part of the page with text flowing on the left. How can I do that with LaTeX? Just like one would do with HTML and images “floating” to the right (or left).

(when searching I found some similar questions which, however, were closed. I'm actually asking the question because I think it is a good question and should have a good answer on the site. Btw, assume I'm not using beamer nor anything fancy.)

share|improve this question
3  
Full example including minimal Spacing around image for wrapfig. – Yiannis Lazarides May 9 '12 at 19:17
    
possible duplicate of Wrap text around a tabular – David Carlisle May 10 '12 at 19:49
up vote 18 down vote accepted

The wrapfig package is perhaps the best package to provide such functionality. The following is an example of how to use such package

\documentclass{article}
\usepackage{graphicx,wrapfig,lipsum}
%------------------------------------------
\begin{document}
This is where the table goes with text wrapping around it. You may 
embed tabular environment inside wraptable environment and customize as you like.
%------------------------------------------
\begin{wrapfigure}{r}{5.5cm}
\caption{A wrapped figure going nicely inside the text.}\label{wrap-fig:1}
\includegraphics[width=5.5cm]{sample}
\end{wrapfigure} 
%------------------------------------------
{\lipsum[2-3]
\par
Figure~\ref{wrap-fig:1} is a wrapped figure.
%------------------------------------------
\end{document}

Which produces the following output:

enter image description here

share|improve this answer
    
Do you know a way to make wrapfig respect margins, like graphicx does? If I put the image less than its height from the page end, the image trespasses margins and even page dimensions, getting cut out, instead of going in the next page, so I have to adjust it manually. – Jeffrey Lebowski Feb 3 at 15:57
    
@JeffreyLebowski Not sure. Maybe you want to write a small example showing the undesired behaviour and post as a new question! – Juan A. Navarro Feb 4 at 9:04
    
Thanks! I'll do it! – Jeffrey Lebowski Feb 5 at 10:11
    
Done! – Jeffrey Lebowski Feb 5 at 11:17

The wrapfig package is perhaps the package that provides functionality most like a html/css float.

There are 142 posts returned from a search of this site for wrapfig. Yiannis gives one in his comment above, another useful example is

Wrap text around a tabular

share|improve this answer
    
Thanks, could you please provide a simple example of usage? (Just want to make this an excellent answer!) – Juan A. Navarro May 9 '12 at 19:17
    
I wasn't asking for me. I was asking for other people stumbling with this question. – Juan A. Navarro May 9 '12 at 19:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.