
我需要在兩列文件中放置一個全角表格。
為了讓這個全角表格在兩列文件中具有交叉邊距,我使用了以下方法。*
中的(星號)可用\begin{table*}
來實現此目的。
\begin{table*}
\centering
\begin{tabular}{|c|c|c|c|c|}
\hline
Setup & \multicolumn{2}{|c|}{Experiment 1} & \multicolumn{2}{|c|}{Experiment 2} \\
\hline
\hline
Logistic Regression & 0.0678 & 0.0678 & 0.0678 & 0.0678 \\
\hline
\end{tabular}
\caption{Caption}
\label{tab:my_label}
\end{table*}
但是,這會導致表格向下移動到文件末尾(最後一頁)。我嘗試了幾種方法來修復提到的表格位置。
嘗試過解決方案1:實施此解決方案後,該表消失了。
嘗試過解決方案2:在沒有固定其位置的情況下扭曲了整個表格。
嘗試過解決方案3:這確實起到了一點作用,並將表格推向了最接近的到提到的地方。然而,該表格並沒有像提到的那樣停留在同一頁上,而是轉到了下一頁。
如何將表格放置在提到的同一頁上?
我將感謝您的幫助或任何提示。
答案1
該軟體包stfloats
可以幫助:
\documentclass{article}
\usepackage{stfloats} % for positioning of figure* or table* on the same page
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\begin{table*}[b]
\centering
\begin{tabular}{|c|c|c|c|c|}
\hline
Setup & \multicolumn{2}{|c|}{Experiment 1} & \multicolumn{2}{|c|}{Experiment 2} \\
\hline
\hline
Logistic Regression & 0.0678 & 0.0678 & 0.0678 & 0.0678 \\
\hline
\end{tabular}
\caption{Caption}
\label{tab:my_label}
\end{table*}
\lipsum[2-5]
\end{document}