我正在尝试使用 siunitx 包来做到这一点,但是在对齐方面遇到了麻烦——我不知道如何将数字向左对齐,并且忽略小数点对齐,而我还想像图片上那样将 10 的基数很好地对齐。
我的代码:
\sisetup{group-minimum-digits = 4, output-decimal-marker = {,}, exponent product = \cdot, inter-unit-product={}\cdot{}, table-number-alignment = left, table-figures-exponent=1}
\begin{tabular}{|l|c|S[table-format = 9.10(2)e2]s[table-unit-alignment = left]|}
\hline
\multicolumn{1}{|c|}{Název} & Zn. & \multicolumn{2}{c|}{Hodnota} \\
\hline
Atomová hmotnostní & $ m_{\textrm{u}} $ & 1.66053886(28)e-27 & \si{\kilogram} \\
Avogadrova & $ N_{\textrm{A}} $ & 6.0221415(10)e23 & \si{\per\mole} \\
Bohrův poloměr & $ a_{\textrm{0}} $ & 0.5291772108(18)e-10 & \si{\meter} \\
Elementární náboj & $ e $ & 1.60217653(14)e-19 & \si{\coulomb} \\
Faradayova & $ F $ & 96485.3383(83) & \si{\coulomb\per\mole} \\
Gravitační & $ G $ & 6.6742(10)e-11 & \si{\newton\square\meter\per\square\kilogram} \\
Permeabilita vakua & $ \mu_{\textrm{0}} $ & 4\pi e-7 & \si{\newton\per\square\ampere} \\
Permitivita vakua & $ \varepsilon_{\textrm{0}} $ & {$ 1/\mu_{\textrm{0}}c $} & \si{\farad\per\meter} \\
Planckova & $ h $ & 6.6260673(11)e-34 & \si{\joule\second} \\
Planckova redukovaná & $ \hbar $ & 1.05457168(18)e-34 & \si{\joule\second} \\
Plynová molární & $ R_{\textrm{m}} $ & 8.314471(15) & \si{\joule\per\mole\per\kelvin} \\
Rychlost světla ve vakuu & $ c $ & 299792458 & \si{\meter\per\second} \\
Stefanova-Boltzmanova & $ \sigma $ & 5.670400(40)e-8 & \si{\meter\kelvin} \\
\hline
\end{tabular}
知道该怎么做吗?
答案1
您想要的是这种对齐方式吗?我将数字列分成一个左对齐的列(用于尾数)和一个 S 列(用于 10 的幂部分):
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[showframe]{geometry}
\usepackage{siunitx, array}
\usepackage{booktabs}
\usepackage{amsmath}
\begin{document}
\sisetup{group-minimum-digits = 4, output-decimal-marker = {,}, exponent-product = \cdot, inter-unit-product={} · {}, table-number-alignment = left, table-figures-exponent=1}
\setlength{\extrarowheight}{2pt}
\newcommand{\specialcell}[1]{ \multicolumn{2}{>{$}l<{$}}{#1}}
\begin{tabular}{|l|c| >{$}l<{$}@{${} · {}\mkern-22mu$}S[table-format =1 e-2, table-number-alignment = left]@{\hskip0.2em}l|}%S[table-unit-alignment = left]
\hline
\multicolumn{1}{|c|}{Název} & Zn. & \multicolumn{3}{c|}{Hodnota} \\
\hline
Atomová hmotnostní & $ m_{\textrm{u}} $ & 1.66053886(28) & e-27 & \si{\kilogram} \\
Avogadrova & $ N_{\textrm{A}} $ & 6.0221415(10) & e23 & \si{\per\mole} \\
Bohrův poloměr & $ a_{\textrm{0}} $ & 0.5291772108(18) & e-10 & \si{\meter} \\
Elementární náboj & $ e $ & 1.60217653(14) & e-19 & \si{\coulomb} \\
Faradayova & $ F $ & \specialcell{96485.3383(83)} & \si{\coulomb\per\mole} \\
Gravitační & $ G $ & 6.6742(10) & e-11 & \si{\newton\square\meter\per\square\kilogram} \\
Permeabilita vakua & $ \mu_{\textrm{0}} $ & 4π& e-7& \si{\newton\per\square\ampere} \\
Permitivita vakua & $ \varepsilon_{\textrm{0}} $ & \specialcell{1/\mu_{\textrm{0}}c } & \si{\farad\per\meter} \\
Planckova & $ h $ & 6.6260673(11) & e-34 & \si{\joule\second} \\
Planckova redukovaná & $ \hbar $ & 1.05457168(18) & e-34 & \si{\joule\second} \\
Plynová molární & $ R_{\textrm{m}} $ & \specialcell{8.314471(15)} & \si{\joule\per\mole\per\kelvin} \\
Rychlost světla ve vakuu & $ c $ & \specialcell{299792458} & \si{\meter\per\second} \\
Stefanova-Boltzmanova & $ σ$ & 5.670400(40) & e-8 & \si{\meter\kelvin} \\
\hline
\end{tabular}
\end{document}