Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Q] Floating text around a figure.(Urgent)

132 views
Skip to first unread message

olofk

unread,
Jan 24, 1997, 3:00:00 AM1/24/97
to

Sorry, if this is FAQ, but I had no time to dig it up.

I really desperately need to make text to float around a figure
environment in a single column article. I tried "floatfig.sty" (a style
meant for latex209), but it is extremly bad in making the correct
height for the vertical box.

Please respnd by e-mail.


Regards,

Charlie

olof....@fysik.uu.se

Ulf A. Lindgren

unread,
Jan 24, 1997, 3:00:00 AM1/24/97
to olofk

Have you tried the packages picinpar by Friedhelm Sowa and
wrapfig by Donald Arseneau. Both packages are described in
the LaTeX Companion and they can be found at CTAN.

-- =

Ulf A. Lindgren
Departmet of Applied Electronics
Chalmers University of Technology
S-412 96 G=F6teborg, Sweden

email: lind...@ae.chalmers.se
WWW: http://www.ae.chalmers.se/~lindgren/

Piet van Oostrum

unread,
Jan 28, 1997, 3:00:00 AM1/28/97
to

>>>>> "Ulf A. Lindgren" <lind...@ae.chalmers.se> (UAL) writes:

UAL> Have you tried the packages picinpar by Friedhelm Sowa and
UAL> wrapfig by Donald Arseneau. Both packages are described in
UAL> the LaTeX Companion and they can be found at CTAN.

Yes, but picinpar shouldn't be used. It is dangerous and can really ruin
your document.

Subject: Re: flowing text around figures in LateX
Reply-To: pi...@cs.ruu.nl (Piet van Oostrum)
Organization: Dept of Computer Science, Utrecht University, The Netherlands
Keywords: latex paragraph picture figure flow

There are a couple of style files that purport to do this. But they all
have their limitations because the TeX machine isn't really designed to
solve this.

flow.sty, floatfig.sty, floatflt.dtx, figures.sty, picinpar.sty, picins.sty
(from a package picins.zip), window.sty, wrapfig.sty

Here is a brief impression (from the source code, and some experiments):

figures.sty:

\rightfig{width}{height}{caption indication}{caption}
... paragraph text ...
similar \leftfig

You must specify the width and height of your picture yourself. No
possibility to include it in table of figures/tables without additional
effort.
NOTE: I can't find this anymore on CTAN.

picinpar.sty:

\begin{window}[#lines before, l|r|c, picture contents, caption}
... paragraph text ...
\end{window}

Gives the possibility to specify that the paragraph must have advanced
a number of lines before the picture begins. Width and height will be
deduced from the contents. The picture may span several paragraphs. The
picture can be positioned left, right or in the center of the page.

Does not work with the amstex.sty option.

\begin{figwindow}
\begin{tabwindow} the same with inclusion in the table of figures or
tables resp..

NOTE: I have studied the code of this package extensively and it is
badly programmed. There is a lot of redundant code and worse, it is
buggy. E.g. if you set \box0=\hbox{l}\parskip=\ht0 and you have plain
text in the paragraph around the figure you will loose the text!!!

Moreover if you center the picture and the lines at the left and right
of the picture don't have the standard height (e.g. because you have a
formula like $A^n_i$ in one of the parts) they don't line up properly.

wrapfig.sty:

\begin{wrapfigure}[height of figure in lines]{l|r}[overhang]{width}
{figure, caption etc.}
\end{wrapfigure}
Similar for wraptable.

Height can be ommitted and will be calculated in that case.
The {l|r} parameter can also be specified as i(nside) or o(utside) for
twosided documents, and uppercase can be used to indicate that the
picture should float.
The overhang allows the figure to be moved into the margin.
The fig/table will be counted as figure/table when using the \caption
command.
Does not work in combination with list environments, but can be used in
a parbox or minipage, and in twocolumn format.


flow.sty:

\flow[L|R]{paragraph text}{figure box}

figure must be in a TeX box.
A frame will always be drawn.
No captions.

floatfig.sty:

\begin{floatingfigure}{width of figure}
figure contents
\end{floatingfigure}

Will be counted as figure when a \caption command is given.

floatflt.dtx (actually a LaTeX2e package):

This is an improved version of floatfig for LaTeX2e:
\begin{floatingfigure}[options]{width of figure}
figure contents
\end{floatingfigure}
More or less similar floatingtable.
The tables/figures can be set left/right or alternating on even/odd pages.
Works with the multicol package. Doesn't work well in the neighbourhood
of list environments unless you change your LaTeX document.

