77

It seems to be generally well accepted that the correct way to typeset a value with units is to separate the number from the units by a space, and write the units in an upright font. For example,

One hellameter is \( 1.0\times10^{27} \) m.

The symbol for 'micro-' is the Greek letter mu, but if you compile

At the telecom wavelength of \( 1.55\ \mu \)m ...

then the spacing will be correct and the 'm' will be upright, but the 'mu' won't be.

How do you produce an upright lowercase mu? More generally, how do you make any Greek letter appear upright?

Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
Michael Underwood
  • 21,356
  • 13
  • 52
  • 41
  • 5
    Care to revisit your answer decision? It looks like Joseph's answer is superior to the one you have currently selected, as evidenced by the comments and answers of Will, Joseph, and myself. In the end, it's your question, but you will get better answers in the future. if you give a little more time (about 48 hours is recommended) for answers to come in. – Kevin Vermeer Jul 29 '10 at 15:49
  • 10
    I agree- we should probably promote siunitx over SIunits as that package is being actively maintained and developed. – Sharpie Aug 19 '10 at 05:02
  • 1
    Thanks for a nice question! Please update siunitx as the right answer (I went to the trap of trying SIunits at first, because I was impatient to read the entire tread). – Mikko May 23 '12 at 15:51

4 Answers4

118

The siunitx package does this 'properly' without the user needing to worry

\documentclass{article}
\usepackage{siunitx}
\begin{document}
  \SI{1.55}{\micro\metre}
\end{document}

(Note: I am the author of siunitx, which is the successor to both SIunits and SIstyle.)

Of course, for the more general question about upright Greek letters then the upgreek package is indeed the best plan.

Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
  • 1
    Can you explain what you mean by 'properly,' and what it is the user might have needed to worry about with the SIunit package? – Michael Underwood Jul 29 '10 at 16:18
  • 3
    By 'properly', I mean that the standard settings for siunitx will use an upright font for the micro symbol. The symbols is supposed to be in an upright font: see the regulations from NIST (http://physics.nist.gov/cuu/Units/) and the BIPM (http://www.bipm.org/en/si/).

    The issues with the SIunits package stem from the fact that it doesn't have full control of the font used for printing (according to the regulations, units should be upright in roman font). It also doesn't have the flexibility that siunitx provides.

    – Joseph Wright Jul 29 '10 at 20:49
  • 2
    does siunitx work if someone spells that as meter? :) – Billy ONeal Sep 29 '10 at 05:41
  • 2
    Indeed it does: I am a realist! Of course, you can always add additional units using \DeclareSIUnit, for example to support specialist units (which may not be SI). – Joseph Wright Sep 29 '10 at 05:49
  • Anyway making these commands a bit shorter? \SI{}{\micro\metre} is awfully long for just writing µm – Mikko May 23 '12 at 15:54
  • 5
    @Largh That's because it's showing semantics. You can use the abbreviations, so for example \SI{10}{\um} or \si{\um}, as explained in the documentation. – Joseph Wright May 23 '12 at 15:57
  • @JHBonarius Should work: it's defined in the latest release. Please post a new question with an example of the issue. – Joseph Wright Feb 02 '18 at 14:40
9

Joseph Wright’s answer is correct, but I’ll give a more comprehensive list. As of 2020, \textmu is defined by the LaTeX kernel. You can therefore write, 40~{\textmu}m in text mode, or just 40~µm, where µ is U+00B5. On LuaTeX or XeTeX, you can also write ~{^^^^00b5}m. (You normally want the space between the number and the unit to be non-breaking.)

If you are compiling with PDFLaTeX on an installation older than TeX Live 2020, you will additionally need \usepackage{textcomp} for this to work. On LuaLaTeX or XeLaTeX, you would use fontspec.

Within math mode, you can wrap any of these in \textnormal.

In practice, you would end up defining some kind of \um or \micrometer command that’s no easier than using siunitx, e.g.

\newcommand\textmicrometer{~{\textmu}m}
\newcommand\micrometer{%
\ifmmode\textnormal{\textmicrometer}%
\else\textmicrometer%
\fi}
Davislor
  • 44,045
3

If it's just the issue of the upright micron symbol, then you can also use \textmu.

for example At the telecom wavelength of 1.55 \textmu m ... will give correct spacing with upright micron symbol

manoj
  • 31
0

I don't agree that it is well accepted that the way to typeset a value with units is to separate the number from the units by a space, and write the units in an upright font outside math. This strategy leaves out a lot of useful cases, like powers (e.g. 3.14 m²), for which you need further workarounds like typing standalone exponents.

The correct answer is of course siunitx (Joseph Wright answer).

However when, working with non latex experts it is difficult to convince them to use such fancy packages or learn new syntax. As a compromise, what I do it to make all the quantity math and use commands inside math if necessary.

So examples:

The lenght is \( 20~\mathrm{m} \).
The surface is \( 20~\mathrm{m^2} \).
The speed is \(\sim 17~\mathrm{km/s} \)
The Bohr energy is \( 1.0~a_0/\hbar \)
The ratio is \( 2.3~\frac\text{eaten pears}\text{sold bananas} \)

This has several advantages, one is that SI units generally can be entirely contained inside mathrm, exponents are natural, one can use fractions, text can be reintroduced by \text and, to your points, greek letters can be used.

\(420~\mathrm{\mu m}\)

A defect is that mu appears slanted here (mathrm is ignored for mu), but I am not even sure that the slanted result is a real deviation from the SI rules. In any case this can be corrected in many ways (packages or using textmu or `\upmu from the upgreek package).

\(420~\mathrm{\text\textmu m}\)

Final example and result:

spot sizes of \(\sim 420~\mathrm{\text\textmu m}\) and fluences of \(4.8~\mathrm{mJ/cm^2}\)..

eq

alfC
  • 14,350