37

I'm using TeXnicCenter for Windows (7) and I'm a bloody beginner in everything that concerns LaTeX. I'm using the siunitx package for mathematical formulas and it works just fine... with one exception. The \micro (e.g. \si{\micro}) command doesn't work! It simply doesn't show the µ in the PDF file. I've tried to use \u as well without success. Does anybody know what the error could be?

6
  • 8
    \micro is not a unit (it is a quantifier), it is hardly ever written on its own. Have you tried \si{\micro\metre}?
    – daleif
    Commented Nov 7, 2011 at 14:52
  • 5
    Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem.
    – N.N.
    Commented Nov 7, 2011 at 14:52
  • @daleif Sounds like an answer to me ...
    – Joseph Wright
    Commented Nov 7, 2011 at 16:51
  • 3
    @Chris: As daleif has already said, \micro is a prefix and will print 'µ', while something like \micro\metre is a prefixed unit and will print 'µm'. Your comments on Marco's answer indicate that there is something else up, but without a minimal example it's not really possible to give any more advice.
    – Joseph Wright
    Commented Nov 8, 2011 at 8:46
  • PS: Maybe you want to switch from TXC to TexMaker, because TXC 1 does not support UTF-8 (TXC 2 will) but TexMaker does. Plus TexMaker is available for Win, Linux and Mac.
    – matth
    Commented Nov 10, 2011 at 15:53

4 Answers 4

44

I’ll throw this in here, as my search for a solution led me here, but my problem was another one.

Using XeTeX and Latin Modern, I found that the greek letter μ does not work. However, the Unicode micro sign μ does work.

Knowing that, I added \sisetup{math-micro=\text{µ},text-micro=µ}, and now all seems well.

To clarify, use

µ
MICRO SIGN
Unicode: U+00B5, UTF-8: C2 B5

and not

μ
GREEK SMALL LETTER MU
Unicode: U+03BC, UTF-8: CE BC

for great justice.

MWE for my setup (XeTeX on OS X):

\documentclass{standalone}
\usepackage{fontspec}
\usepackage{siunitx}
% Note that the sign must be
%  µ
%  MICRO SIGN
%  Unicode: U+00B5, UTF-8: C2 B5
% and \emph{not}
%  μ
%  GREEK SMALL LETTER MU
%  Unicode: U+03BC, UTF-8: CE BC
\sisetup{math-micro=\text{µ},text-micro=µ}

\begin{document}
Now you can \si\micro\ all the things.
\end{document}

MWE screenshot

7
  • 1
    Nice one! It would be great if you can provide a 10-20 lines of compilable LaTeX file with this working in action. We usually even put a screenshot of the resulting file to show the effect in action.
    – percusse
    Commented May 8, 2012 at 10:46
  • 3
    That is what I recommend in the manual :-)
    – Joseph Wright
    Commented May 8, 2012 at 10:55
  • 3
    @JosephWright When I copy the line from the manual, I get the greek letter. In fact, when I copy the one from my own document which is set up to use the micro sign, I also get the greek letter! Not sure why, but might be worth pointing out. :)
    – nlogax
    Commented May 8, 2012 at 11:26
  • 2
    @nlogax The document has to work with pdfLaTeX, so I can only use what is available there. I'm expecting people using XeLaTeX/LuaLaTeX to use their system character map application to sort this out.
    – Joseph Wright
    Commented May 8, 2012 at 11:50
  • I am running beamer under XeLaTex with UTF-8 coded input files under Windows (MikTeX). Including the \sisetup{math-micro=\text{µ},text-micro=µ} in the preamble does not work. For some reason it has to be included after the \begin{document}.
    – uwezi
    Commented Sep 10, 2013 at 13:53
16

Here is a MWE which compiles fine, using the command @daleif suggested

\documentclass[a4paper,final]{article}

\usepackage[T1]{fontenc}
\usepackage[]{lmodern}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}

\usepackage[]{siunitx}
\usepackage{textcomp}

\begin{document}

  Greek letter \textmu{} in normal text.
  Greek letter µ in normal text.
  The unit for viscosity is \si{\micro\pascal}.
  Just the \si{\micro} is not a SI unit but it works anyway.
  Some number with unit \SI{51}{\micro\metre} lorem ipsum.
  A number with unit in a formula $\SI{123}{\micro\metre}$ dolor sit amet.

\end{document}

As shown in the example, use \si for just units and capital \SI for a value-with-unit-combination.
And if you want a plain µ in the text, you could also try the command \textmu which is made available by the package \usepackage{textcomp}

1
  • 7
    \si is for formatting units, \SI is for formatting a number-plus-unit combination (a 'quantity').
    – Joseph Wright
    Commented Nov 8, 2011 at 10:13
5

Depending on which engine and encoding you use, you can just write a literal μ. Or you can typeset it in math mode as a variable $\mu$. It depends on what use the μ has in your document.

If it is a quantifier then add the corresponding unit as daleif already pointed out in the comment.

6
  • Thank you all, so the $\mu$ and the plain µ are both working. The \si{\micro\metre} doesn't :( The problem is that the two working methods return a µ. Is there a possibility to get a normal µ still?
    – Chris
    Commented Nov 7, 2011 at 20:37
  • If a plain µ yields a slanted µ, then it seems that your font simply doesn't have an upright µ. What is the result of $\mathup\mu$?
    – Marco
    Commented Nov 7, 2011 at 20:57
  • Again it returns only a µ. Is there no way to add an upright µ to my font?
    – Chris
    Commented Nov 7, 2011 at 21:58
  • You don't really want to add a glyph to your font. But nothing prevents you from defining a command that inserts an upright µ from another font.
    – Marco
    Commented Nov 7, 2011 at 22:02
  • Or you can use \DeclareUnicodeCharacter to automate this. Or see this or this
    – Marco
    Commented Nov 7, 2011 at 22:08
0

Another solution is through the use of the "Babel" package + "Lualatex" as follows, this method defines the symbol as a greek letter: This answer is in accordance with the solution proposed by David Purton: Biblatex usage for multiple languages in same citation

\documentclass[a4paper,12pt,twoside]{book}
\usepackage[bidi=basic,layout=lists.tabular]{babel}
% Define used languages
\babelprovide[import=en,language=Default]{english} % default language
\babelprovide[import=el]{polutonikogreek}
%Define fonts to be used corressponding to each language (Ordinary ttf fonts installed on your system)
\babelfont[english]{rm}{Times New Roman}
\babelfont[polutonikogreek]{rm}[Language=Default]{Palatino Linotype}

\begin{document}

\foreignlanguage{polutonikogreek}{μ} \\
OR\\

\begin{otherlanguage}{polutonikogreek}
μ \\
\end{otherlanguage}

OR\\
%The method below is not preferred as it only uses the font without language definition, also it can be used with babel or polyglyossia package:

\begingroup
   \newfontfamily\myfont[Numbers=OldStyle]{Palatino Linotype}
{\myfont μ}
\endgroup
OR\\
\selectlanguage{polutonikogreek}
μ
\end{document}

You must log in to answer this question.

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