]1
你好。有人能帮我提供这张表的代码以及 torr 和 sccm 等单位的软件包吗
\usepackage {multirow, multicolumn}
\usepackage {siunitx, mhchem}
\begin{table}[htb]
\centering
\caption{Mean Roughness}\label{tab:openrough}
\begin{tabularx}{\textwidth}{@{}lll@{}}\hline
\multicolumn{2}{c}{Process parameters} & mean roughness (\si{\nm}) \\
Pressure (\torr) & Nitrogen flow rate (sccm) & \\
\midrule
2 & 50 & 20 \\
2 & 50 & 27 \\
\bottomrule
\end{tabularx}
\end{table}
答案1
使用\multirow
和\makecell
命令,您可以实现以下目标:(我还使用该siunitx
包定义了两个新单位,并使用S
类型列来更好地对齐数字。)
\documentclass{article}
\usepackage{makecell}
\usepackage{siunitx}
\usepackage{multirow}
\usepackage{booktabs}
\DeclareSIUnit\sccm{sccm}
\DeclareSIUnit\torr{torr}
\begin{document}
\begin{tabular}{cS[table-format=3]S[table-format=2.2]@{${}\pm{}$}S[table-format=2.2]}
\toprule
\multicolumn{2}{c}{{process parameters}} & \multicolumn{2}{c}{\multirow{3}{*}{\makecell[cc]{mean \\ roughness \\(in \si{\nm})}}}\\
\cmidrule(rl){1-2}
\makecell[cc]{pressure\\ (in \si{\torr})} & {\makecell[cc]{nitrogen gas flow \\(in \si{\sccm})}}\\
\midrule
\multirow{2}{*}{2} & 50 & 21.7 & 12.75\\
& 150 & 20.5 & 4.8\\
\midrule
\multirow{2}{*}{9} & 50 & 51.14 & 17.9 \\
& 150 & 24.8 & 12.7\\
\bottomrule
\end{tabular}
\end{document}