Is it possible to ask siunitx to output the unit name instead of the symbol?
For example, in certain places I want to have "123 nanoseconds" instead of "123 ns".
Is that possible?
Is it possible to ask siunitx to output the unit name instead of the symbol?
For example, in certain places I want to have "123 nanoseconds" instead of "123 ns".
Is that possible?
You can declare your own unit.
In the following example I have declared the unit \nsec.
As daleif pointed out, the spacing between the number and the spelled out units is too tight. I used the option number-unit-product to increase the spacing of the unit \nanosec:
\documentclass{article}
\usepackage{siunitx}
\DeclareSIUnit\nsec{\text{nanoseconds}}
\DeclareSIUnit[number-unit-product = \ ]\nanosec{\text{nanoseconds}}
\begin{document}
\noindent
It takes about \SI{123}{\nsec} to compile this document.\\
It takes about \SI{123}{\nanosec} to compile this document.\\
It takes about $123$~nanoseconds to compile this document.\\
\end{document}
Be advised that you can not declare it as \ns. I tried that, but apparently it is used internally by siunitx as the macro for ns. It does not give an error about that, but simply displays the number ans units as 123 ns instead, thereby ignoring your custom SI unit.
This is just the same as
One day, a person went to a horse racing area. Instead of counting the number of humans and horses, he counted 74 heads and 196 legs. How many humans and horses were there?
(blatant advertising)
or something like Fifteen men on the dead man’s chest. The difference between the two is just that “big” numbers are usually written in numerals rather than spelled out fully.
When you write ”123 nanoseconds” you are not using a symbol, so the code should simply be
\num{123}~nanoseconds
I'd recommend \num for consistency with other usages such as \SI{123}{\nano\second}.
siunitxfiles fornanoandsecond, but couldn't find them as literal strings, just as part of command names. – gernot Mar 05 '17 at 16:08$123$~nanoseconds. – egreg Mar 05 '17 at 16:15