![重复的小数标记(siunitx)](https://linux22.com/image/353840/%E9%87%8D%E5%A4%8D%E7%9A%84%E5%B0%8F%E6%95%B0%E6%A0%87%E8%AE%B0%EF%BC%88siunitx%EF%BC%89.png)
我的表格中同一单元格中的数字如下:23,3 (3,5)。当我尝试使用 siunitx 对齐小数时,它显示以下消息:
输入中有重复的小数标记“,”
错误在哪里呢?
\documentclass[12pt,oneside,letterpaper]{article}
\usepackage{siunitx}
\sisetup{table-number-alignment = center, input-symbols=(), output-decimal-marker={,}}
\begin{document}
\begin{landscape}
\begin{longtable}[c]{l
S[table-format=3.1]
S[table-format=3.1]
S[table-format=1.3]}
\caption{my-caption). \label{long-representativity}}\\
\toprule
\multicolumn{1}{c}{{}} & \multicolumn{1}{c}{{LTF\textsuperscript{a} at 3 years (n = 129)}} & \multicolumn{1}{c}{{Still followed at 3 years (n = 246)}} & \multicolumn{1}{c}{{p-value}}\\ \midrule
\endfirsthead
\multicolumn{4}{l}{Sociodemographics} \\ \midrule
\\
Age, mean (s.d) & 23,3 (3,5) & 23,3 (3,6) & 0,849 \\
答案1
siunitx
将扫描小数点,即逗号。一个条目中不能有两个逗号,除非将其中一个逗号括在一个组中。
\documentclass[12pt,oneside,letterpaper]{article}
\usepackage{pdflscape}
\usepackage{longtable}
\usepackage{booktabs}
\usepackage{siunitx}
\sisetup{table-number-alignment = center, input-symbols=(), output-decimal-marker={,}}
\begin{document}
\begin{landscape}
\begin{longtable}[c]{l
S[table-format=3.1]
S[table-format=3.1]
S[table-format=1.3]}
\caption{my-caption). \label{long-representativity}}\\
\toprule
\multicolumn{1}{c}{{}} &
\multicolumn{1}{c}{{LTF\textsuperscript{a} at 3 years (n = 129)}} &
\multicolumn{1}{c}{{Still followed at 3 years (n = 246)}} &
\multicolumn{1}{c}{{p-value}} \\
\midrule
\endfirsthead
\multicolumn{4}{l}{Sociodemographics} \\
\midrule
\\
Age, mean (s.d) & 23,3 {(3,5)} & 23,3 {(3,6)} & 0,849 \\
\end{longtable}
\end{landscape}
\end{document}