siunitx icon indicating copy to clipboard operation
siunitx copied to clipboard

leading 0s in e exponential expressions

Open Overcraft90 opened this issue 1 year ago • 4 comments

Hi there,

as per this issue I was having some trouble of parsing leading zeros in expressions with e exponential.

The solution provided seems to be working just fine; however, I was wondering whether there is something that could be done to implement this feature in siunitx. Thanks!

\documentclass[12pt]{report}

\usepackage{siunitx}
\sisetup{output-exponent-marker=\ensuremath{\mathrm{e}}}

\begin{document}

\dots (error rate: \num{4.11e-07} and \num{1.89e-07}).

\end{document}

Overcraft90 avatar Jul 20 '24 11:07 Overcraft90

There's no issue with parsing here, rather it's about what you want to see as output. The model in siunitx with numbers is to normalise leading zeros, as these are typically not mathematically required. That said, there are options for minimum digits in the integer and decimal parts. I can look at a similar feature for exponents. However, it would be useful to have an idea of where you are using this type of formatting - it's well outside the norm.

josephwright avatar Jul 20 '24 12:07 josephwright

@josephwright thanks for adding a code block and for the explanation. I understand as well this is unconventional; however, I'm evaluating the quality of some genome assemblies and the software I'm using returns an estimate for the error in k-mers count after a genome is assembled starting from raw data.

This tool outputs such values with the leading 0s, and I simply wished to report them as such. Thanks again, let me know!

Overcraft90 avatar Jul 20 '24 12:07 Overcraft90

I'm gong to need to see some use of this in professionally-typeset material.

josephwright avatar Oct 02 '24 16:10 josephwright

@josephwright for the moment it's not urgent as I have submitted my thesis. I think we can close this issue for now since it was mostly restricted to my particular use case. Thanks again.

Overcraft90 avatar Oct 08 '24 17:10 Overcraft90