2

I want to use Source Serif Pro as mainfont and XITS Math as mathfont. But \setmainfont{Source Serif Pro} makes \SI{100}{\ohm} not working.

enter image description here

if remove \setmainfont{Source Serif Pro}, it looks pretty good, but the question is, I need the font as main foot

enter image description here

How to fix it? I want to use mathfont for all SI-Unit

Thank you all in Advance!

MWE

\documentclass{article}

\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{gensymb}
\usepackage[detect-weight]{siunitx}
\usepackage{bm} 

\usepackage[no-math]{fontspec}
\usepackage{unicode-math}

\setmainfont{Source Serif Pro}
\setmathfont[StylisticSet=1]{XITS Math}


\begin{document}
        \SI{100}{\ohm} \\
        $100 \Omega$ % Omega as ohm, not nice
\end{document}
  • 1
    From the manual of amsbsy: "Note: It is recommended nowadays to use the bm package, which became available in 1997." Are you sure you need the amsbsy package? The note suggests that you should be fine using just bm. – Skillmon Sep 23 '18 at 19:00
  • @Skillmon thanks for the advice, I will delete it. – sun0727 Sep 23 '18 at 19:06
  • Regarding the symbol, it seems like the font you're using doesn't have that symbol. You could either use another font that has one or borrow it from another font. I think there are questions on the network on how to use single symbols from another font. – Skillmon Sep 23 '18 at 20:36
  • @Skillmon, the mainfont Source Serif Pro doesn't have the symbol but mathfont has. How to use the mathfont for this unit-sysmbol – sun0727 Sep 23 '18 at 21:03
  • 1
    I can only suggest to reinstall the newest version of Source Serif Pro via the GitHub release page. If you scroll down, one feature mentioned there was “double-map various glyphs (e.g. Greek capital letter Omega/Ohm)”. Maybe it was a bug but now fixed. – Ruixi Zhang Sep 23 '18 at 22:20
1

With the newest Source Serif Pro (Roman fonts version 2.007 and Italic fonts version 1.007) found here on GitHub, and the newest XITS Math found here on GitHub, your MWE produces the correct output. One of the new feature of Source Serif Pro states

double-map various glyphs (e.g. Greek capital letter Omega/Ohm)

So probably this was a bug, but now fixed in the Source Serif Pro font family.

Since you are using XITS Math with unicode-math, you should not load amssymb (this package provides symbols based on Computer Modern). Also, gensymb is IMHO unnecessary.

% Compile with XeLaTeX or LuaLaTeX
\documentclass{article}

\usepackage{mathtools}
\usepackage[detect-weight]{siunitx}
\usepackage{bm}

\usepackage[no-math]{fontspec}
\setmainfont{Source Serif Pro}

\usepackage{unicode-math}
\setmathfont[StylisticSet=1]{XITS Math}

\begin{document}
    \noindent \SI{100}{\ohm} \\
    $100 \Omega$ % Omega as ohm, not nice
\end{document}

correct Omega

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.