我使用tabularray
包制作表格,其中一列被格式化为方程式。当我si
在此列中使用格式时,出现错误:
! Missing $ inserted.
<inserted text>
$
l.22 ^^I\end
{talltblr}
?
我的代码是:
\documentclass{article}
\usepackage{tabularray}
\UseTblrLibrary{booktabs, siunitx}
\begin{document}
\begin{table}
\begin{talltblr}[
caption={table},
label={tab:table1},
remark{Hello}={How are you today?}
]{
colspec={X[c] X[c,$,si={table-format={1.5}}] X[c,$]}
}
\toprule
&{{{Column one}}}&{{{Column two}}}\\
\midrule
{{{One}}}&-1.2552525\dot{5}&-102.3456789\dot{3}\\
{{{Two}}}&-66.666\dot{3}&-5.2222708\dot{3}\\
{{{Three}}}&-3.4321&-11.12358\dot{3}\\
{{{Four}}}&-91.01&-702.04\\
{{{Five}}}&-1.2&-5.4067291\dot{6}\\
\bottomrule
\end{talltblr}
\end{table}
\end{document}
有没有办法使列在小数点处对齐?
答案1
像这样?
通过使用tabularray
软件包版本 2022C。与您的 MWE 相比,更改标记为% <---
:
\documentclass[12pt]{article}
\usepackage{tabularray}
\UseTblrLibrary{booktabs, siunitx}
\begin{document}
\begin{table}
\sisetup{parse-numbers=false} % <---
\begin{talltblr}[
caption={table},
label={tab:table1},
remark{Hello}={How are you today?}
]{colspec={c X[c,si={table-format=-2.7}] % <---
X[c,si={table-format=-3.7}]}, % <---
row{1} = {guard}
}
\toprule
& Column one & Column two \\
\midrule
One & -1.2552525\dot{5}& -102.3456789\dot{3} \\
Two & -66.666\dot{3} & -5.2222708\dot{3} \\
Three & -3.4321 & -11.12358\dot{3} \\
Four & -91.01 & -702.04 \\
Five & -1.2 & -5.4067291\dot{6} \\
\bottomrule
\end{talltblr}
\end{table}
\end{document}