# [texhax] units

Philip G. Ratcliffe philip.ratcliffe at uninsubria.it
Fri Jun 13 15:56:11 CEST 2003

> > > > For a more complete handling of units with correct spacing,
compounding
> > > > etc., check out the "SIunits" package, also on CTAN.
> > >
> > > Well, I am underimpressed.
> > > Try \electronvolt.  The V really should be negatively kerned -- the
space
> > > between the e and the V is unsightly large.

Well, unsightly is perhaps a little extreme.  In any case, it's actually no
different if you just write eV in standard text (apart that is from an
obvious font difference - which incidently also shows that one should be
consistent in using, e.g., $1.6\,$eV and  $1.6\,\mathrm{eV}$).  So, it isn't
surprising that the package doesn't intrinsically do it.  That said, it's
easy enough to redefine \electronvolt with the correct kerning.  For what
it's worth I define an extended set including \GeV, \MeV etc. in a local
SIunits.cfg file.

> > > Try \square\giga\electronvolt.  The square is applied to the G not to
the
> > > V, i.e., you get G^2eV rather than GeV^2.  To get it right you need to
use

See Robin below.

> > > \giga\square\electronvolt, which does not read normally. What you
would
> > > say is giga-electronvolt-squared.

Well, you can indeed write that: the package allows for
\giga\electronvolt\squared (you read the manual, right?).

> > > Further, it does not handle spacing.  One would like 5\meter  and
> > > 5 \meter to produce the same thing.

There's no way (that I know of but Robin may correct me on this) in TeX to
make, e.g., \meter look BACK to the previous text and space itself
correctly.  However, the package is INTENDED to be used in the following
way: \unit{1.6}{\giga\electronvolt\squared}.  And that DOES get the spacing
right.  Indeed, via the package options, one can even choose the spacing to
use, differentiating, moreover, the spacing between numbers and units, as in
1.6 GeV, and between units themselves, as in 197 MeV fm.

> > and you've sent a list of suggestions to the author?
>
> Not yet.  I only just tried the package after its recommendation in the
> previous posting.   Anyway, it does not seem to give correct spacing as
> suggested in the original posting, which as far as I am concerned would
> have been its nicest feature.
>
> > (fwiw, it's perfectly obvious why \square\giga\electronvolt doesn't
> > do what you expect: try \square{\giga\electronvolt} ... it stands a
> > better chance of making it through tex parsing.)
>
> Of course.  However, one could have implemented it differently, I suppose.

As far as my imagination goes, one couldn't do an awful lot better.

Cheers all,  Phil