siunitx: (-0.123) と投稿テキストを 1.234*** と組み合わせると役に立たない結果になります

siunitx: (-0.123) と投稿テキストを 1.234*** と組み合わせると役に立たない結果になります

次の MWE を検討してください。

\documentclass{article}
\usepackage{siunitx}
\begin{document}
\begin{tabular}{|S[table-format=-1.3,
                  table-space-text-pre ={(-},  % hasn't  effect ?
                  table-space-text-post={***},% hasn't  effect ?
                  input-symbols={( )},
                  explicit-sign,
                  parse-numbers=false,
                 ]|}
\hline
  1.248\textsuperscript{***}  \\
(-0.124)                        \\
\hline
\end{tabular}
\end{document}

それは与えます

ここに画像の説明を入力してください

使える結果を得る方法はありますか?

答え1

この問題は、括弧 (前後の部分) を中括弧で囲むことで解決できます。

\documentclass{article}
\usepackage{siunitx}
\begin{document}
\begin{tabular}{|S[table-format=-1.3,
                  table-space-text-pre ={(},
                  table-space-text-post={\textsuperscript{***}},
                  explicit-sign,
                 ]|}
\hline
  1.248\textsuperscript{***} \\
{(}-0.124{)}                 \\
\hline
\end{tabular}
\end{document}

過剰容量に関する警告なしでコンパイルされます\hbox

結果

中括弧は、括弧記号が不確実性記号として解析されるのを防ぎます。不確実性の入力記号を変更して、表本体の中括弧を回避することができます。

\documentclass{article}
\usepackage{siunitx}
\begin{document}
\begin{tabular}{|S[table-format=-1.3,
                  table-space-text-pre ={(},
                  table-space-text-post={\textsuperscript{***}},
                  explicit-sign,
                  input-open-uncertainty={[},
                  input-close-uncertainty={]},
                 ]|}
\hline
  1.248\textsuperscript{***} \\
(-0.124)                     \\
\hline
\end{tabular}
\end{document}

表の本体にある余分な括弧を取り除きたい場合は、括弧を

関連情報