图片右侧的一段文字

图片右侧的一段文字

我有一份类似于以下内容的乳胶文档的一部分:

\begin{knitrout}
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}
\includegraphics[width=0.5\linewidth]{figure/plot} \hfill{}
some text...
\end{knitrout}

(它是使用 knitr 从 R 生成的)。它放置我想要的图片,并放在下方some text...。我想放在some text...图片的右侧。我该怎么做?

编辑:添加 R 代码来生成图片的乳胶代码:

<<plot,echo=FALSE,fig.align="left",out.width="0.5\\linewidth">>=
generatePicture()
@

答案1

我设法使用 找到它\minipage。如果有人遇到同样的问题,或者其他人知道更好的方法,我会发布我所做的事情。

\minipage[t]{\dimexpr0.48\linewidth-2\fboxsep-2\fboxrule\relax}
\begin{knitrout}
\begin{knitrout}
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}

\includegraphics[width=1\linewidth]{figure/plot} \hfill{}



\end{knitrout}

\endminipage%}
\hfill
\minipage[t]{\dimexpr0.48\linewidth-2\fboxsep-2\fboxrule\relax}
\vspace{10 mm}
Some text...
\endminipage

相关内容