我的表格中同一单元格中的数字如下: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}