[Tex/LaTex] \arraystretch in conjunction with booktabs

booktabstables

I'm trying to enlarge the row-height of my booktabs-table but \arraystretch does this asymmetrically.

I am slightly confused because this is an obvious problem to me and I couldn't find any solutions or workarounds. So please let it pass if I'm just clouded…

image

\documentclass[preview]{standalone}                                                                                                 
\usepackage{booktabs}
%
\begin{document}
%\renewcommand{\arraystretch}{3} 
\begin{tabular}{lr}
    \toprule
    parameter & order of magnitude\\\midrule
    density \hfill$\varrho$ & $0$\\
    velocity \hfill$v$& test\\
    diameter \hfill$d$& test\\
    viscosity \hfill$\mu$ & $0$\\\bottomrule
\end{tabular}
\end{document}

Thanks and cheers,
Stephan

Best Answer

The symmetrical way can be obtained with the cellspace package: it lets you decide on a minimal vertical spacing between the top of a cell and the bottom of the cell above, and between the bottom of a cell and the top of the cell below. You then have to prefix the specifiers of the columns for which it is useful with the letter S. Note that these minimal spacings can be set independently for the top and the bottom of cells. Also, it conflicts with the S qualifier from the siunitx package, which introduces the letter C as a replacement in its last version (ยง 7.11 of the siunitx doc):

\documentclass[preview]{standalone}
\usepackage{booktabs}
\usepackage{cellspace}
\setlength\cellspacetoplimit{4pt}
\setlength\cellspacebottomlimit{4pt}
%
\begin{document}
%\renewcommand{\arraystretch}{3}
\begin{tabular}{SlSr}
    \toprule
    parameter & order of magnitude\\\midrule
    density \hfill$\varrho$ & $0$\\
    velocity \hfill$v$& test\\
    diameter \hfill$d$& test\\
    viscosity \hfill$\mu$ & $0$\\\bottomrule
\end{tabular}
\end{document} 

enter image description here