josephwright / siunitx

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

Add options for math superscript and subscript commands #731

Open texno3 opened 2 months ago

texno3 commented 2 months ago

May I ask if it is possible to add options for math superscript and subscript commands, such as math-subscript-command and math-superscript-command, whose defaults are \sb and \sp, respectively, so that other commands can be used to set the format of the superscripts and subscripts of the math , such as the \sub and \super commands of my macro package spbmark.

josephwright commented 2 months ago

The model for siunitx to generate 'properly formed' (La)TeX math mode material as an intermediate to then typesetting either in math mode (directly) or in text mode (using appropriate substitutions). For sub/superscripts, that means _ and ^, which in text mode map to \textsuperscript/\textsubscript. If a document author or a package needs to redirect the results, that should apply generally, not just to units. For math mode, I'd expect to see that done using \mathcode or in text mode by redefining the \text...script commands.