TransWikia.com

Wrapfigure is not producing figure

TeX - LaTeX Asked by prashant sharma on December 14, 2020

My code is

documentclass{book}
usepackage{wrapfigure}
newtheorem{problem}{P}[chapter]
begin{document}
A circle is drawn in a sector of a larger circle
begin{problem}
begin{wrapfigure}{r}{0.5textwidth}
centering
includegraphics[width=0.38textwidth]{TrigFig23.pdf}
end{wrapfigure}
noindent
of radius $r$, as shown in the adjacent figure. 
The smaller circle is tangent to the two bounding radii and the arc of the sector. Find the radius of the smaller circle.
end{problem}
end{document}

This code is not producing figure at all (neither it is showing error). I have used wrapfig package as well. Please help!!

3 Answers

With two minipages instead of wrapfig:

enter image description here

documentclass{book}
usepackage{graphicx}
usepackage[export]{adjustbox}
newtheorem{problem}{P}[chapter]
begin{document}

begin{problem}
begin{minipage}[t]{0.5textwidth}
A circle is drawn in a sector of a larger circle of radius $r$, as shown in the adjacent figure. 
The smaller circle is tangent to the two bounding radii and the arc of the sector. Find the radius of the smaller circle.
end{minipage}%
begin{minipage}[t]{0.5textwidth}
centering
includegraphics[width=0.38textwidth,valign=t]{example-image}
end{minipage}
end{problem}
end{document}

Correct answer by leandriis on December 14, 2020

I propose this variant layout, with the insbox set of plain TeX macros package:

documentclass{book}
usepackage{graphicx}
input{insbox}
newtheorem{problem}{P}[chapter]

begin{document}

begin{problem}leavevmode%
InsertBoxR{-1}{includegraphics[width=0.38textwidth]{example-image}}parnoindent
A circle is drawn in a sector of a larger circle of radius $r$, as shown in the adjacent figure.
The smaller circle is tangent to the two bounding radii and the arc of the sector. Find the radius of the smaller circle.
end{problem}

end{document}

enter image description here

Answered by Bernard on December 14, 2020

Since the "problem" is a conflicting environment which prevents figure placement there, and "wrapfigure" get placed at the beginning of paragraphs, you can provide a fake paragraph with ~~vspace*{-baselineskip}

documentclass{book}
usepackage{wrapfig}
usepackage{graphicx}
newtheorem{problem}{P}[chapter]
begin{document}
A circle is drawn in a sector of a larger circle

begin{wrapfigure}{r}{0.5textwidth}
centering
includegraphics[width=0.38textwidth]{example-image-a.pdf}
end{wrapfigure}
~~vspace*{-baselineskip}
begin{problem}
noindent
of radius $r$, as shown in the adjacent figure. 
The smaller circle is tangent to the two bounding radii and the 
arc of the sector. Find the radius of the smaller circle.
end{problem}
end{document}

Answered by Donald Arseneau on December 14, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP