5

I'd like to change the font of the mu-Symbol in siunitx so that it matches the mu-Symbol in the text mode unfortunately my code doesn't really work. I would be very grateful for any feedback you might be able to give me.

\documentclass[ngerman]{scrartcl}
\usepackage[english,ngerman]{babel}
\usepackage[utf8]{inputenc}

%Bitstream Chracter
\usepackage[scaled=.98,sups,lf]{XCharter}
\usepackage[libertine,bigdelims,vvarbb,scaled=1.03]{newtxmath}

%Define Greek Characters
\DeclareMathVersion{mathchartertext}
\SetSymbolFont{letters}{mathchartertext}{OML}{mdbch}{m}{n}
\newcommand{\gchar}[1]{\mathversion{mathchartertext}$#1$\mathversion{normal}}

\usepackage[per=slash,decimalsymbol=comma,loctolang={DE:ngerman}]{siunitx}
\sisetup{locale=DE,
        math-micro={\muup}, %-->   \gchar{\mu}
       % math-ohm  =\Omegaup,
      %  text-micro={\fontfamily{mdbch}\textmu},
      %  text-ohm  ={\fontfamily{mdbch}\textohm},
list-final-separator = { \translate{und} },
range-phrase = { \translate{bis} },
detect-weight = true,
detect-inline-weight = math
%binary-units = true
}

\begin{document}
\gchar{\mu} \gchar{\ohm} \\
\SI{10}{\micro \ohm}
\end{document}

1

Troy
  • 13,741
jlk
  • 1,729

1 Answers1

3

If you want to mess about with \mathversion then you have to be outside of math mode. Thus the best approach is to define \gchar as

\newcommand*\gchar[1]{\text{\mathversion{mathchartertext}$#1$}}

You can then use it as the argument to math-micro and all will be well.

Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
  • Thanks for your help, it seems to me that your code changes the spaceing between mu and omega. Is there a away to have the original spacing? http://s27.postimg.org/ald9ovs9f/Capture2.png – jlk Oct 13 '14 at 06:28
  • @harryhaller How are you measuring your 'spacing' here? A trace shows no additional glue or kern between the two parts of the output (micro and ohm), which is what I'd expect. – Joseph Wright Oct 13 '14 at 07:37
  • I think this is a good alternative: http://tex.stackexchange.com/a/135125/25683. – henry Oct 13 '14 at 08:21