josephwright / siunitx

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

New option for ignoring number part #110

Closed josephwright closed 11 years ago

josephwright commented 11 years ago

[Anonymous report]

It could be useful to define a new option (such as ignore-number=true or equation=true) for \SI and friends which ignores the number part entirely. This would allow more semantically consistent typesetting of equations with units, and ensure that the equation-unit spacing and the number-unit spacing are the same.

Example of the intended effect:

\documentclass{article}
\usepackage[load-configurations=abbreviations]{siunitx}
\newcommand\SIeq[2]{\SI[parse-numbers=false]{\sisetup{parse-numbers=true}\text{$#1$}}{#2}}
\begin{document}
\noindent
Compare
\[\alpha_{\rm B}\approx\SIeq{\num{2.54e-13}\-(T_4)^{-0.8163-0.0208\ln T_4}}{\cubic\cm\per\s}\]
with
\[\alpha_{\rm B}\approx\num{2.54e-13}\-(T_4)^{-0.8163-0.0208\ln T_4}\,\si{\cubic\cm\per\s}\]
and
\[\alpha_{\rm B}\approx\SI{2.54e-13}{\cubic\cm\per\s}.\]
\end{document}
josephwright commented 11 years ago

I'm going to WONTFIX this, as the case seems very unusual.