79

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?

3
  • 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. Commented Jul 29, 2010 at 15:49
  • 10
    I agree- we should probably promote siunitx over SIunits as that package is being actively maintained and developed.
    – Sharpie
    Commented Aug 19, 2010 at 5: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
    Commented May 23, 2012 at 15:51

4 Answers 4

120

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.

7
  • 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? Commented Jul 29, 2010 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 (physics.nist.gov/cuu/Units) and the BIPM (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
    Commented Jul 29, 2010 at 20:49
  • 3
    does siunitx work if someone spells that as meter? :) Commented Sep 29, 2010 at 5:41
  • 3
    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
    Commented Sep 29, 2010 at 5:49
  • 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
    Commented May 23, 2012 at 15:57
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}
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

1
  • 1
    But the question specifically stated that it's not just the issue of an upright micron symbol. Commented May 27, 2020 at 18:28
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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .