I'm trying to use
\SI{0.006}{\elementarycharge}
in the siunitx
package
\usepackage{siunitx}.
The \elementarycharge
command does not work. I'm using
\documentclass[prb,twocolumn,showpacs]{revtex4}
Any idea?
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityYou do not say which version of siunitx
you have installed. With the current release (v2), something like
\documentclass{article}
\usepackage{siunitx}
\begin{document}
\SI{0.006}{\elementarycharge\per\cubic\angstrom}
\end{document}
should be fine. If you have version 1 then \elementarycharge
will not be defined and you'll need
\newunit{\elementarycharge}{\text{\ensuremath{e}}
in your preamble.
\elementarycharge
I've given here is exactly the one used by v2 of siunitx
, by the way.
– Joseph Wright♦
Jan 21 '11 at 16:54
siunitx
with no options then set \sisetup{load-configurations = version-1}
to load the back-compatibility code.
– Joseph Wright♦
Jan 22 '11 at 20:33
The correct use is:
\si{\elementarycharge}
All SI units, not-quite-SI units, prefixes and suffixes from siunitx
need to be enclosed in the \si{}
macro. See the manual for more information and more advanced examples of use.
Dimensionless numbers and angles have their own commands for typesetting: \num
, \numrange
, \numlist
, \ang
, and they don't need to be inside the \si
macro.
\SI{}
macro. I tried \SI{0.006}{\elementarycharge\per\AA^3}
, which does not work. So I have to resort to \SI{0.006}{e\per\AA^3}
for the moment. Any idea?
– Nigu
Jan 21 '11 at 15:05
\SI{0.006}{\elementarycharge\per\AA^3}
works for me. Could you post a complete minimal example that produces the issue for you?
– Martin Tapankov
Jan 21 '11 at 15:16
\AA^3
will force 'literal' mode in your unit. That might be what you want, but I usually recommend sticking with 'semantic' units so that the various formatting options can be applied.
– Joseph Wright♦
Jan 21 '11 at 16:53
\usepackage{siunitx}
command. – Seamus Jan 21 '11 at 15:39