我正在写一篇论文提交给统计和计算,我使用 svjour3 类和 twocolumn 环境。我想在文本之间设置一个占据两列的表格,但我没有得到结果,有人知道该怎么做吗?以下是示例代码:
\documentclass[twocolumn]{svjour3}
\usepackage{lipsum,array}
\begin{document}
\title{foo}
\author{I}
\maketitle
\lipsum[1-10]
\begin{table*}
\centering
\caption{Empirical mean of the maximum likelihood}
%\resizebox{\columnwidth}{!}{%
\begin{tabular*}{0.85\textwidth}{rccccccccccc}
\hline
\hline
\multicolumn{12}{c}{Presence and Absence}\\
\hline \hline
&\multicolumn{2}{c}{A1} &&\multicolumn{2}{c}{A2}&&\multicolumn{2}{c}{A3}&&\multicolumn{2}{c}{A4} \\
\cline{2-3} \cline{5-6} \cline{8-9}\cline{11-12}
Parameters&Mean &RMSE&&Mean&RMSE&&Mean&RMSE&&Mean&RMSE \\ \hline
$\alpha_{1}=2.5$& 2.248 & 0.315 & & 1.441 & 1.067 & & 1.717 & 0.797 & & 1.682 & 0.836 \\
$\alpha_{2}=1.0$& 0.831 & 0.210 & & 0.742 & 0.273 & & 0.681 & 0.336 & & 0.852 & 0.179 \\
$\alpha_{3}=2.5$& 2.098 & 0.465 & & 1.870 & 0.648 & & 1.716 & 0.807 & & 2.149 & 0.398 \\
$\alpha_{4}=2.0$& 1.642 & 0.410 & & 1.480 & 0.536 & & 1.358 & 0.663 & & 1.709 & 0.334 \\
$\beta_{1}=-0.5$&$-$0.545& 0.060 & & $-$0.772 & 0.275 & & 0.132 & 0.650 & & $-$0.716 & 0.222 \\
$\beta_{2}=1.5$& 1.506 & 0.041 & & 1.500 & 0.031 & & 1.499 & 0.040 & & 1.496 & 0.031 \\
$\beta_{3}=2.0$& 2.016 & 0.052 & & 2.000 & 0.038 & & 2.003 & 0.048 & & 1.989 & 0.040 \\
$\theta_{1}=2.0$& 2.547 & 0.622 & & 0.789 & 1.211 & & 1.235 & 0.783 & & 0.703 & 1.297 \\
$\rho=0.4$& 0.431 & 0.113 & & 0.346 & 0.134 & & 0.531 & 0.212 & & 0.284 & 0.186 \\
\hline \hline
\multicolumn{12}{c}{Absence and presence}\\
\hline \hline
Parameters&Mean &RMSE&&Mean&RMSE&&Mean&RMSE&&Mean&RMSE \\ \hline
$\alpha_{1}=2.5$ & 2.260 & 0.294 & & 1.444 & 1.064 & & 1.641 & 0.880 & & 1.676 & 0.839 \\
$\alpha_{2}=1.0$ & 0.803 & 0.231 & & 0.729 & 0.284 & & 0.685 & 0.327 & & 0.842 & 0.188 \\
$\alpha_{3}=2.5$ & 2.055 & 0.497 & & 1.846 & 0.670 & & 1.736 & 0.782 & & 2.121 & 0.422 \\
$\beta_{1}=-0.5$ & $-$0.550 & 0.071 & & $-$0.766 & 0.271 & & $-$0.070 & 0.591 & & $-$0.688 & 0.200 \\
$\beta_{2}=1.5$ & 1.508 & 0.044 & & 1.498 & 0.031 & & 1.502 & 0.029 & & 1.488 & 0.035 \\
$\beta_{3}=2.0$ & 2.024 & 0.063 & & 1.994 & 0.046 & & 2.003 & 0.039 & & 1.964 & 0.068 \\
$\alpha_{1}=2.0$ & 2.534 & 0.609 & & 0.787 & 1.213 & & 1.131 & 0.890 & & 0.698 & 1.302 \\
$\rho=0.4$ & 0.431 & 0.140 & & 0.314 & 0.174 & & 0.472 & 0.192 & & 0.169 & 0.330 \\
\hline \hline
\end{tabular*}
%}
\label{a:test}
\end{table*}
\lipsum[3-5]
\end{document}
我想要的是像下面的例子一样:
答案1
您必须知道,在双列模式下,分布在两列的表格*将位于插入点后面的页面顶部,因此您必须在代码中将其插入到上一页中出现的位置。
另一种可能性是使用stfloats
包(来自sttools
捆绑包),它提供了使用[b]
位置说明符的可能性,或者strip
环境from
cuted (also from
sttools`),这使得您的表格或图形不浮动并将其放置在插入点。
这是第一个解决方案的示例。我借此机会改进了您的表格,其S
列类型为siunitx
(小数点对齐的数字),规则为booktabs
,具有一些垂直填充。简单tabular
就足够了:
\documentclass[twocolumn]{svjour3}
\usepackage{lipsum,array}
\usepackage{siunitx, booktabs}
\begin{document}
\title{foo}
\author{I}
\maketitle
\lipsum[1-5]
\begin{table*}
\centering
\caption{Empirical mean of the maximum likelihood}
\sisetup{table-format=-1.3, table-number-alignment=center}
\begin{tabular}{r*{3}{SSc}SS}%{0.85\textwidth}
\toprule
\midrule
\multicolumn{12}{c}{Presence and Absence}\\
\midrule \midrule
&\multicolumn{2}{c}{A1} &&\multicolumn{2}{c}{A2}&&\multicolumn{2}{c}{A3}&&\multicolumn{2}{c}{A4} \\
\cmidrule(l){2-3} \cmidrule(l){5-6} \cmidrule(l){8-9}\cmidrule(l){11-12}
Parameters & {Mean} & {RMSE} & & {Mean} & {RMSE} & & {Mean} & {RMSE} & &{Mean}& {RMSE} \\
\midrule
$\alpha_{1}=2.5$& 2.248 & 0.315 & & 1.441 & 1.067 & & 1.717 & 0.797 & & 1.682 & 0.836 \\
$\alpha_{2}=1.0$& 0.831 & 0.210 & & 0.742 & 0.273 & & 0.681 & 0.336 & & 0.852 & 0.179 \\
$\alpha_{3}=2.5$& 2.098 & 0.465 & & 1.870 & 0.648 & & 1.716 & 0.807 & & 2.149 & 0.398 \\
$\alpha_{4}=2.0$& 1.642 & 0.410 & & 1.480 & 0.536 & & 1.358 & 0.663 & & 1.709 & 0.334 \\
$\beta_{1}=-0.5$& -0.545& 0.060 & & -0.772 & 0.275 & & 0.132 & 0.650 & & -0.716 & 0.222 \\
$\beta_{2}=1.5$& 1.506 & 0.041 & & 1.500 & 0.031 & & 1.499 & 0.040 & & 1.496 & 0.031 \\
$\beta_{3}=2.0$& 2.016 & 0.052 & & 2.000 & 0.038 & & 2.003 & 0.048 & & 1.989 & 0.040 \\
$\theta_{1}=2.0$& 2.547 & 0.622 & & 0.789 & 1.211 & & 1.235 & 0.783 & & 0.703 & 1.297 \\
$\rho=0.4$& 0.431 & 0.113 & & 0.346 & 0.134 & & 0.531 & 0.212 & & 0.284 & 0.186 \\
\midrule \midrule
\multicolumn{12}{c}{Absence and presence}\\
\midrule \midrule
Parameters & {Mean} & {RMSE} & & {Mean} & {RMSE} & & {Mean} & {RMSE} & &{Mean}& {RMSE} \\
\midrule
$\alpha_{1}=2.5$ & 2.260 & 0.294 & & 1.444 & 1.064 & & 1.641 & 0.880 & & 1.676 & 0.839 \\
$\alpha_{2}=1.0$ & 0.803 & 0.231 & & 0.729 & 0.284 & & 0.685 & 0.327 & & 0.842 & 0.188 \\
$\alpha_{3}=2.5$ & 2.055 & 0.497 & & 1.846 & 0.670 & & 1.736 & 0.782 & & 2.121 & 0.422 \\
$\beta_{1}=-0.5$ & -0.550 & 0.071 & &-0.766 & 0.271 & & -0.070 & 0.591 & & -0.688 & 0.200 \\
$\beta_{2}=1.5$ & 1.508 & 0.044 & & 1.498 & 0.031 & & 1.502 & 0.029 & & 1.488 & 0.035 \\
$\beta_{3}=2.0$ & 2.024 & 0.063 & & 1.994 & 0.046 & & 2.003 & 0.039 & & 1.964 & 0.068 \\
$\alpha_{1}=2.0$ & 2.534 & 0.609 & & 0.787 & 1.213 & & 1.131 & 0.890 & & 0.698 & 1.302 \\
$\rho=0.4$ & 0.431 & 0.140 & & 0.314 & 0.174 & & 0.472 & 0.192 & & 0.169 & 0.330 \\
\midrule \bottomrule
\end{tabular}
\label{a:test}
\end{table*}
\lipsum[3-10]
\end{document}