summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/siunitx/siunitx.tex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/siunitx/siunitx.tex')
-rw-r--r--macros/latex/contrib/siunitx/siunitx.tex59
1 files changed, 59 insertions, 0 deletions
diff --git a/macros/latex/contrib/siunitx/siunitx.tex b/macros/latex/contrib/siunitx/siunitx.tex
index 76afc34861..86db9afa6c 100644
--- a/macros/latex/contrib/siunitx/siunitx.tex
+++ b/macros/latex/contrib/siunitx/siunitx.tex
@@ -3219,6 +3219,54 @@ also be done using \pkg{siunitx} (Table~\ref{tbl:xmpl:unrel}).
\end{table}
\end{LaTeXdemo}
+\subsection{Regression tables%
+ \label{sec:hint:regression}}
+
+In some subject areas, it is common to present regression values or similar,
+which feature an uncertainty value in parenthesis on the line below the main
+value. As these are separate cells, they cannot be entered using \pkg{siunitx}
+in one value. There are a couple of ways of formatting them using the package,
+depending on whether the values also need to be parsed.
+
+Where parsing is not required, the most straight-forward method is available:
+provide a model format allowing space for an extra \enquote{digit} at each end,
+which will then allow for the parenthesis. If a sign is applied to the number,
+it may not be necessary to add a \enquote{digit} for the leading bracket. If
+parsing is also required, this approach cannot be employed. Instead, the
+parsing needs to be adjusted such that |(| and |)| are not treated as part of
+the number, and \opt{table-align-text-pre} is set to |false| such that these
+will be placed next to the numerical part. These methods are illustrated in
+Table~\ref{tab:regression}.
+
+\begin{LaTeXdemo}[code and float]
+ \begin{table}
+ \caption{Regression tables%
+ \label{tab:regression}
+ }
+ \begin{tabular}
+ {
+ @{}
+ S[table-format = 2.4, parse-numbers = false]
+ S[table-format = +1.4, parse-numbers = false]
+ S[
+ input-open-uncertainty = ,
+ input-close-uncertainty = ,
+ minimum-decimal-digits = 3, % (
+ table-format = +1.3),
+ table-align-text-pre = false
+ ]
+ @{}
+ }
+ \toprule
+ {Header} &{Header} & {Header} \\
+ \midrule
+ 1.234 & -1.234 & -1.23 \\
+ (0.053) & (0.053) & (0.053) \\
+ \bottomrule
+ \end{tabular}
+ \end{table}
+\end{LaTeXdemo}
+
\subsection{Maximising performance%
\label{sec:hint:performance}}
@@ -3235,6 +3283,17 @@ systems:
]{7.3}{\Hz}
\end{LaTeXdemo}
+For tables, any settings that can be given before the table are only parsed once,
+whereas given in the optional argument to |S| they are read in ever cell. As such,
+you should favour
+\begin{LaTeXdemo}[code only]
+ \begin{table}
+ \sisetup{...}
+ \begin{tabular}{S}
+ ...
+\end{LaTeXdemo}
+for common settings.
+
\subsection{Special considerations for the \cs{kWh} unit%
\label{sec:hint:kWh}}