3

I'm trying to get siunitx to format numbers in a table using 'engineering notation' for exponents, but with the exponent sign (E) in script-size. I can't seem to figure this out.

Example:

\documentclass{article}

\usepackage{amsmath,amsthm,amssymb}
\usepackage[
    round-mode=places,
    round-precision=1,
    output-exponent-marker=\text{E},
    tight-spacing=true
]{siunitx}

\begin{document}

\noindent The entries in the table should be aligned on the periods and look like this; 12.3{\scriptsize E}3.

\begin{table}[h]

    \caption{Engineering notation with siunitx?}

    \begin{tabular}{S|S}
        12.3E3 & 45.6E3 \\
        7.89E3 & 101.1E3 \\
    \end{tabular}

\end{table}

\end{document}

Rendered output from example

2
  • Welcome to TeX.SE. Thanks so much for providing a a fully compilable MWE in your very first question. Jan 3, 2020 at 8:03
  • Hi @PeterGrill - thanks for the answer and no worries! Jan 4, 2020 at 20:14

1 Answer 1

3

Using output-exponent-marker={{\scriptstyle E}} (note the double braces as per @quark67's suggestion) seems to work:

enter image description here

Code:

\documentclass{article}

\usepackage{amsmath,amsthm,amssymb}

\usepackage[
    round-mode=places,
    round-precision=1,
    output-exponent-marker={{\scriptstyle E}},
    tight-spacing=true
]{siunitx}

\begin{document}

\noindent The entries in the table should be aligned on the periods and look like this; 12.3{\scriptsize E}3.

\begin{table}[h]

    \caption{Engineering notation with siunitx?}

    \begin{tabular}{S|S}
        12.3E3 & 45.6e3 \\
        7.89E3 & 101.1E3 \\
    \end{tabular}

\end{table}
\end{document}
7
  • 1
    As I understood the question correctly, OP like to have only letter E in \script size. Close to this is S[output-exponent-marker=\textsc{e}] (interestingly, this option doesn't work in \sisetup).
    – Zarko
    Jan 3, 2020 at 8:08
  • 1
    @Zarko With output-exponent-marker={{\scriptstyle E}} you will have a small E and a normal full size digit after it.
    – quark67
    Jan 3, 2020 at 8:13
  • @quark67, indeed! I didn't test with two curly braces ...
    – Zarko
    Jan 3, 2020 at 8:43
  • @Zarko: Oppss. Thanks for pointing out that subtlty. Jan 3, 2020 at 11:38
  • 1
    @quark67: Sorry about that. Corrected now. Jan 4, 2020 at 2:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .