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.

  • you can probably get away with an n-dash -- U+2013 – David Carlisle Apr 30 '15 at 12:00
  • but how and where do I need to declare or use that? – thewaywewalk Apr 30 '15 at 12:04
  • simplest is just to use -- instead of - in your text, which is all I was suggesting) – David Carlisle Apr 30 '15 at 12:05
  • I get a misplaced sign token error: Misplaced sign token '--1984' – thewaywewalk Apr 30 '15 at 12:08
  • oh in siunitx, I was thinking of plain text, but anyway isn't that a minus sign at the start of the row with other math sybols here myfonts.com/fonts/linotype/univers/pro-55-roman/… – David Carlisle Apr 30 '15 at 12:11

Your Answer

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

Browse other questions tagged or ask your own question.