3

I have a table which has cases in one of the columns as suggested here. The issue I am facing is that the first column has some text, and using cases leaves a blank space inline with text from first column. I have tried the solution suggested here, but is does not solve the problem. Is there any way to get the second column cases horizontally aligned with first column text. Also to remove the vertical space after the cases row and the next row.

enter image description here

MWE

\documentclass{article}

\usepackage{amsmath} \usepackage{booktabs} \usepackage{siunitx} \begin{document}

\renewcommand{\arraystretch}{1.3} \begin{tabular}{p{5.5cm}p{5cm}} Velocity of light in vacuum & $c = \SI{2.998d8}{\meter\per\second}$\ Gravitational constant & [ G = \begin{cases} \SI{6.67d-11}{\meter\cubed\per\kilo\gram\per\second\squared} \ \SI{6.67d-8}{\centi\meter\cubed\per\gram\per\second\squared}\end{cases} ] \ Acceleration of free fall & $ g = \SI{9.807}{\meter\per\second\squared}$ \\end{tabular}

\end{document}

Damitr
  • 1,889
  • 2
    This is because you use a display equation: \[ ... \]. If you use $ ... $ you will have it inline, just like the rest of it. (You will have to make the column a bit wider, e.g. p{5.5cm}, to have it in one line) – Οὖτις Mar 10 '23 at 07:12

2 Answers2

6

Like this:

enter image description here

  • as mentioned @Οὖτις, math should be inline
  • off-topic:
    • you use old (version 2) siunitx sintay. I suggest to use new, introduced by package version 3 (see MWE below)
    • simpler table code you can get by use of the tabularray package
\documentclass{article}
\usepackage{tabularray}
\UseTblrLibrary{amsmath, 
                booktabs, 
                siunitx}

\begin{document}

\noindent\begin{tblr}{colspec = {l X[l, mode=math]}, rowsep=3pt} % 5pt. pw desired bigger vertical distance between math terms Velocity of light in vacuum & c = \SI{2.998d8}{\meter\per\second} \ Gravitational constant & G = \begin{cases} \qty{6.67e-11}{\meter\cubed\per\kilo\gram\per\second\squared} \ \qty{6.67e-8}{\cm\cubed\per\gram\per\second\squared} \end{cases} \ Acceleration of free fall & g = \qty{9.807}{\meter\per\second\squared} \ \end{tblr} \end{document}

Zarko
  • 296,517
5

enter image description here

This is possible with nicematrix

\documentclass{article}

\usepackage{amsmath} \usepackage{siunitx}

\usepackage{nicematrix} \newcolumntype{e}{@{$\mspace{\thickmuskip}$}c@{$\mspace{\thickmuskip}$}}

\begin{document}

\begin{equation*}
    \everymath{\displaystyle}
    \begin{NiceArray}[cell-space-limits=1.1pt]{p[l]{5.5cm} r e l}
        \text{Velocity of light in vacuum}
        & c
        & =
        & \SI{2.998d8}{\meter\per\second}
        \\
        \text{Gravitational constant}
        & G
        & = 
        &
        \begin{cases}
            \SI{6.67d-11}{\meter\cubed\per\kilo\gram\per\second\squared} \\
            \SI{6.67d-8}{\centi\meter\cubed\per\gram\per\second\squared}
        \end{cases}
        \\
        \text{Acceleration of free fall}
        & g
        & =
        & \SI{9.807}{\meter\per\second\squared}
    \end{NiceArray}
\end{equation*}

\end{document}