
我將以下 LaTeX 程式碼作為我的文章的一部分,以便為我的模擬結果建立一個表格。我發現很難包含以下內容:TY=57.48、GH=37.51、XYZ= 5.01 位於第一列 n=50000 的正下方。具體按照這個順序(垂直排列):
n=50000
TY=57.48
GH=37.51
XYZ= 5.01
謝謝!
\usepackage{placeins}
\usepackage{amsmath,hyperref}
\setlength{\arrayrulewidth}{.3mm}
\setlength{\tabcolsep}{4pt}
\renewcommand{\arraystretch}{1.2}
\usepackage[T1]{fontenc}
\usepackage{subfigure}
\usepackage[top=1.5cm,bottom=2cm,right=2cm,left=1.8cm]{geometry}
\usepackage{tabularx}
\begin{document}
\begin{table}[!h]
\begin{center}
\begin{tabular}{ p{2cm} |c c c c c c c c}
\hline
\hline
& \emph{True Value}& \emph{Estimate} & \emph{ RMSE } & \emph{Bias } & \emph{ $\% $Bias } & \emph{SE } &\emph{Coverage} & \emph{ CIL } \\
\hline
%-----------------------------------------------------------------------------
\multirow{2}{*}{$n=50000$ } & $r_1= 0.033 $& $\hat{r_1}= 0.03339$ & $0.00161$ &$ 0.000060$ & $0.18146$ & $0.00162$ & $ 0.954$ & $0.00635$\\
& $r_2=0.040$ & $\hat{r_2}=0.04012$ & $ 0.00580$ &$0.000116$ & $ 0.29026$ & $0.00580 $ & $0.952$ & $0.02274$ \\
\cline{1-9}
\hline
\end{tabular}
\end{center}
\end{table}
答案1
訣竅是\multirow{2}{=}{}
與\arraystretch =2.4
.
另一方面,使用 booktabs 規則看起來更好,恕我直言:
\documentclass{article}
\usepackage{multirow}
\usepackage{amsmath}
\renewcommand{\arraystretch}{2.4}
\usepackage[top=1.5cm,bottom=2cm,right=2cm,left=1.8cm]{geometry}
\usepackage{booktabs}
\begin{document}
\begin{tabular}{@{}p{2cm}@{\qquad}c c c c c c c c@{}}\toprule
& \emph{True Value}& \emph{Estimate} & \emph{ RMSE } & \emph{Bias } & \emph{ $\% $Bias } & \emph{SE } &\emph{Coverage} & \emph{ CIL } \\
\cmidrule{2-9}
\multirow{2}{=}{\parbox{2cm}{$n=50000$ $\text{TY}=57.48$ $\text{GH}=37.51$ $\text{XYZ}= 5.01$}} & $r_1= 0.033 $& $\hat{r_1}= 0.03339$ & $0.00161$ &$ 0.000060$ & $0.18146$ & $0.00162$ & $ 0.954$ & $0.00635$\\
& $r_2=0.040$ & $\hat{r_2}=0.04012$ & $ 0.00580$ &$0.000116$ & $ 0.29026$ & $0.00580 $ & $0.952$ & $0.02274$ \\
\cline{1-9}
\hline
\end{tabular}
\end{document}