Graphics, Figures & TablesHow to wrap text around irregular shapes?

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
krz
Posts: 63
Joined: Thu Jul 22, 2010 5:03 pm

How to wrap text around irregular shapes?

Post by krz »

Hi!
I want to wrap the text around an image with irregular shape. I use \wrapfigure and I get a box around the image, of course, but I don't want it. I just want to get effect like that
shape-irregular.jpg
shape-irregular.jpg (37.46 KiB) Viewed 4199 times
I found an information it's impossible to get it in LaTeX, but I also found \parshape could resolve the problem. I tried to use for example this

Code: Select all

\parshape=8 0pt\hsize 8pt\hsize 0pt.7\hsize 0pt.5\hsize 0pt.5\hsize 0pt.7\hsize 0pt.5\hsize 0pt\hsize
and the paragraph changes its shape, but I really don't know how to join it with \begin{wrapfigure}.
Do you know? Or maybe there are some different ways to get what I want.
By the way, do you know if it's possible to place an image that I want to be wrapped exactly at the top or bottom of the page? The same like in \begin{figure}[t] for example.
Last edited by krz on Tue Jan 11, 2011 12:59 pm, edited 1 time in total.

Recommended reading 2024:

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

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

frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

How to wrap text around irregular shapes?

Post by frabjous »

I wouldn't know how to do something like that except using absolute positioning, which is bad practice, but perhaps acceptable for your needs. Have you looked at, e.g., the eso-pic package, possibly using textpos as well?
krz
Posts: 63
Joined: Thu Jul 22, 2010 5:03 pm

How to wrap text around irregular shapes?

Post by krz »

Thanks, frabjous! Textpos works quite nice with \parshape. I used this:

Code: Select all

\begin{textblock*}{70mm}(50mm,10mm)
\includegraphics[width=1\textwidth]{photo.jpg}
\end{textblock*}
and this:

Code: Select all

\parshape=20 0pt\hsize 0pt\hsize 0pt\hsize 0pt.6\hsize 0pt.6\hsize 0pt.6\hsize 0pt.6\hsize 0pt.55\hsize 
0pt.45\hsize 0pt.45\hsize 0pt.45\hsize 0pt.5\hsize 0pt.5\hsize 0pt.5\hsize 0pt.45\hsize 0pt.45\hsize
0pt.45\hsize 0pt.45\hsize 0pt.7\hsize 0pt\hsize 
By the way, do you know other ways to wrap text around irregular figures?
And another "by-the-way", why it's a bad idea to use absolute positioning?
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

How to wrap text around irregular shapes?

Post by frabjous »

By the way, do you know other ways to wrap text around irregular figures?
Not offhand, but I haven't researched it. It wouldn't surprise me if you could do it with figures actually drawn by a package like pstricks or pgf/tikz, but otherwise, LaTeX tends to think in terms of "boxes", which doesn't quite lend itself to such a thing.
And another "by-the-way", why it's a bad idea to use absolute positioning?
The main reason is just that it makes it more difficult if you need to make changes or move things around, since you need redo everything else too. If that's not a worry for you, then it's not a problem.
Post Reply