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

Restricting floating wrapfigure in memoir

1,706 views
Skip to first unread message

Victor Ivrii

unread,
Feb 28, 2009, 7:42:30 PM2/28/09
to
How to prevent floating of wrapfigure in memoir class (or may be there
is another way to make text wrapping around figure)?

\FloatBarrier seems to have no effect on wrapfigure

PS I am aware that wrapfigure does not work inside of environments
like {theorem} and I am not putting it there


Thank you in advance


Victor

Lars Madsen

unread,
Mar 1, 2009, 12:19:12 PM3/1/09
to


could you be a bit more specific, as far as I know wrapfigure is not a
float, do \FloatBarrier would not have any effect.

What are you trying to do?

/daleif

Donald Arseneau

unread,
Mar 1, 2009, 5:55:04 PM3/1/09
to
On Feb 28, 4:42 pm, Victor Ivrii <viv...@gmail.com> wrote:
> How to prevent floating of wrapfigure in memoir class

I presume you are specifying a non-floating wrapfigure (lower-case
placement letter). In that case you should see a warning message like
"Stationary wrapfigure forced to float". You shoul check your log
file
for a reason it had to float. This usually happens when another
wrapfigure is still being processed, since the paragraph shape can't
be adjusted for both simultaneously.

To automatically avoid such collisions, put \wrapfill before your
wrapfigure.

Note that bad page breaks do not force a stationary wrapfigure to
float. To avoid bad page breaks you should probably put
\needspace{size} before your wrapfigure.

Donald Arseneau
as...@triumf.ca

Victor Ivrii

unread,
Mar 2, 2009, 3:38:39 PM3/2/09
to
> a...@triumf.ca

From log file:
Package wrapfig Warning: Stationary wrapfigure forced to float on
input line 19
38. However there are no other wrapfigures (but I load subfig and use
it - mention just in case)

\usepackage{wrapfig}

\wrapfill placed inside or outside of wrapfigure results in

! Undefined control sequence.
l.1931 \wrapfill

Victor

PS As I running TL2008 regularly updated I use supposedly the latest
W R A P F I G . S T Y ver 3.6 (Jan 31, 2003)

Robin Fairbairns

unread,
Mar 2, 2009, 5:54:03 PM3/2/09
to
Victor Ivrii <viv...@gmail.com> writes:

>On Mar 1, 5:55=A0pm, Donald Arseneau <a...@triumf.ca> wrote:
>> On Feb 28, 4:42 pm, Victor Ivrii <viv...@gmail.com> wrote:
>> > How to prevent floating of wrapfigure in memoir class
>>
>> I presume you are specifying a non-floating wrapfigure (lower-case
>> placement letter). =A0In that case you should see a warning message like
>> "Stationary wrapfigure forced to float". =A0You shoul check your log
>> file
>> for a reason it had to float. =A0This usually happens when another

>> wrapfigure is still being processed, since the paragraph shape can't
>> be adjusted for both simultaneously.
>>
>> To automatically avoid such collisions, put \wrapfill before your
>> wrapfigure.
>>
>> Note that bad page breaks do not force a stationary wrapfigure to
>> float. =A0To avoid bad page breaks you should probably put

>> \needspace{size} before your wrapfigure.
>
>From log file:
>Package wrapfig Warning: Stationary wrapfigure forced to float on
>input line 19
>38. However there are no other wrapfigures (but I load subfig and use
>it - mention just in case)
>
>\usepackage{wrapfig}
>
>\wrapfill placed inside or outside of wrapfigure results in
>
>! Undefined control sequence.
>l.1931 \wrapfill

yup. wrapfig doesn't define it.

>PS As I running TL2008 regularly updated I use supposedly the latest
>W R A P F I G . S T Y ver 3.6 (Jan 31, 2003)

that's the current version on the archive.
--
Robin Fairbairns, Cambridge

Donald Arseneau

unread,
Mar 3, 2009, 3:59:57 PM3/3/09
to
On Mar 2, 2:54 pm, r...@cl.cam.ac.uk (Robin Fairbairns) wrote:
> Victor Ivrii <viv...@gmail.com> writes:
>
>
>
> >On Mar 1, 5:55=A0pm, Donald Arseneau <a...@triumf.ca> wrote:
> >> On Feb 28, 4:42 pm, Victor Ivrii <viv...@gmail.com> wrote:
> >> > How to prevent floating of wrapfigure in memoir class
>
> >> I presume you are specifying a non-floating wrapfigure (lower-case
> >> placement letter). In that case you should see a warning message like
> >> "Stationary wrapfigure forced to float". You shoul check your log
> >> file for a reason it had to float. This usually happens when another

