Wrapfigure produziert keine Figur

Wrapfigure produziert keine Figur

Mein Code ist

\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.5\textwidth}
\centering
\includegraphics[width=0.38\textwidth]{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}

Dieser Code erzeugt überhaupt keine Zahlen (und zeigt auch keinen Fehler an). Ich habe wrapfigauch Pakete verwendet. Bitte helfen Sie!!

Antwort1

Mit zwei Miniseiten statt wrapfig:

Bildbeschreibung hier eingeben

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

\begin{problem}
\begin{minipage}[t]{0.5\textwidth}
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.5\textwidth}
\centering
\includegraphics[width=0.38\textwidth,valign=t]{example-image}
\end{minipage}
\end{problem}
\end{document}

Antwort2

Ich schlage diese Layoutvariante mit dem insboxSatz einfacher TeX-Makros vor:

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

\begin{document}

\begin{problem}\leavevmode%
\InsertBoxR{-1}{\includegraphics[width=0.38\textwidth]{example-image}}\par\noindent
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}

Bildbeschreibung hier eingeben

Antwort3

Da das "Problem" eine Konfliktumgebung ist, die die Platzierung von Abbildungen dort verhindert, und "Wrapfigure" am Anfang von Absätzen platziert werden, können Sie einen gefälschten Absatz mit~~\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.5\textwidth}
\centering
\includegraphics[width=0.38\textwidth]{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}

verwandte Informationen