window.sty:

\windowbox[toplines][inwindow: contents][ratio: l r]
... paragraph text ... \par

Gives the possibility to place a picture on an arbitrary horizontal
location in a paragraph (e.g. on 2/3 of the width) and after the start
of the paragraph.
No captions or table of figures inclusion.
According to the author there are problems when inserting boxes at the
end of a page or at the beginning of a section. This style is no longer
supported.

picins.sty is part of a large package that allows inclusion of pictures
(e.g. with shadow boxes, various MSDOS formats etc)

\parpic(width,height)(x-off,y-off)[Options][Position]{Picture}
Paragraph text....

All parameters except the Picture are optional. The picture can be
positioned left or right, boxed with a rectangle, oval, shadowbox,
dashed box, a caption can be given which includes it in the List of
figures.

This is the only package that I tried that correctly works inside an
enumerate/itemize item. It does not, however work with
enumerate/itemize besides the picture (i.e. started after the \parpic
command) but neither does any of the other packages as far as I could
discern.

The only disadvantage for some people will be that the documentation is
in German. I have included a summary in English as picins.txt on CTAN.

Overview:

This table gives an overview of the facilities of each package:

A: figure captions/counting/list of figures
B: table captions/counting/list of tables
C: Left/right possible (+ = both)
D: Alternating left/right for twosided docs
E: can be placed in the middle of text with twosided flowing
F: possible to start after the beginning of paragraph
G: can (more or less) float in the text
H: auto detection of size of figure (H=height only)
I: works with list environments
J: works with twocolumn
K: works with multicol

Only entries that I know have been filled in.
A B C D E F G H I J K
figures |-|-|R| | | | |-| | | |
picinipar |+|+|+| |+|+| |+| | | |
wrapfig |+|+|+|+| | |+|H|-|+| |
flow |-|-|+| | | | |+| | | |
floatfig |+|-|-|+| | |+| | |-| |
floatflt |+|+|+|+| | |+| |-| |+|
window |-|-|+| |+|+| |+| | | |
picins |+|-|+|+| | | |+|+| | |

My recommendations are: picins (because it works with list environments)
and floatflt and wrapfig (because they can also do tables)
I would like to receive additions or corrections to the above list.

Last update: Nov. 17, 1995.
Piet van Oostrum <pi...@cs.ruu.nl>


--
Piet van Oostrum <pi...@cs.ruu.nl>
URL: http://www.cs.ruu.nl/~piet [PGP]

Vladimir Alexiev

unread,
Jan 30, 1997, 3:00:00 AM1/30/97
to Piet van Oostrum

Great overview, Piet. One little suggestion: in col C of your sumamry table
(position), add "C" for center (picinpar), and indicate that window.sty can do
any position with a *. Also, I include below my observations on the subject,
but I don't think I have any more info to add to what you've written.

Regards, Vlad

I had a lot of little figures in a paper, so I wanted to put them on the
right margin without any captions, and wrap text around them. I fetched a
number of latex packages and here's a summary of my findings.
Vladimir, 16 Dec 96
floatfig, floatflt
Many limitations listed in the documentation. But just because the other
packages don't list limitations doesn't mean they don't have them! These
two are more or less the same, the latter works in 2e and the former in
2.09.
\begin{floatingfigure}[lrpv]{WIDTH}
\begin{floatingtable}[lrpv]{FIG}
+ can place left/right/odd/even
. does not work very well with multicol
- have to specify width
- may move the pic to another page
- may lose a pic if close to \section
- cannot be at top of page (?)
- problems with footnotes
- problems with itemize/description (use \fltitem instead of \item)
- problems when a floatingfigure and floatingtable are close

picinpar
\begin{figwindow}[AFTER,lrc,{FIG},{CAPTION}]
\begin{tablewindow}[AFTER,lrc,{FIG},{CAPTION}]
+ don't have to specify width
+ can place left/center/right
+ specify AFTER which line of the paragraph to start the fig
. have to specify CAPTION , but it may be empty.
- \end{figwindow} must enclose the involved paragraphs

picins
The most advanced package. Can make various frames around the figures.
Any volunteers to translate the documentation from German to English?
\parpic(WIDTH,HEIGHT)(X-OFFSET,Y-OFFSET)[lr,fdosx][lrtb]{FIG}
+ can place left/right/odd/even
+ can put Frame/Dashed frame/Oval/Shadowbox/3d boX and place the pic
left/right/top/bottom in it
+ make a paragraph of only pics with \hpic
- problems with itemize/description
- can overlap pics if their paragraphs are too close