> >> wrapfigure is still being processed, since the paragraph shape can't
> >> be adjusted for both simultaneously.
>
> >> To automatically avoid such collisions, put \wrapfill before your
> >> wrapfigure.
>
> >> Note that bad page breaks do not force a stationary wrapfigure to
> >> float. To avoid bad page breaks you should probably put

> >> \needspace{size} before your wrapfigure.
>
> >From log file:
> >Package wrapfig Warning: Stationary wrapfigure forced to float on
> >input line 1938.
> >However there are no other wrapfigures (but I load subfig and use
> >it - mention just in case)
>
> >\usepackage{wrapfig}
>
> >\wrapfill placed inside or outside of wrapfigure results in
>
> >! Undefined control sequence.
> >l.1931 \wrapfill
>
> yup. wrapfig doesn't define it.
>
> >PS As I running TL2008 regularly updated I use supposedly the latest
> >W R A P F I G . S T Y ver 3.6 (Jan 31, 2003)
>
> that's the current version on the archive.

Oh dear, I do seem to leave things unfinished.

I have
W R A P F I G . S T Y ver 3.7 (March 19, 2004).
I wonder where I got it :-)

There might be a temporary redefinition of \par or something like
that which is interfering at the placement point. I'd probably have
to look at a sample document with tracing to be sure.

Donald Arseneau

gfpe...@gmail.com

unread,
Jan 21, 2016, 4:10:27 PM1/21/16
to
Hello,
This is a very old post but it seems that the problem is not solved.
I am using wrapfig within eqexam. It worked fine until I did the OS upgrade
on the Mac (El Capitan). Now the figures are floating around and I have many error messages:
Package wrapfig Warning: Stationary wrapfigure forced to float on input line 48
9.

Thanks,
Gilles

PS: Is version 3.6 still the current version of wrapfig.sty? Never found v. 3.4.

Donald Arseneau

unread,
Jan 26, 2016, 11:59:21 PM1/26/16
to
> Hello,
> This is a very old post but it seems that the problem is not solved.
> I am using wrapfig within eqexam. It worked fine until I did the OS upgrade
> on the Mac (El Capitan). Now the figures are floating around and I have many error messages:
> Package wrapfig Warning: Stationary wrapfigure forced to float on input line 48
> 9.
>
> Thanks,
> Gilles
>
> PS: Is version 3.6 still the current version of wrapfig.sty? Never found v. 3.4.

Is there any chance you know what changed in the update?

I'm not sure your problem matches the original problem (for which I "presumed" details)
or that \wrapfill is the solution to either. I proposed a \wrapfill in a usenet post
specifically to fill with white space and then do \WFclear.


https://groups.google.com/forum/?hl=en#!search/group$3Acomp.text.tex$20\wrapfill/comp.text.tex/WA5NoRB-XWw/-35VC8FQsrMJ

\makeatletter
\def\wrapfill{\par
\ifx\parshape\WF@fudgeparshape
\nobreak
\ifnum\c@WF@wrappedlines>\@ne
\advance\c@WF@wrappedlines\m@ne
\vskip\c@WF@wrappedlines\baselineskip
\global\c@WF@wrappedlines\z@
\fi
\allowbreak
\WF@finale
\fi
}
\makeatother

(It should have been named \WFfill for consistency.)

Maybe \WFclear by itself suits your needs. There is no released version of wrapfig
higher than 3.6, but I have disfunctional later versions that I was working on.


--
Donald Arseneau as...@triumf.ca

igo...@gmail.com

unread,
Jul 18, 2018, 9:55:23 PM7/18/18
to
On Monday, March 2, 2009 at 1:55:04 AM UTC+3, Donald Arseneau wrote:

> I presume you are specifying a non-floating wrapfigure (lower-case
> placement letter).

I think I've got an example, where upper-case placement letter
results in a somewhat unexpected behavior. The image, inserted with
the use of `wrapfigure` jumps to the very end of the document, when
one more paragraph is added:

================================================
\documentclass[a5paper,12pt]{memoir}
\usepackage{graphicx, wrapfig, lipsum}

\begin{document}
\section{First section}
% \lipsum[1] % uncommenting this make image jump to after section 2
\begin{wrapfigure}{R}{0.4\linewidth}
\centering
\includegraphics[width=1\linewidth]{example-image-a}%
\caption{ This is example image A }
\end{wrapfigure}
\lipsum[1]

\section{Second section}
\lipsum[2]
\end{document}
================================================

Same example, live:
https://www.overleaf.com/read/ncvtmqxgxfvr .

Same example, screenshots:
https://imgur.com/a/WvGW5qB - works OK here
https://imgur.com/a/j5o92Dk - doesn't work well here

