Graphics, Figures & Tables ⇒ Wrapfig within minipage environment: an unwanted effect
Wrapfig within minipage environment: an unwanted effect
The package wrapfig is used within the minipage environment as a workaround to wrap text around a figure in the enumerate environment.
Unfortunately, for some strange reason the text formatting in this case do not spam the full width of the page after the first enumerated text. Only half of the page is filled with text (see the attached pdf generate via the the source of the minimal example also attached).
I would appreciate any help to fix this.
Thanks in advance,
Sergio
- Attachments
-
- minimal.pdf
- (66.46 KiB) Downloaded 562 times
-
- minimal.tex
- (2.93 KiB) Downloaded 440 times
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- svend_tveskaeg
- Posts: 478
- Joined: Sun Jul 12, 2009 5:31 am
Wrapfig within minipage environment: an unwanted effect
Code: Select all
\documentclass{memoir}
\usepackage{wrapfig}
\newcommand*{\testA}{text text text text text }
\newcommand*{\testB}{This text does spam the full page. }
\newcommand*{\testC}{
This text does not spam the full page.
This text does not spam the full page.
This text does not spam the full page.
This text does not spam the full page.}
\begin{document}
\begin{enumerate}
\item
\begin{minipage}[t]{\linewidth}
\vskip-.9\ht\strutbox
\begin{wrapfigure}{r}{0.4\textwidth}
\begin{framed}
[\testA \testA \testA \testA \testA \testA \testA \testA]
\end{framed}
\hrulefill
\end{wrapfigure}
\setlength{\intextsep}{4pt}
Here it is shown an unwanted effect when using the package \textsf{wrapfig}
within a \textsf{minipage} environment, and I am looking for some help to fix it.
The package \textsf{wrapfig} is used within the \textsf{minipage} environment
as a workaround to wrap text around a figure in the \textsf{enumerate} environment.
Unfortunately, for some strange reason the text formatting in this case
do not spam the full width of the page after the first enumerated text.
Only half of the page is filled with text (see the attached pdf generate
via the the source of the minimal example also attached).
\begin{enumerate}
\item
\testB \testB \testB \testB \testB \testB \testB \testB \testB \testB \testB
\item
\testC
\item
\testC
\end{enumerate}
\end{minipage}
\testC \testC
\end{enumerate}
\end{document}
-- Zapp Brannigan, Futurama (season 1, episode 4)
Re: Wrapfig within minipage environment: an unwanted effect
in this case I can see that wrapfig requires the figure no to take space from the first itemize section. This is not a nice feature but one can live with that.
Sergio
[*] For me all the relevant packages should be included
in the minimal to rule out the possibility the reported behaviour is because of conflicting interest among packages or the order they are called. Apparently neither is the case here.
- svend_tveskaeg
- Posts: 478
- Joined: Sun Jul 12, 2009 5:31 am
Wrapfig within minipage environment: an unwanted effect
All the relevant packages are included if you build asergioro wrote:For me all the relevant packages should be included in the minimal to rule out the possibility the reported behaviour is because of conflicting interest among packages or the order they are called.

-- Zapp Brannigan, Futurama (season 1, episode 4)
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Wrapfig within minipage environment: an unwanted effect
{enumerate}
are always problematic with wrapfig (see its manual).Remarks:
- You should use the features of memoir to set up the page geometry.
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10