Wrapfigure 未產生圖形

Wrapfigure 未產生圖形

我的程式碼是

\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}

該程式碼根本不產生圖形(也不顯示錯誤)。我wrapfig也用過包包。請幫忙!

答案1

用兩個小頁面代替wrapfig

在此輸入影像描述

\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}

答案2

我建議這個變體佈局,帶有一insbox組純 TeX 巨集套件:

\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}

在此輸入影像描述

答案3

由於“問題”是一個衝突的環境,它阻止了圖形的放置,並且“wrapfigure”被放置在段落的開頭,因此您可以提供一個假段落~~\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}

相關內容