Without the great siunitx
package, in this case you can also:
1) If you use xetex
or luatex
compilers, insert \usepackage{fontspec}
in the preamble and simply write µ
(altGr
+m
in Linux, Alt
+230
in Windows).
2) If you use the pdflatex
compiler:
Write \textmu{}
if you load the textcomp
package in the preample.
Write µ
as above if you load both textcomp
and inputenc
with the uft8
option (but do not use fontspec
with pdflatex
). If you have some problem here, check that the file itself have really a UTF8 encoding. Add also some beautiful font, since the default mu is ugly.
Aside, note that text in math mode is not necessarily italic nor slanted text, depending of the font. A MWE with pdflatex
showing the four mu styles:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{textcomp}
%\usepackage{fontspec} % for textex or luatex
\usepackage{palatino} % font to avoid the ugly default µ
\begin {document}
\obeylines
Four styles of \textmu:
100 µm
100 \textsl{µ}m
100 \textit{µ}m
100 $\mu$m
\end{document}
3) Some fine \textmu
variants are also provided by the textgreek
package through the options cbgreek
(default), euler
and artemisia
but note that the textcomp
command have precedence. Fortunately, textgreek
provide the alternative \textmugreek
command in case you are using both packages. To avoid typing the command, you can make that µ
character print \textmugreek
instead \textmu
adding this to the preamble:
\usepackage[artemisia]{textgreek}
\usepackage{newunicodechar}
\newunicodechar{µ}{\textmugreek}
4) Using babel
with greek
option you can also use \greektext m \latintext
to obtain µ. You can also simplify this coding as above or by a simple macro:
\documentclass{article}
\usepackage[greek,english]{babel}
\usepackage{xspace
\newcommand{\micron}{\greektext m\latintext m\xspace}
\begin{document}
100 \micron
\end{document}
5) Use upgreek
package and $\upmu$
. This in a only math command but you can make your own \Mu
command compatible with both math and text mode:
\documentclass[a4paper]{article}
\usepackage{upgreek,xspace}
\def\Mu{\ensuremath\upmu\xspace}
\begin{document}
Write \Mu in text or math mode because $\Mu\neq\mu$
\end{document}
6) The same as above but using txfonts
package and $\muup$
.
siunitx
. You will find lots of examples here at TeX.SX.