6

I would like the numbers to be aligned by multiplication signs on this table. I have tried to use the option table-format in what it looks like the right way to me, but actually I haven't found any explanation about it in the booktabs documentation.

Are there other options I could use? And do you also know where to find a good documentation about them?

\documentclass{article}
\usepackage{booktabs}
\usepackage{siunitx}

\begin{document}
\begin{table}[h!]
    \centering
    \begin{tabular}{lS[table-format=-1.1e-1]S[table-format=-1.1e-1]}
        \toprule
        & $m$ & $q$ \\
        \midrule
        Total death toll & \num{-9.8e-5} & \num{2.0e-1} \\
        Climatic hazards & \num{-1.0e-4} & \num{2.1e-1} \\
        Earthquakes & \num{6.0e-6}  & \num{-1.1e-2} \\
        Mass movements & \num{-1.8e-8} & \num{5.1e-5} \\
        Volcanic hazards & \num{-2.7e-7} & \num{5.4e-4} \\
        \bottomrule        
    \end{tabular}
\caption{Fit parameters for death toll per population and per year for the classes of geohazards.}
\label{t1}
\end{table}

\end{document}

My unsatisfying result

5

You have nearly got it! You need to remove the \num{...} and just have the number. See example below. For package documentation I like to use CTAN

\documentclass{article}
\usepackage{booktabs}
\usepackage{siunitx}

\begin{document}
\begin{table}[h!]
    \centering
    \begin{tabular}{lS[table-format=-1.1e-1]S[table-format=-1.1e-1]}
        \toprule
        & $m$ & $q$ \\
        \midrule
        Total death toll & -9.8e-5 & 2.0e-1 \\
        Climatic hazards & -1.0e-4 & 2.1e-1 \\
        Earthquakes & 6.0e-6  & -1.1e-2 \\
        Mass movements & -1.8e-8 & 5.1e-5 \\
        Volcanic hazards & -2.7e-7 & 5.4e-4 \\
        \bottomrule        
    \end{tabular}
\caption{Fit parameters for death toll per population and per year for the classes of geohazards.}
\label{t1}
\end{table}

\end{document}

enter image description here

| improve this answer | |
  • Thank you! I think I have just found out that 'S' columns are already made for numbers in the \num{} format... – Elisa Nov 8 '18 at 12:59

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.