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}

overfull es에 대한 경고 없이 컴파일됩니다 \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}

테이블 본문에서 추가 중괄호를 제거하려면 괄호를 사용하십시오.

관련 정보