
Simplemente no puedo alinear correctamente la tercera columna, ¿alguien sabe cómo, por favor?
\documentclass[a4paper,12pt]{report}
\usepackage{multirow}
\usepackage{siunitx,booktabs}%for table decimals number
\usepackage[export]{adjustbox}
\begin{table}[!htbp]
\centering
\begin{tabular}{>{\bfseries}l S[table-format=-1.2(2)] S[table-format=-1.1e1]}
\toprule
{\textbf{Res.}} & {$\boldsymbol{\beta}$} & {$\boldsymbol{\chi^{2}}$} \\
\midrule
4 & -0.60(14) & 1738 \\
5 & -0.39(11) & 1348\\
6 & -0.32(10) & 612 \\
7 & -0.54(17) & 1159 \\
8a & -0.36(10) & 621 \\
9 & -0.50(14) & 800 \\
10 & -0.26(14) & 544 \\
11a & -0.54(16) & -1140 \\
11b & -0.50(15) & 867 \\
\bottomrule
\end{tabular}
\caption[]{}
\end{table}
Respuesta1
Intentaré explicar el formato de los números a siunitx
partir de su código:
table-format=-1.1e1
significa que usa notación científica (el e
es para exponent
), con una mantisa que posiblemente tenga un —
signo, 1 digit
antes del punto decimal ( 1.
) y 1 digit
después del punto decimal ( .1
). El uso del exponente 1 digit
(esa es la e1
parte del formato).
table-format=-1.2(2)
no usa notación científica, pero tiene una uncertainty part
que usa 2 digits
.
Por lo tanto, para su última columna, debería tener
table-format=-4.0
(cuatro dígitos posiblemente con un signo — y sin parte decimal).
Respuesta2
Cambiar S[table-format=-1.1e1]
a S[table-format=-4.0]
. -4.0
significa: "Deje suficiente espacio para números de cuatro dígitos precedidos por un -
símbolo, y no deje ningún espacio para dígitosdespuésel marcador decimal" (ya que estamos tratando con números enteros).Por quécolocar -4.0
? Es porque el número más grande en la tercera columna (en términos de valor absoluto) es "-1140".
\documentclass[a4paper,12pt]{report}
\usepackage{bm,siunitx,booktabs}%for table decimals number
\begin{document}
\begin{table}[!htbp]
\centering
\begin{tabular}{>{\bfseries}l
S[table-format=-1.2(2)]
S[table-format=-4.0] }
\toprule
{\textbf{Res.}} & {$\bm{\beta}$} & {$\bm{\chi^{2}}$} \\
\midrule
4 & -0.60(14) & 1738 \\
5 & -0.39(11) & 1348\\
6 & -0.32(10) & 612 \\
7 & -0.54(17) & 1159 \\
8a & -0.36(10) & 621 \\
9 & -0.50(14) & 800 \\
10 & -0.26(14) & 544 \\
11a & -0.54(16) & -1140 \\
11b & -0.50(15) & 867 \\
\bottomrule
\end{tabular}
\caption[]{}
\end{table}
\end{document}