window
This is the most versatile in terms of placement, however it doesn't do
captions automatically.
\windowbox[toplines: AFTER][inwindow: FIG][ratio: A B]%
+ specify AFTER which line of the paragraph to start the fig
+ places anywhere in the line: [ratio: 0 1] is left, [1 1] center, [1 0] right
+ don't have to specify width
- can't do captions automatically
- assumes that ever pic will finish before the paragraph it's in

wrapfig, wrapfloat
Unpretentious. These two are similar. Use the latter which can wrap
around tables (the only difference seems to be in the caption.
\begin{wrapfigure}{lr}{WIDTH}{FIG}
\begin{wraptable}{lr}{WIDTH}{TABLE}
- have to specify width
+ works well with equations

Donald Arseneau

unread,
Feb 2, 1997, 3:00:00 AM2/2/97
to

In article <omzpxq7...@tees.cs.ualberta.ca>, Vladimir Alexiev <vlad...@cs.ualberta.ca> writes...

> Many limitations listed in the documentation. But just because the other
> packages don't list limitations doesn't mean they don't have them!

True true. I don't know where Piet arrives at his comment that picins
works well with lists. In my trials:

1. For \parpic declared soon before a list, the list overprints the
picture.

2. For \parpic declared inside a list, the list is properly positioned
but text right after the list is improper and overprints the figure.

Wrapfig takes account of lists if they start after a wrapfig, but
due to problem 2, it refuses to begin a wrapfig inside a list.
If I ever make a new edition, I will probably change this, but it
requires more "global" assignments.

Picins is certainly the "most advanced package" for formatting options.

>wrapfig, wrapfloat
> Unpretentious. These two are similar. Use the latter which can wrap
> around tables (the only difference seems to be in the caption.
> \begin{wrapfigure}{lr}{WIDTH}{FIG}
> \begin{wraptable}{lr}{WIDTH}{TABLE}
> - have to specify width
> + works well with equations

I have neaver heard of wrapfloat and it is not on CTAN. Anyway, you
must have an old version of wrapfig as it defines wraptable. You do not
need to specify width, it does floating.

Donald Arseneau as...@reg.triumf.ca

Vladimir Alexiev

unread,
Feb 2, 1997, 3:00:00 AM2/2/97
to as...@triumf.ca

In article <2FEB1997...@erich.triumf.ca> as...@erich.triumf.ca (Donald Arseneau) writes:

> 1. For \parpic declared soon before a list, the list overprints the
> picture.

I can attest to this.


> I have neaver heard of wrapfloat and it is not on CTAN.

% wrapfloat.sty to use "wraptable" as well as "wrapfig"
% which is a modified (T.Iwakuma 3/11/1992) version of WRAPFIG.STY

I may have gotten it from
ftp://ftp.tohoku.ac.jp/pub/TeX/latex-styles/bear_collections/style-files.

> Anyway, you must have an old version of wrapfig as it defines wraptable.

The version I have is % W R A P F I G . S T Y ver 3.1 (Nov 2, 1995)
which is the latest version on the cdrom.com mirror. Indeed, it does
wraptable. Interestingly, the definition of wraptable is the same as in T.I.'s
patch:
\def\wrapfigure{\def\@captype{figure}\@ifnextchar[{\WF@raptfig}{...
% ^^^^^^^^^^^^^^^^^^^^^ added by T.I.
\def\wraptable{\def\@captype{table}\@ifnextchar[{\WF@raptfig}{...
%^^^^^^^^^^^^^^ added by T.I.

> You do not need to specify width,

This is not what the documentation says. #4 is a required parameter.

> it does floating.
I'll add this to my summary.

Regards, Vlad

Donald Arseneau

unread,
Feb 3, 1997, 3:00:00 AM2/3/97
to

In article <omu3nv3...@tees.cs.ualberta.ca>, Vladimir Alexiev <vlad...@cs.ualberta.ca> writes...

>> Anyway, you must have an old version of wrapfig as it defines wraptable.
>The version I have is % W R A P F I G . S T Y ver 3.1 (Nov 2, 1995)
Yep, the most recent version.

>> You do not need to specify width,
>This is not what the documentation says. #4 is a required parameter.

It is a required parameter, but
if you specify a width of *zero* ("0pt"), the actual width of
the figure will determine the wrapping width. Do *not* try to use a
caption in this case, because it will try to have a width of zero.

Donald Arseneau as...@reg.triumf.ca

0 new messages