
테이블의 각 열에 대해 \sisetup{}의 다른 매개변수를 사용할 수 있는 방법이 있는지 궁금합니다. 예를 들어 다음을 사용하고 싶습니다.
\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{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}
답변1
TeX.SE에 오신 것을 환영합니다!
sisetup
두 부분으로 나눌 수 있습니다 :
S
공통(전역), 모든 열에 사용되는 설정- 로컬(필요한 경우 공통 설정을 추가하거나 덮어쓸 수 있음)
\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}
답변2
전체 테이블에 대해 일부 공통 설정을 사용하고 특정 열에 대해 일부 로컬 설정을 사용하려고 합니다. 또한 머리글이 올바르게 배치되고 간격이 최적이 되도록 자릿수를 지정하려고 합니다. 당연히 그런 설정이 되겠지만사후, 테이블이 실제로 무엇을 생성하는지 살펴본 후.
\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}