Closed. This question is off-topic。它当前不接受答案。












想改善这个问题吗? Update the question,所以它是用于堆栈溢出的on-topic

已关闭8年。



Improve this question




我是LaTeX初学者。到现在为止,只要我创建了表格(使用表格环境),LaTeX都会在我的文本行之间将其浮动在自己的段落中。

但是,我想要一种将小表格嵌入到段落中(向左或向右)的方法,使文字围绕它流动。是否有一种简单的方法可以执行此操作,而不必对格式进行过多的手动控制?

最佳答案

\begin{wraptable}{O}{0.5\columnwidth}
% 0.5\columnwidth is 50% of the width for text. It will wrap to the "outer"
% of the current page, and thus if you have double-sided print, it'll still look
% good.
\begin{centering}
% The centering will look nice (else it's left-aligned, which isn't nice)
\begin{tabular}{|c|c|}
% Having your own tabular here.
\hline
Hello & World\tabularnewline
\hline
\hline
Stack & Overflow!\tabularnewline
\hline
% End of content.
\end{tabular}
\par % Add for spacing
\end{centering}
\caption{Test Table}
% Enter your caption (a float having a caption looks cool)
\end{wraptable}

这将使表格包装并漂浮。如果您熟悉它们,它看起来类似于HTML中的浮点数。

10-01 02:00
查看更多