0

I am trying to make a table similar to this one: enter image description here

I am trying to do that with siunitx package but I have trouble with alignment - I don't know how to align numbers to the left and ignore decimal dot alignment when I also want to have bases of 10 nicely aligned like on the picture.

My code:

\sisetup{group-minimum-digits = 4, output-decimal-marker = {,}, exponent product = \cdot, inter-unit-product={}\cdot{}, table-number-alignment = left, table-figures-exponent=1}

\begin{tabular}{|l|c|S[table-format = 9.10(2)e2]s[table-unit-alignment = left]|}
\hline
\multicolumn{1}{|c|}{Název} & Zn. & \multicolumn{2}{c|}{Hodnota} \\ 
\hline
Atomová hmotnostní          & $ m_{\textrm{u}} $                & 1.66053886(28)e-27            & \si{\kilogram} \\
Avogadrova                  & $ N_{\textrm{A}} $                & 6.0221415(10)e23              & \si{\per\mole} \\
Bohrův poloměr              & $ a_{\textrm{0}} $                & 0.5291772108(18)e-10          & \si{\meter} \\
Elementární náboj           & $ e $                         & 1.60217653(14)e-19            & \si{\coulomb} \\
Faradayova                  & $ F $                         & 96485.3383(83)                & \si{\coulomb\per\mole} \\
Gravitační                  & $ G $                         & 6.6742(10)e-11                & \si{\newton\square\meter\per\square\kilogram} \\
Permeabilita vakua          & $ \mu_{\textrm{0}} $          & 4\pi e-7                      & \si{\newton\per\square\ampere} \\
Permitivita vakua           & $ \varepsilon_{\textrm{0}} $  & {$ 1/\mu_{\textrm{0}}c $}     & \si{\farad\per\meter} \\
Planckova                   & $ h $                         & 6.6260673(11)e-34             & \si{\joule\second} \\
Planckova redukovaná        & $ \hbar $                     & 1.05457168(18)e-34            & \si{\joule\second} \\
Plynová molární             & $ R_{\textrm{m}} $                & 8.314471(15)                  & \si{\joule\per\mole\per\kelvin} \\
Rychlost světla ve vakuu    & $ c $                         & 299792458                     & \si{\meter\per\second} \\
Stefanova-Boltzmanova       & $ \sigma $                        & 5.670400(40)e-8               & \si{\meter\kelvin} \\
\hline
\end{tabular}

It's output: enter image description here

Any idea how to that?

2

Is it this alignment that you want? I plit the number column into a left aligned column for the mantissa and an S column for the 10 powers part:

    \documentclass{article}
    \usepackage[utf8]{inputenc}
\usepackage[showframe]{geometry}
    \usepackage{siunitx, array}
    \usepackage{booktabs}
    \usepackage{amsmath}


    \begin{document}

 \sisetup{group-minimum-digits = 4, output-decimal-marker = {,}, exponent-product = \cdot, inter-unit-product={} · {}, table-number-alignment = left, table-figures-exponent=1}

\setlength{\extrarowheight}{2pt}
\newcommand{\specialcell}[1]{ \multicolumn{2}{>{$}l<{$}}{#1}}

\begin{tabular}{|l|c| >{$}l<{$}@{${} · {}\mkern-22mu$}S[table-format =1 e-2, table-number-alignment = left]@{\hskip0.2em}l|}%S[table-unit-alignment = left]
\hline
\multicolumn{1}{|c|}{Název} & Zn. & \multicolumn{3}{c|}{Hodnota} \\
\hline
Atomová hmotnostní & $ m_{\textrm{u}} $ & 1.66053886(28) & e-27 & \si{\kilogram} \\
Avogadrova & $ N_{\textrm{A}} $ & 6.0221415(10) & e23 & \si{\per\mole} \\
Bohrův poloměr & $ a_{\textrm{0}} $ & 0.5291772108(18) & e-10 & \si{\meter} \\
Elementární náboj & $ e $ & 1.60217653(14) & e-19 & \si{\coulomb} \\
Faradayova & $ F $ & \specialcell{96485.3383(83)} & \si{\coulomb\per\mole} \\
Gravitační & $ G $ & 6.6742(10) & e-11 & \si{\newton\square\meter\per\square\kilogram} \\
Permeabilita vakua & $ \mu_{\textrm{0}} $ & 4π& e-7& \si{\newton\per\square\ampere} \\
Permitivita vakua & $ \varepsilon_{\textrm{0}} $ & \specialcell{1/\mu_{\textrm{0}}c } & \si{\farad\per\meter} \\
Planckova & $ h $ & 6.6260673(11) & e-34 & \si{\joule\second} \\
Planckova redukovaná & $ \hbar $ & 1.05457168(18) & e-34 & \si{\joule\second} \\
Plynová molární & $ R_{\textrm{m}} $ & \specialcell{8.314471(15)} & \si{\joule\per\mole\per\kelvin} \\
Rychlost světla ve vakuu & $ c $ & \specialcell{299792458} & \si{\meter\per\second} \\
Stefanova-Boltzmanova & $ σ$ & 5.670400(40) & e-8 & \si{\meter\kelvin} \\
\hline
\end{tabular}

\end{document} 

enter image description here

  • That's almost what I want. I have only added these numbers into \num{} and made column for the 10 powers without dots in each row but only while needed and I am satisfied. – Tomas Jun 23 '18 at 19:26
  • Oh! yes, I forgot about the rows without dots. I'll fix it in a moment. – Bernard Jun 23 '18 at 20:07
  • @Tomas: I've modified the code to add a \specialcell command for the rows which don't require a dot. Please see if it's fine for you. – Bernard Jun 23 '18 at 20:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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