Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

ave a table with a table in which I use \numrange of the siunitx package. I would like to center align that column at the range-phrase. If I align it left, it sort of works, but if I align it center, it is not good enough. How can I solve this?

\documentclass{book}
\usepackage[T1]{fontenc}
\usepackage{siunitx} 


\begin{document}
\begin{table}
\caption{All measured and their estimated outcome variables during 30 minutes of chair exercises}
\label{table:outcomes}
\sisetup{
range-phrase = --
}

\begin{tabular}{
                l
                c
                c
                c
                %S[parse-numbers = false,input-decimal-markers={-},output-decimal-marker = \text{--}]
                S[table-format=3.1, table-text-alignment=center]
                }

\multicolumn{1}{l}{}&
\multicolumn{1}{c}{Mean}&
\multicolumn{1}{c}{SD}&
\multicolumn{1}{c}{Median}&
\multicolumn{1}{c}{Range}\\

\hline


\%vo2max (mL/min) & 66.0 & 16.5 & 66.9 & \numrange{30.3}{115.8}\\



&&& 54.6 & \numrange{30.3}{77.7}\\


&&& 69.9 & \numrange{43.8}{115.8} \\



\hline




\end{tabular}
\end{table}

\end{document}
share|improve this question
1  
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. –  Marco Daniel Sep 30 '12 at 9:55
1  
I'm sorry, I will provide a working example immediately.. –  Duikboot Sep 30 '12 at 10:00
1  
@Duikboot What's mymemoir? –  egreg Sep 30 '12 at 10:28
    
It's a modified memoir documentclass. I'll adjust it.. –  Duikboot Sep 30 '12 at 10:54

1 Answer 1

up vote 3 down vote accepted

The following isn't a direct solution to the problem you're trying to solve. Instead, I suggest you consider pursuing a different solution. Why? Personally, I think that if one tries to present an entire range of numbers in a single column, too much numerical information is being crammed into a confined space. In order to give your readers a chance to really parse and absorb the data you're presenting, it's probably preferable for you to list the minima and maxima in separate columns -- joined, of course, by an overall header that says "Range". The following MWE illustrates what I'm trying to express.

The MWE also uses the \toprule, \midrule, \cmidrule, and \bottomrule macros of the booktabs package to generate well-spaced "rules" (horizontal lines) of varying thickness. These make a table immediately much more professional-looking, compared to what's achievable with \hline and \cline (the basic LaTeX rule-drawing commands).

enter image description here

\documentclass{book}
\usepackage[T1]{fontenc}
\usepackage{siunitx,booktabs} 
% booktabs package for well-spaced horizontal rules

\begin{document} 
\begin{table}
\caption{All measured and their estimated outcome variables during 30 minutes of chair exercises}
\label{table:outcomes}

\medskip\centering
\sisetup{table-format=2.1}
\begin{tabular}{l SSSS S[table-format=3.1]}
\toprule
& {Mean}&{SD} & {Median}& \multicolumn{2}{c}{Range}\\
\cmidrule{5-6}
& & & & {Lower} & {Upper}\\
\midrule
\%vo2max (mL/min) & 66.0 & 16.5 & 66.9 & 30.3 & 115.8\\
&&& 54.6 & 30.3 &  77.7\\
&&& 69.9 & 43.8 & 115.8 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}
share|improve this answer
    
I concur. While \numrange can be handy in text, tables are a different matter; maybe one can use it in a column with numerical data, in case no precise value can be reported for the specific case. If all entries are a range, then it's better to split into two columns. –  egreg Sep 30 '12 at 12:49
    
Thanks, it helped a lot –  Duikboot Sep 30 '12 at 14:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.