我正在使用这个 LaTeX 代码来并排生成三个表格。但是,它显示错误并且没有给出令人满意的结果。有人能帮我解决这个问题吗?
\begin{table}
\centering
\makebox[0pt][c]{\parbox{1.2\textwidth}{%
\begin{minipage}[b]{0.265\hsize}\centering
\begin{tabular}{ | c | c |c | }
\multicolumn{3}{c}
\hline
{$q=1/10$} \\
\hline
T & $r_h$ & $\omega$ \\
\hline
0.233 & 0.135 & 2.38486-0.34667I \\
0.256 & 0.140 & 2.38092-0.35837I \\
0.273 & 0.145 & 2.38049-0.35982I \\
0.278 & 0.146 & 2.38007-0.36130I \\
0.281 & 0.147 & 2.37964-0.36282I \\
\hline
0.284 & 0.761 & 2.54150-2.03209I \\
0.285 & 0.765 & 2.54515-2.04292I \\
0.289 & 0.800 & 2.57799-2.13761I \\
0.302 & 0.900 & 2.67987-2.40712I \\
0.312 & 1.000 & 2.79214-2.67552I \\
\hline
\end{tabular}
\end{minipage}
\hfill
\begin{minipage}[b]{0.265\hsize}\centering
\begin{tabular}{ | c | c | c | }
\multicolumn{3}{c}
\hline
{$q=1/9$} \\
\hline
T & $r_h$ & $\omega$ \\
\hline
0.227 & 0.150 & 2.34385-0.41094I \\
0.245 & 0.155 & 2.34215-0.41723I \\
0.260 & 0.160 & 2.34056-0.42416I \\
0.271 & 0.165 & 2.33908-0.43175I \\
0.276 & 0.167 & 2.33852-0.43497I \\
\hline
0.280 & 0.720 & 2.50248-1.92299I \\
0.283 & 0.750 & 2.52893-2.00424I \\
0.286 & 0.780 & 2.55660-2.08533I \\
0.289 & 0.800 & 2.57568-2.13931I \\
0.302 & 0.900 & 2.67807-2.40842I \\
\hline
\end{tabular}
\end{minipage}
\hfill
\begin{minipage}[b]{0.265\hsize}\centering
\begin{tabular}{ | c | c | c |}
\multicolumn{3}{c}
\hline
{$q=1/8$} \\
\hline
T & $r_h$ & $\omega$ \\
\hline
0.246 & 0.180 & 2.29733-0.50611I \\
0.255 & 0.185 & 2.29654-0.51364I \\
0.263 & 0.190 & 2.29589-0.52172I \\
0.269 & 0.195 & 2.29534-0.53033I \\
0.273 & 0.199 & 2.29496-0.53758I \\
\hline
0.275 & 0.675 & 2.46067-1.80426I \\
0.277 & 0.700 & 2.48131-1.87194I \\
0.288 & 0.800 & 2.57245-2.14170I \\
0.302 & 0.900 & 2.67555-2.41027I \\
0.317 & 1.000 & 2.78870-2.67796I \\
\hline
\end{tabular}
\end{minipage}%
}}
\end{table}
答案1
问题是,as in \hline
参数中的命令 不起作用。只需在每个表中删除该命令,它就可以正常工作。 \multicolumn
\multicolumn{3}{c}\hline{$q=1/10$}
\hline
另一方面,考虑删除多余的洋葱层(\makebox
,\parbox,
和minipages
),留下这个简单的结构,这也应该有效:
\begin{tabular} ... \end{tabular} \hfill
\begin{tabular} ... \end{tabular} \hfill
\begin{tabular} ... \end{tabular}
如果页面放不下,就该减小字体大小,或者使用横向页面,可能使用其他边距,或者重新设计表格(在 2 附近的数字中显示 5 位数字真的有用吗?)但不超过边际。另一方面……请尽量避免使用垂直线,并使用包装booktabs
以获得更好的水平线和垂直间距。例如:
\documentclass{article}
\usepackage[margin=1in,a4paper]{geometry}
\usepackage{booktabs}
\begin{document}
\begin{table}
\centering
\footnotesize
\begin{tabular}{ccc}
\multicolumn{3}{c}
{$q=1/10$} \\
\toprule
T & $r_h$ & $\omega$ \\
\midrule
0.233 & 0.135 & 2.38486-0.34667I \\
0.256 & 0.140 & 2.38092-0.35837I \\
0.273 & 0.145 & 2.38049-0.35982I \\
0.278 & 0.146 & 2.38007-0.36130I \\
0.281 & 0.147 & 2.37964-0.36282I \\
\midrule
0.284 & 0.761 & 2.54150-2.03209I \\
0.285 & 0.765 & 2.54515-2.04292I \\
0.289 & 0.800 & 2.57799-2.13761I \\
0.302 & 0.900 & 2.67987-2.40712I \\
0.312 & 1.000 & 2.79214-2.67552I \\
\bottomrule
\end{tabular}
\hfill
\begin{tabular}{ccc}
\multicolumn{3}{c}
{$q=1/9$} \\
\toprule
T & $r_h$ & $\omega$ \\
\midrule
0.227 & 0.150 & 2.34385-0.41094I \\
0.245 & 0.155 & 2.34215-0.41723I \\
0.260 & 0.160 & 2.34056-0.42416I \\
0.271 & 0.165 & 2.33908-0.43175I \\
0.276 & 0.167 & 2.33852-0.43497I \\
\midrule
0.280 & 0.720 & 2.50248-1.92299I \\
0.283 & 0.750 & 2.52893-2.00424I \\
0.286 & 0.780 & 2.55660-2.08533I \\
0.289 & 0.800 & 2.57568-2.13931I \\
0.302 & 0.900 & 2.67807-2.40842I \\
\bottomrule
\end{tabular}
\hfill
\begin{tabular}{ccc}
\multicolumn{3}{c}
{$q=1/8$} \\
\toprule
T & $r_h$ & $\omega$ \\
\midrule
0.246 & 0.180 & 2.29733-0.50611I \\
0.255 & 0.185 & 2.29654-0.51364I \\
0.263 & 0.190 & 2.29589-0.52172I \\
0.269 & 0.195 & 2.29534-0.53033I \\
0.273 & 0.199 & 2.29496-0.53758I \\
\midrule
0.275 & 0.675 & 2.46067-1.80426I \\
0.277 & 0.700 & 2.48131-1.87194I \\
0.288 & 0.800 & 2.57245-2.14170I \\
0.302 & 0.900 & 2.67555-2.41027I \\
0.317 & 1.000 & 2.78870-2.67796I \\
\bottomrule
\end{tabular}
\end{table}
\end{document}
答案2
一些建议:
不需要
\makebox
、\parbox
和minipage
包装器。只需提供三个tabular
环境,以 分隔\hfill
。实际上,由于表格中的所有材料都是数学,因此最好使用
array
环境而不是tabular
环境。例如,在每个表格的第三列中,您将得到印刷的“减号”符号而不是印刷的“破折号”符号。尝试通过 (a) 去除所有垂直线和 (b) 使用包的线条绘制宏
booktabs
而不是来实现“开放”的外观\hline
。\arraycolsep
通过减少(控制列间空白量的参数)和(控制“减号”周围空白的参数)的值\medmuskip
,您无需减小字体大小就可以使三个表格并排放置。
(以下屏幕截图顶部的水平线只是为了说明文本块的宽度。)
\documentclass{article}
\usepackage[margin=2.5cm,a4paper]{geometry} % set page parameters
\usepackage{booktabs}
\begin{document}
\hrule % just to illustrate width of text block
\begin{table}[h!]
\setlength\arraycolsep{4pt} % default: 5pt
\medmuskip=3mu % default: 4mu
$ % start math mode
\begin{array}{@{} ccc @{}}
\multicolumn{3}{c}{q=1/10}\\
\toprule
T & r_h & \omega \\
\midrule
0.233 & 0.135 & 2.38486-0.34667I \\
0.256 & 0.140 & 2.38092-0.35837I \\
0.273 & 0.145 & 2.38049-0.35982I \\
0.278 & 0.146 & 2.38007-0.36130I \\
0.281 & 0.147 & 2.37964-0.36282I \\
\addlinespace
0.284 & 0.761 & 2.54150-2.03209I \\
0.285 & 0.765 & 2.54515-2.04292I \\
0.289 & 0.800 & 2.57799-2.13761I \\
0.302 & 0.900 & 2.67987-2.40712I \\
0.312 & 1.000 & 2.79214-2.67552I \\
\bottomrule
\end{array}
\hfill
\begin{array}{@{} ccc @{}}
\multicolumn{3}{c}{q=1/9}\\
\toprule
T & r_h & \omega \\
\midrule
0.227 & 0.150 & 2.34385-0.41094I \\
0.245 & 0.155 & 2.34215-0.41723I \\
0.260 & 0.160 & 2.34056-0.42416I \\
0.271 & 0.165 & 2.33908-0.43175I \\
0.276 & 0.167 & 2.33852-0.43497I \\
\addlinespace
0.280 & 0.720 & 2.50248-1.92299I \\
0.283 & 0.750 & 2.52893-2.00424I \\
0.286 & 0.780 & 2.55660-2.08533I \\
0.289 & 0.800 & 2.57568-2.13931I \\
0.302 & 0.900 & 2.67807-2.40842I \\
\bottomrule
\end{array}
\hfill
\begin{array}{@{} ccc @{}}
\multicolumn{3}{c}{q=1/8}\\
\toprule
T & r_h & \omega \\
\midrule
0.246 & 0.180 & 2.29733-0.50611I \\
0.255 & 0.185 & 2.29654-0.51364I \\
0.263 & 0.190 & 2.29589-0.52172I \\
0.269 & 0.195 & 2.29534-0.53033I \\
0.273 & 0.199 & 2.29496-0.53758I \\
\addlinespace
0.275 & 0.675 & 2.46067-1.80426I \\
0.277 & 0.700 & 2.48131-1.87194I \\
0.288 & 0.800 & 2.57245-2.14170I \\
0.302 & 0.900 & 2.67555-2.41027I \\
0.317 & 1.000 & 2.78870-2.67796I \\
\bottomrule
\end{array}
$ % end math mode
\end{table}
\end{document}