\pm에 따라 숫자를 정렬하지만 포인트에 따라 정렬하지 않는 방법은 무엇입니까?

\pm에 따라 숫자를 정렬하지만 포인트에 따라 정렬하지 않는 방법은 무엇입니까?

\pm에 따라 숫자를 정렬하지만 포인트에 따라 정렬하지 않는 방법은 무엇입니까? 각 행의 소수점 이하 자릿수도 달라야 합니다.

\documentclass{article}
\usepackage{siunitx}


\begin{document}
\begin{table}
\caption{}
\centering
\small
\sisetup{separate-uncertainty}
\begin{tabular}{lS[table-format = 5.4(1)]}
\hline\hline\noalign{\smallskip}
Parameter & Value \\
\noalign{\smallskip}\hline\noalign{\smallskip} 
A   & 26.5 \pm 2.0      \\
B   & 11.102 \pm 1.2 \\
C   & 53839  \pm 550 \\
D   & 0.5863     \pm 0.016 \\

\noalign{\smallskip}\hline\noalign{\smallskip}
\end{tabular}
\end{table}

\end{document}

여기에 이미지 설명을 입력하세요

답변1

처럼이 답변제안에 따르면 S패키지에서 제공하는 열에는 siunitx주로 숫자를 소수 구분 기호로 조정하는 특정 정렬 기능만 제공되는데 이는 원하는 것이 아닙니다.

따라서 위에 링크된 좋은 답변을 조정하고 패키지를 사용하지 않고 수동으로 정렬을 수행하는 것이 좋습니다 siunitx. 기호 뒤의 숫자를 어떻게 정렬하고 싶은지 모르기 때문에 \pm아래에 두 가지 대체 솔루션을 제공합니다. 또한 패키지를 살펴보는 것이 좋습니다 booktabs.

\documentclass{article}
%\usepackage{siunitx}
\usepackage{booktabs}

\begin{document}

\begin{tabular}{ l r @{\,\( \pm \)\,} r }
\toprule
{Parameter} & \multicolumn{2}{c}{Value} \\
\midrule
A   & 26.5   & 2.0   \\
B   & 11.102 & 1.2   \\
C   & 53839  & 550   \\
D   & 0.5863 & 0.016 \\
\bottomrule
\end{tabular}

\bigskip

\begin{tabular}{ l r @{\,\( \pm \)\,} l }
\toprule
{Parameter} & \multicolumn{2}{c}{Value} \\
\midrule
A   & 26.5   & 2.0   \\
B   & 11.102 & 1.2   \\
C   & 53839  & 550   \\
D   & 0.5863 & 0.016 \\
\bottomrule
\end{tabular}

\end{document}

여기에 이미지 설명을 입력하세요

답변2

siunitx불확실성 표시를 중심으로 숫자를 중앙에 두는 기능을 구현한 적이 없습니다 . 아마도 그럴 수도 있지만 나는 그것에 대해 모릅니다. 제가 생각할 수 있는 유일한 해결 방법은 숫자를 두 열로 나누어 효과를 얻는 것입니다. siunitx소수점 이하 자릿수까지 반올림하는 데 사용할 수 있습니다 . 그 외에는 siunitx필수가 아닙니다

여기에 이미지 설명을 입력하세요

\documentclass{article}
\usepackage{siunitx}
\newcommand\ustrut{\rule{0pt}{12pt}}
\newcommand\lstrut{\rule[-6pt]{0pt}{12pt}}


\begin{document}
\begin{table}
  \sisetup{
    round-mode=figures,
    round-precision=3,
    table-alignment-mode=none,
    separate-uncertainty,
  }
  \caption{}
  \centering
  \small
  \begin{tabular}{
      l
      S[table-number-alignment=right]
      @{\(\;\pm\;\)}
      S[table-number-alignment=left]
    }
    \hline\hline
    \ustrut Parameter & \multicolumn{2}{c}{Value\lstrut}\\
    \hline\ustrut
    A   &   26.5 & 2.0 \\
    B   & 11.102 & 1.2 \\
    C   &  53839 & 550 \\
    D   & 0.5863 & 0.016 \lstrut \\
    \hline
  \end{tabular}
  \end{table}
\end{document}

관련 정보