我有一个三列文档,我想在其中放置一个横跨三列中左两列的(浮动)表格。以下最小示例适用于放置,但会与中间列的文本和图形重叠。有什么建议吗?
\documentclass[paper=a4,paper=landscape, 10pt]{scrartcl}
\usepackage[
left=1.3cm,
right=2cm,
top=1.5cm,
bottom=1.5cm
]{geometry}
\usepackage{wrapfig}
\usepackage{multicol}
\usepackage{array}
\usepackage{lipsum}
\begin{document}
\begin{multicols}{3}
\lipsum[1-2]
\begin{wrapfigure}{l}{2\columnwidth}
\begin{tabular}{m{0.66\columnwidth}m{0.66\columnwidth}m{0.66\columnwidth}}
\hline
A & B & C \\ \hline
A & B & C \\ \hline
\end{tabular}
\end{wrapfigure}
\lipsum[1-5]
\end{multicols}
\end{document}
答案1
LaTeX2e 和包都不支持该功能wrapfigure
。
\vspace*{...}
一种手动(繁琐)的解决方法是在表格的第二列添加一些空间( )。
两列的总宽度为
\dimexpr 2\columnwidth + \columnsep\relax
并且表列的计算必须\tabcolsep
考虑:
\dimexpr (2\columnnwidth + \columnsep)/3 - 2\tabcolsep\relax
手动解决方法的示例:
\documentclass[paper=a4,paper=landscape, 10pt]{scrartcl}
\usepackage[
left=1.3cm,
right=2cm,
top=1.5cm,
bottom=1.5cm
]{geometry}
\usepackage{wrapfig}
\usepackage{multicol}
\usepackage{array}
\usepackage{lipsum}
\begin{document}
\begin{multicols}{3}
\lipsum[1-2]
\sbox0{%
\dimen0=\dimexpr(2\columnwidth+\columnsep)/3-2\tabcolsep\relax
\begin{tabular}{m{\dimen0}m{\dimen0}m{\dimen0}}
\hline
A & B & C \\ \hline
A & B & C \\ \hline
\end{tabular}%
}\copy0 %
\edef\TheTableHeight{\the\dimexpr\ht0 + \dp0\relax}
\lipsum[1-2]
Nulla malesuada porttitor diam. Donec felis
erat, congue non, volutpat at, tincidunt tristique, libero.
\vspace{\TheTableHeight}
Vivamus
viverra fermentum felis. Donec nonummy pellentesque ante. Phasellus
adipiscing semper elit. Proin fermentum massa ac quam. Sed diam
turpis, molestie vitae, placerat a, molestie nec, leo. Maecenas
lacinia. Nam ipsum ligula, eleifend at, accumsan nec, suscipit a,
ipsum. Morbi blandit ligula feugiat magna. Nunc eleifend consequat
lorem. Sed lacinia nulla vitae enim. Pellentesque tincidunt purus
vel magna. Integer non enim. Praesent euismod nunc eu purus. Donec
bibendum quam in tellus. Nullam cursus pulvinar lectus. Donec et mi.
Nam vulputate metus eu enim. Vestibulum pellentesque felis eu
massa.
\lipsum[4-5]
\end{multicols}
\end{document}