3

I'm forced to use a commercial (Univers) font in my presentations, which obviously does not contain a dedicated \minus sign, which is called by . (Though I'm not sure if it is \minus or something else.) So if I'm typing

\SI{-1984}{m^{-42}}

I don't get any minus displayed. Unfortunately I didn't found any free font with the same behaviour. But I hope you understand what I mean.

How can I include the missing minus sign from another font into my text font to get to work properly?


Here is a MWE:

\documentclass{beamer}

\usefonttheme{professionalfonts}
\usepackage{siunitx}
\usepackage{fontspec}
\usepackage{unicode-math}

\setmainfont{Univers 45 Light} 
\setmathfont{XITS Math}

\setbeamerfont{normal text}{family=\rmfamily,series=\normalfont}

\AtBeginDocument{
\usebeamerfont{normal text}
\sisetup{detect-all}
\sisetup{math-rm=\mathrm, text-rm=\rmfamily}
\sisetup{per-mode=fraction,fraction-function=\sfrac}
}

\begin{document}

\begin{frame}
The dash - is working. But the minus sign in \alert{siunitx} (e.g. \SI{-1984}{m^{-42}}) isn't, apart from when it is used in math-mode (e.g. $\SI{-1984}{m^{-42}}$). But in text I'd like to use my text font.
\end{frame}

\end{document}

giving me the output:

enter image description here

I don't have the problem with other fonts.


I tried various things, the first two gave me syntax errors:

\setmainfont[\minus="2212]{XITS Math}

or as I'm used to do for the math font:

\setmainfont[range={="2212}]{XITS Math}

And I found this code as well,

\newunicodechar{"2212}{{\fontspec{XITS Math}"2212}}
\newunicodechar{\minus}{{\fontspec{XITS Math}\minus}}
\newunicodechar{-}{{\fontspec{XITS Math}-}}

none of them working.

Any more suggestions?


The font I used does contain the character \char"2013 but it doesn't contain \char"2212 but it appears to me that this is the one called by when the minus is typed.

egreg's suggestion

\usepackage{newunicodechar}
\newunicodechar{^^^^2212}{\char"2013}

works for the unit

\SI{-1984}{m^{^^^^2212 42}}) 

but doesn't for the number, as ^^^^2212 it is an invalid numeric character.

0 Answers0