josephwright / siunitx

A comprehensive (SI) units package for LaTeX
LaTeX Project Public License v1.3c
352 stars 26 forks source link

leading 0s in e exponential expressions #741

Open Overcraft90 opened 1 month ago

Overcraft90 commented 1 month ago

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}
josephwright commented 1 month ago

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.

Overcraft90 commented 1 month ago

@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!