我试图在右侧绘制一个图形,在左侧绘制一些文本(我lemma
在序言中定义了一个环境,它在我的代码中随处可见)。这是我的代码:
There are some other formulae for inradius which requires the following lemma, which gives the distances of the points of contact of incircle and sides from the vertices.
\begin{mdframed}[backgroundcolor = gray!20]
\begin{minipage}{0.5\textwidth}
\noindent
\begin{lemma}
In $\Delta ABC$ let $D,E$, and $F$ be the points of contact of incircle with the sides $BC,CA$ and $AB$ respectively as shown in figure, then we have
\begin{equation}
\left.
\begin{array}{ccc}
AE & = & AF=s-a \\
BD & = & BF= s-b\\
CD & = & CE= s-c
\end{array}
\right\}
\label{101020eq02}
\end{equation}
\end{lemma}
\end{minipage}
\begin{minipage}{0.5\textwidth}
\begin{figure}
\centering
\includegraphics{SoTFig16.pdf}
\end{figure}
\end{minipage}
\end{mdframed}
此代码抛出错误Not in outer par mode
。我该如何消除错误?有没有更好的方法来获得所需的输出?我wrapfigure
也试过了,但没有用。
谢谢!
答案1
图片是“浮动对象”(用于移动到页面或后续页面的不同位置),不能放在小页面中。由于没有标题,您可能不需要“图片”,而只需要\includegraphics
。
您还发现了两个小页面的错误0.5\textwidth
,它们之间没有留出足够的空间。
\documentclass{article}
\usepackage{mdframed,amsmath,amsthm,graphicx,xcolor}
\newtheorem{lemma}{Lemma}
\begin{document}
Figures are ``floating objects'' and can't be put in a minipage.
Since there is no caption, you probably don't want a ``figure''
but just \verb|\includegraphics|.
\begin{mdframed}[backgroundcolor = gray!20]
\begin{minipage}{0.48\textwidth}
\begin{lemma}
In $\Delta ABC$ let $D,E$, and $F$ be the points of contact of in circle
with the sides $BC,CA$ and $AB$ respectively as shown in figure, then we have
\begin{equation}
\left.
\begin{array}{ccc}
AE & = & AF=s-a \\
BD & = & BF= s-b\\
CD & = & CE= s-c
\end{array}
\right\}
\label{101020eq02}
\end{equation}
\end{lemma}
\end{minipage}\hfill
\begin{minipage}{0.47\textwidth}
\centering
\includegraphics{example-image-b.pdf}
\end{minipage}
\end{mdframed}
\end{document}
你为什么标记“wrapfigure”?只是为了让我阅读问题吗?你也许可以使用它,但在这个例子中没有任何好处。