小页面中图片的浮动放置

小页面中图片的浮动放置

有没有办法自动将图形放置在小页面内。图形应该具有textwidth小页面的。

我的第一次实验

\begin{minipage}[0mm]{\boxwidthtotal}%
Some text which, I hope, will 'float around' the figure included below. Of course the text must be long enough such that the first part of it appears before and the rest of it below the image.
\begin{figure}[h]%
\includegraphics[width=\textwidth]{#1}%
\end{figure}%
\clearpage%
\end{minipage}%

答案1

不确定,但你的意思是这样吗?它实际上与 latex floats 没有任何关系,但将图像放在提供的文本中间。

在此处输入图片描述

\documentclass{article}

\def\a{\stepcounter{enumi}\theenumi: Some text to fill up space. }
\def\b{\a\a Different text \a\a\a}

\makeatletter
\newenvironment{xminipage}[2]
{\setbox4\hbox{\includegraphics[width=#1]{#2}}%
\setbox0\vbox\bgroup\bgroup\hsize=#1\relax\@parboxrestore}
{\par\egroup\egroup
\leavevmode
\vbox{%
\setbox2=\vsplit0 to .5\ht0
\unvbox2
\smallskip
\box4
\smallskip
\unvbox0
}}

\usepackage{graphicx}
\begin{document}

\fbox{\begin{xminipage}{100pt}{example-image}
\b
\end{xminipage}}
\quad
\fbox{\begin{xminipage}{8cm}{example-image}
\b
\end{xminipage}}

\fbox{\begin{xminipage}{100pt}{example-image}
\b\b
\end{xminipage}}
\quad
\fbox{\begin{xminipage}{8cm}{example-image}
\b\b
\end{xminipage}}





\end{document}

相关内容