如何在 Latex 中绘制下表?

如何在 Latex 中绘制下表?

如何在 Latex 中绘制下表?

在此处输入图片描述

我努力了:

\begin{table}[h!]
\centering
\begin{tabular}{|c|c c |c c|} 
 \hline
 &  c &c & a & a \\ [0.5ex] 
 \hline
 Performance measure & $\hat{\mu}$ & $\hat{\si}$ & $\hat{\mu}$ & $\hat{\si}$ \\
 \hline\hline
 MSE & 0.0589 & 0.0302 & 0.0611 &0.0456 \\ 
 Bias & 0.0243 & -0.0415  &0.0332 & -0.0496 \\
 SD & 0.242 & 0.169 & 0.245 & 0.208 \\[1ex] 
 \hline
\end{tabular}
\caption{Sample size is $n=20$.}
\label{table:1}
\end{table}

答案1

姆韦

\documentclass {article}
\usepackage{multirow}
\usepackage{booktabs}
\usepackage{tabulary}
\usepackage{siunitx}

\begin{document}
\centering
\section*{Poor man's version:} 

\begin{tabular}{|c|c c |c c|}\hline
\multirow{2}{*}{\parbox{6em}{\centering Performance measure}} & \multicolumn{2}{c|}{c}  &  \multicolumn{2}{c|}{a}   \\\cline{2-5}
       & $\hat{\mu}$ & $\hat{\sigma}$ & $\hat{\mu}$ & $\hat{\sigma}$ \\\hline
 MSE & 0.0589 & 0.0302 & 0.0611 &0.0456 \\ 
 Bias & 0.0243 & -0.0415  &0.0332 & -0.0496 \\
 SD & 0.242 & 0.169 & 0.245 & 0.208 \\\hline
\end{tabular}

\section*{Glamorous version:}


\begin{tabulary}{\linewidth}{LS[table-format=1.4]SSS}\toprule
\multirow{2}{*}{\parbox{5em}{ Performance measure}} 
 & \multicolumn{2}{c}{c}  &  \multicolumn{2}{c}{a}   \\
 \cmidrule(rl){2-3} \cmidrule(rl){4-5}
      & {$\hat{\mu}$} & $\hat{\sigma}$ & $\hat{\mu}$ & $\hat{\sigma}$ \\\midrule
 MSE & 0.0589 & 0.0302 & 0.0611 &0.0456 \\ 
 Bias & 0.0243 & -0.0415  &0.0332 & -0.0496 \\
 SD & 0.242 & 0.169 & 0.245 & 0.208 \\\bottomrule
\end{tabulary}
\end{document}

答案2

你想要这样的东西吗?

\documentclass[12pt]{article}
\usepackage[a4paper, total={180mm,257mm},left=15mm,top=20mm]{geometry}
\usepackage{stix}%<-- for using the Ldsh arrow
\usepackage{tabularray}

\begin{document}
    \begin{tblr}{colspec={Q[3cm,l]Q[1.5cm,l]Q[1.5cm,l]Q[1.5cm,l]Q[1.5cm,l]},cell{1}{2,4}={r=1,c=2}{l},rows={1cm,m},hlines,vlines,hline{2}={leftpos=-1, rightpos=-1},hline{2}={1}{leftpos=0, rightpos=0},cell{1}{1}={r=2,c=1}{l,h},vline{3,5}={2-5}{abovepos=-3, belowpos=-3}}
            \raisebox{-7pt}{C} & C & C & C & C \\
            C & a & b & a     &     $b^{\Ldsh}$ \\
            A &   &$\Ldsh$    &    &$\Ldsh$    \\
            B &   &$\Ldsh$    &    &$\Ldsh$    \\
            C &   &$\Ldsh$    &    &$\Ldsh$    \\
    \end{tblr}
\end{document}

相关内容