我正在使用以下代码来制作表格:
\begin{table}[!h]
\centering
\begin{tabular}{@{} lllll }
\toprule
\textbf{\mytab{DM}}
& \multicolumn{3}{c|}{\textbf{\mytab{Epistemic $>$ Root}}} & \multicolumn{1}{c}{\textbf{\mytab{Root $>$ Epistemic}}}\\
\midrule
& \textbf{\mytab{E--E}} & \textbf{\mytab{E--R}} & \textbf{\mytab{R--R}} & \textbf{\mytab{R--E}} \\
\midrule
\textit{\mytab{Must Used to (...)\\ Will Ought to}} & .27 & .25 & .23 & .22\\
\bottomrule
\end{tabular}
\caption{Proportions of semantic ordering of DMs with 5 tokens or less, from \textit{Must Used to} to \textit{Will Ought to} (n=59)}
\label{tab:low_freq_DM_semantics}
\end{table}
\FloatBarrier
从输出中可以看出,第二列(Root > Epistemic)中的值是左对齐的,我想将它们居中放置在这一大列中,以使它们从第一列中的值中脱颖而出。我尝试过\centering
在列内使用,也尝试过手动命令,例如\hskip
,,\qquad
但当我这样做时没有任何反应。希望得到一些帮助,因为我有时很难理解 Latex 表格,尽管我希望这个问题的解决方案非常简单!
一切顺利,
卡梅伦
答案1
这是您想要的吗?第三列的标题被放在一个更宽的框中,人为地变得更大了。
\documentclass{article}
\usepackage{booktabs,siunitx}
\begin{document}
\begin{table}[!htp]
\centering
\begin{tabular}{
@{}
l
*{4}{S[table-format=1.2]}
@{}
}
\toprule
\textbf{DM} &
\multicolumn{3}{c}{\textbf{Epistemic $>$ Root}} &
{\textbf{Root $>$ Epistemic}}\\
\cmidrule(r){2-4} \cmidrule(l){5-5}
& {\textbf{E--E}} & {\makebox[6em]{\textbf{E--R}}} & {\textbf{R--R}} & {\textbf{R--E}} \\
\midrule
\textit{Might Can} & .27 & .25 & .23 & .22 \\
\textit{Might Could} & .34 & .66 & 0 & 0 \\
\textit{Can Could} & .24 & 0 & .75 & 0 \\
\bottomrule
\end{tabular}
\caption{Proportions of semantic ordering of DMs with 5 tokens or less,
from \textit{Must Used to} to \textit{Will Ought to} ($n=59$)}
\label{tab:low_freq_DM_semantics}
\end{table}
\end{document}
始终在小数前保留前导零。如您所见,siunitx
无论如何都会自动执行此操作。
答案2
纯粹猜测……
\documentclass[varwidth, border=3.141592]{standalone}
\usepackage{booktabs, makecell, multirow}
\renewcommand\theadfont{\bfseries}
\renewcommand\theadgape{}
\NewExpandableDocumentCommand\mcc{O{1}m}{\multicolumn{#1}{c}{#2}}
\usepackage{siunitx}
\begin{document}
\begin{table}[!h]
\centering
\begin{tabular}{@{} >{\itshape}l SSSS }
\toprule
\thead{DM}
& \mcc[3]{\textbf{Epistemic $>$ Root}}
& \mcc{\thead{Root $>$ Epistemic}} \\
\cmidrule(r){2-4}\cmidrule(l){5-5}
&{\thead{E--E}} &{\thead{E--R}} &{\thead{R--R}} &{\thead{R--E}}\\
\midrule
\makecell[l]{Must Used to (...)\\
Will Ought to }
& .27 & .25 & .23 & .22\\
\bottomrule
\end{tabular}
\caption{Proportions of semantic ordering of DMs with 5 tokens or less, from \textit{Must Used to} to \textit{Will Ought to} (n=59)}
\label{tab:low_freq_DM_semantics}
\end{table}
\end{document}