
Me pregunto si hay una manera de utilizar diferentes parámetros de \sisetup{} para cada columna de una tabla. Por ejemplo, me gustaría usar:
\sisetup{round-mode=places,
round-precision=2,
fixed-exponent = 6,
scientific-notation = fixed,
}
para la primera columna de mi tabla y una versión ligeramente diferente:
\sisetup{round-mode=places,
round-precision=2,
fixed-exponent = 8,
scientific-notation = fixed,
}
para la segunda columna de este último.
Ex:
\begin{table}[H]
\centering
\sisetup{round-mode=places,
round-precision=2,
fixed-exponent = 6,
scientific-notation = fixed,
}
\sisetup{round-mode=places,
round-precision=2,
fixed-exponent = 8,
scientific-notation = fixed,
}
\begin{tabular}{SSS}
\hline A & a & b \\ \hline
$B$ & -8940513.51965462 & -393467529.743240\\
$C$ & -8295841.85412406 & -365095852.079073 \\ \hline
\end{tabular}
\end{table}
Respuesta1
¡Bienvenido a TeX.SE!
Puedes dividirlo sisetup
en dos partes:
- común (global), qué configuraciones se utilizan en todas
S
las columnas - local, donde puede agregar o sobrescribir configuraciones comunes cuando sea necesario:
\documentclass{article}
\usepackage{booktabs} % added
\usepackage{siunitx}
\begin{document}
\begin{table}[ht]
\sisetup{round-mode=places, % common settings
round-precision=2,
fixed-exponent = 6,
scientific-notation = fixed,
}
\begin{tabular}{l S[fixed-exponent = 8] % <--- local
S}
\toprule
A & {a} & {b} \\
\midrule
$B$ & -8940513.51965462 & -393467529.743240 \\
$C$ & -8295841.85412406 & -365095852.079073 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}
Respuesta2
Desea utilizar algunas configuraciones comunes para toda la tabla y algunas locales para la columna específica. También desea especificar la cantidad de dígitos, para que los encabezados se coloquen correctamente y el espacio sea óptimo. Por supuesto, tal configuración se realizará.posteriormente, después de observar lo que realmente produce la mesa.
\documentclass{article}
\usepackage{booktabs}
\usepackage{siunitx}
\begin{document}
\begin{table}[htp]
% common settings for this table
\sisetup{
round-mode=places,
round-precision=2,
scientific-notation = fixed,
}
\begin{tabular}{
l
S[fixed-exponent = 8,table-format=-1.2e1]
S[fixed-exponent = 6,table-format=-3.2e1]
}
\toprule
A & {a} & {b} \\
\midrule
$B$ & -8940513.51965462 & -393467529.743240 \\
$C$ & -8295841.85412406 & -365095852.079073 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}