When I work with floats, I usually add `FloatBarrier` inside each `section` command ( https://tex.stackexchange.com/a/235312/143086 ). AFAIU, it's not possible to make `wrapfig` behave like that, right?

igo...@gmail.com

unread,
Jul 18, 2018, 11:31:39 PM7/18/18
to
On Thursday, July 19, 2018 at 4:55:23 AM UTC+3, igo...@gmail.com wrote:
> AFAIU, it's not possible to make `wrapfig` behave like that, right?

I was wrong, sorry.
The `\WFclear` fits the purpose.

================================================
\documentclass[a5paper,12pt]{memoir}
\usepackage{graphicx, wrapfig, lipsum}

\begin{document}
\section{First section}

\lipsum[1]

\begin{wrapfigure}{R}{0.4\linewidth}
\centering
\includegraphics[width=1\linewidth]{example-image-a}%
\caption{ This is example image A }
\end{wrapfigure}
\lipsum[2]
% \lipsum[3] % if uncommented, the image would be next-to-this paragraph
\WFclear

\section{Second section}
\lipsum[2]
\end{document}
================================================

Same example, live:
https://www.overleaf.com/read/vwnbnhsrkrbz

If there's a high enough paragraph afterwards, it looks exactly as expected:
https://imgur.com/a/m8WapRc

However, when there's no suitable paragraph, it just stays separately, which is not very nice, but not a big issue either:
https://imgur.com/a/R2snS1A



igo...@gmail.com

unread,
Jul 19, 2018, 2:00:23 PM7/19/18
to
I was wrong again. When using `\WFclear` alone, it is quite easy to run into too-short-paragraph-related issues. It looks like both `\WFclear` and `\WFfill` should be used. I've just posted few experiments, and a number of pictures here: https://tex.stackexchange.com/a/442369/143086 .

I think now it works as-desired (that's still a pity, that the `wrapfigure` could only start on the same line where some new paragraph starts... But that won't be easy to fix, AFAIU.

Donald Arseneau

unread,
Jul 26, 2018, 11:06:07 PM7/26/18
to
igo...@gmail.com writes:


Me>> > > placement letter). In that case you should see a warning message like
>> > > "Stationary wrapfigure forced to float". You shoul check your log
>> > > file
>> > > for a reason it had to float. This usually happens when another
>> > > wrapfigure is still being processed, since the paragraph shape can't
>> > > be adjusted for both simultaneously.

> > I think I've got an example, where upper-case placement letter

I can't check what is happeining in your sample. because it uses an
unknown graphics file. The web links don't give any access to a log
file, much less the ability to turn um more informative messages.

>> > \documentclass[a5paper,12pt]{memoir}
>> > \usepackage{graphicx, wrapfig, lipsum}
>> >
>> > \begin{document}
>> > \section{First section}
>> > % \lipsum[1] % uncommenting this make image jump to after section 2
>> > \begin{wrapfigure}{R}{0.4\linewidth}
>> > \centering
>> > \includegraphics[width=1\linewidth]{example-image-a}%
>> > \caption{ This is example image A }
>> > \end{wrapfigure}
>> > \lipsum[1]
>> >
>> > \section{Second section}
>> > \lipsum[2]
>> > \end{document}

Otherwise, you are CLOSE to a mimimum working example.

>> > When I work with floats, I usually add `FloatBarrier` inside each `section` command ( https://tex.stackexchange.com/a/235312/143086 ). AFAIU, it's not possible to make `wrapfig` behave like that, right?

You probably want to add \wrapfill\WFclear to your sectioning (to get
below an already-placed wrapfig and to dump a held wrapfig.



> I think now it works as-desired (that's still a pity, that the
> `wrapfigure` could only start on the same line where some new
> paragraph starts... But that won't be easy to fix, AFAIU.

It *IS* a pain that it only places a wrapfig at the start of a
paragraph!



--
Donald Arseneau as...@triumf.ca

igo...@gmail.com

unread,
Jul 27, 2018, 7:52:25 AM7/27/18
to
On Friday, July 27, 2018 at 6:06:07 AM UTC+3, Donald Arseneau wrote:
> Donald Arseneau a..@triumf.ca



On Friday, July 27, 2018 at 6:06:07 AM UTC+3, Donald Arseneau wrote:
> I can't check what is happeining in your sample. because it uses an
> unknown graphics file. The web links don't give any access to a log
> file, much less the ability to turn um more informative messages.

That's strange...
1) Am I correct that you mean that "example-image-a" is an unknown file?
AFAIU, it should be available in all modern distributions
( https://tex.stackexchange.com/a/231741/143086 ).

2) Am I correct that https://www.overleaf.com/read/ncvtmqxgxfvr does not
show an online editor side-by-side with the compiled document for you?



> You probably want to add \wrapfill\WFclear to your sectioning

Yep, it works... Thanks for both of these macros!
Just for reference, I've created some screenshots, demonstrating how
they work here ( https://tex.stackexchange.com/a/442369/143086 ).

Michael Shell

unread,
Jul 27, 2018, 10:40:58 AM7/27/18
to
On Fri, 27 Jul 2018 04:52:21 -0700 (PDT)
igo...@gmail.com wrote:

> 1) Am I correct that you mean that "example-image-a" is an unknown file?
> AFAIU, it should be available in all modern distributions


FWIW, kpsewhich can find it if a file suffix is also provided (.eps, .jpg,
.pdf, .png and .tex are all available):

kpsewhich example-image-a.pdf

which typically shows something like:

[..]/texlive/201X/texmf-dist/texmf-dist/tex/latex/mwe/example-image-a.pdf


Tis a good feature to have.

But, how does the latex system know how to find these example images without
a full path being provided and even without the mwe package being loaded
(as per Gonzalo Medina's StackExchange answer):

\includegraphics[width=3cm]{example-image-a}

e.g., what exactly is the default graphics search path(s) on modern TeX Live
systems? If care is not taken with the search order, I could easily see a
name clash with a user's own files one day.

And does anyone know right off hand when this feature became available in
TeX Live?


Cheers,

Mike Shell

jon

unread,
Jul 28, 2018, 10:55:02 PM7/28/18
to
On Friday, 27 July 2018 10:40:58 UTC-4, Michael Shell wrote:
> On Fri, 27 Jul 2018 04:52:21 -0700 (PDT)
> ig...@gmail.com wrote:
>
> > 1) Am I correct that you mean that "example-image-a" is an unknown file?
> > AFAIU, it should be available in all modern distributions
>
>
> FWIW, kpsewhich can find it if a file suffix is also provided (.eps, .jpg,
> .pdf, .png and .tex are all available):
>
> kpsewhich example-image-a.pdf
>
> which typically shows something like:
>
> [..]/texlive/201X/texmf-dist/texmf-dist/tex/latex/mwe/example-image-a.pdf
>
>
> Tis a good feature to have.

truly.

>
> But, how does the latex system know how to find these example images without
> a full path being provided and even without the mwe package being loaded
> (as per Gonzalo Medina's StackExchange answer):
>
> \includegraphics[width=3cm]{example-image-a}
>
> e.g., what exactly is the default graphics search path(s) on modern TeX Live
> systems? If care is not taken with the search order, I could easily see a
> name clash with a user's own files one day.

i believe graphicx.sty will find graphics files wherever .tex files may be
found. that is, it will search, in order (to simplify):

- working directory
- $TEXMFHOME
- $TEXMFLOCAL
- $TEXMFDIST

the effect of this means a version of example-image-a.pdf installed in
~/texmf (on mysystem) will always be used before the version found in
(say) texlive 2018. local versions of standard packages can inadvertently
cause problems.

i also think (but have not verified) that this command tells you the search
order:

$ kpsewhich -var-value TEXMF

>
> And does anyone know right off hand when this feature became available in
> TeX Live?

no, sorry. for several years (i think) at any rate.

cheers,
jon.

Donald Arseneau

unread,
Jul 31, 2018, 10:56:27 PM7/31/18
to
igo...@gmail.com writes:

> On Friday, July 27, 2018 at 6:06:07 AM UTC+3, Donald Arseneau wrote:
>> I can't check what is happeining in your sample. because it uses an
>> unknown graphics file. The web links don't give any access to a log
>> file, much less the ability to turn um more informative messages.
>
> That's strange...
> 1) Am I correct that you mean that "example-image-a" is an unknown file?
> AFAIU, it should be available in all modern distributions
> ( https://tex.stackexchange.com/a/231741/143086 ).

Ah ha! I didn't have it though.

> 2) Am I correct that https://www.overleaf.com/read/ncvtmqxgxfvr does not
> show an online editor side-by-side with the compiled document for you?

It showed the source, but would not allow editing. That's not important
though because I wouldn't trust such a system for testing; and it
doesn't show the log.

>
>> You probably want to add \wrapfill\WFclear to your sectioning
>
> Yep, it works... Thanks for both of these macros!
> Just for reference, I've created some screenshots, demonstrating how
> they work here ( https://tex.stackexchange.com/a/442369/143086 ).

--
Donald Arseneau as...@triumf.ca

0 new messages