2

How can I select and specify a font which contains the character I have in my file ?

Missing character: There is no ℕ in font cmss10!

I can see them perfectly within emacs, but I am unable to process them with xelatex because of this error

(edit) in emacs ℕ is said to be :

             position: 129 of 190 (67%), column: 14
            character: ℕ (displayed as ℕ) (codepoint 8469, #o20425, #x2115)
    preferred charset: unicode (Unicode (ISO10646))
code point in charset: 0x2115
               script: symbol
               syntax: w    which means: word
             category: .:Base, L:Left-to-right (strong)
             to input: type "\Bbb{N}" or "\bn" with Agda input method
          buffer code: #xE2 #x84 #x95
            file code: #xE2 #x84 #x95 (encoded by coding system utf-8-unix)
              display: by this font (glyph code)
    mac-ct:-*-Arial Unicode MS-bold-normal-normal-*-12-*-*-*-p-0-iso10646-1 (#xD24)
nicolas
  • 329
  • 2
    this for the moronic silent down vote – nicolas Apr 25 '16 at 08:37
  • 2
    Without any hint of how to reproduce the warning, there's not much anybody can say (I wasn't the downvoter). – egreg Apr 25 '16 at 08:40
  • The message is self explanatory : ℕ is not in the font cmss10. I dont see why one would want to 'reproduce'. it's about selecting a font which contains the wanted character – nicolas Apr 25 '16 at 08:47
  • How should we know how your document is configured? Which font is Emacs using to display it? – daleif Apr 25 '16 at 08:48
  • @daleif I guess the same as your browser.. – nicolas Apr 25 '16 at 08:49
  • 4
    \usepackage{amssymb} and $\mathbb{N}$ does it. What's the purpose of comparing the font substitutions Emacs makes with typesetting? – egreg Apr 25 '16 at 08:52
  • @egreg the point of using unicode is that you dont have to use those encodings, and have directly the wanted character displayed. I dont understand your question about the font substitution. – nicolas Apr 25 '16 at 08:54
  • 1
    @nicolas You should be using the unicode-math package, if you want to input your math as unicode characters. – Henri Menke Apr 25 '16 at 09:03
  • 5
    The question is why your document is trying to use cmss10 to typeset your char. So make a complete example. – Ulrike Fischer Apr 25 '16 at 09:04

1 Answers1

8

cmss10 is not a Unicode font unfortunately - you need to use a font which implements Unicode maths - the TeX Gyre collection is probably a good starting point. Here is an example:

\documentclass{article}
\usepackage{unicode-math}
\setmainfont{TeX Gyre Schola}
\setmathfont{TeX Gyre Schola Math}
\begin{document}
Some Unicode maths: $x ∈ ℕ$
\end{document}

Process with xelatex or lualatex to produce this:

enter image description here

You may need to install the TeX Gyre fonts.

Some other compatible fonts are listed on the Github page for unicode-math but the list there is slightly out of date. The Tex Gyre project also maintains a list of suitable maths fonts.

Thruston
  • 42,268