根据表格宽度来调整可包裹宽度

根据表格宽度来调整可包裹宽度

有没有办法将可包装表格的宽度设置为它包含的表格的宽度,而不是设置指定的宽度?

\begin{wraptable}{r}{8cm}
\begin{tabular}{lcc}
\toprule
& Fibonacci Heap & Binary Heap \\ \midrule
\texttt{insert} & \bigO{1} (amortized) & \bigO{\log{n}} \\ \midrule
\texttt{decreaseKey} & \bigO{1} (amortized) & \bigO{n} \\ \midrule
\texttt{deleteMin} & \bigO{1} (amortized) & \bigO{\log{n}} \\ \bottomrule
\end{tabular}
\caption{The runtime efficiency of different Priority Queues}\label{tabular:priorityQueuesRuntime}
\end{wraptable}

谢谢你的帮助!

PS:不要考虑算法的运行时间(如果你能理解的话),它们是错误的

答案1

来自wrapfig的文档:

2 尺寸和可选悬垂

参数 #4(第二个必需参数)是图形或表格的宽度。[...]

但是,如果将宽度指定为零 (0pt),则图形的实际宽度将决定环绕宽度。下面的内容\caption应与图形具有相同的宽度,但可能会失败;使用标题时指定宽度更为安全。

尝试\begin{wraptable}{r}{0pt} ...一下。请提供 MWE,而不是代码片段。

相关内容