siunitx icon indicating copy to clipboard operation
siunitx copied to clipboard

[feature request] Exponent notation also in e-mode, not only power mode

Open rlalik opened this issue 1 month ago • 3 comments

Would be great to have possibility to display exponent in e-notation, like 4.15e-15 eV s. Currently option exponent-mode has values: input,fixed,engineering,scientific,threshold and each of them (beside fixed I think) could be displayed with e-mode, so I wouldn't add e-mode there. One could add exponent-e-mode option of bolean type (default: false) to change from power to e-mode.

Reasoning: sometimes one to display numbers which can be easily copy-paste to number processing tools, like spreadsheet, programming code, data files. Power mode doesn't work here great.

rlalik avatar Oct 29 '25 01:10 rlalik

See option output-exponent-marker

josephwright avatar Oct 29 '25 07:10 josephwright

Thanks! I was searching through the documentation for this and couldn't find. But, when having that, the minus sign is not ASCII minus but I think n-dash? As an example, if I type directly 9.171e-03 into the table I get:

9.171e-03

and this is when formatted with S[table-format=1.3e1,output-exponent-marker=\mathrm{e}]

9.171e−3

The first one can copy-past into spreadsheet and is read as a number, the second one as a text.

And I think the point of e-notation is to represent data in the ASCII format consumable by computers, and not visual way like the math mode of LaTeX. Do you think this could be changed?

rlalik avatar Oct 29 '25 11:10 rlalik

@rlalik siunitx is meant for typesetting units, and there it's quite clear that the correct symbol is a minus sign not a hyphen. If you are taking 'bulk' raw data to present in a machine-readable form, I'd be tempted to use verbatim or similar (That's what I do for supplementary data in publications).

josephwright avatar Oct 29 '25 14:10 josephwright