[Tex/LaTex] XeLaTeX, Latin Modern, \mathbb and \mathcal

fontsunicode-mathxetex

I'm using XeLaTeX on Linux. I know that Latin Modern Roman is the default font of XeLaTeX, however if in my preamble I write

\setmainfont{Latin Modern Roman}
\setsansfont{Latin Modern Sans}
\setmonofont{Latin Modern Mono}
\setmathfont{Latin Modern Math}

I get errors like

The font "Latin Modern Roman" cannot be found \setmainfont{Latin Modern Roman}.

I really do not understand what is the name of this defaul character.
Then, I use unicode-math package: my preamble is

\documentclass{article}
\usepackage{fontspec}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
%\setmainfont{Latin Modern Roman}
%\setsansfont{Latin Modern Sans}
%\setmonofont{Latin Modern Mono}
% \setmathfont{Latin Modern Math}
\usepackage{unicode-math} 

I don't like default \mathbb and \mathcal font of XeLaTeX. I noticed that, if I remove unicode-math I get the correct symbols. How to continue using unicode-math and having AMS font fot \mathbb and \mathcal?

Best Answer

I don't know why Latin Modern Roman is not recognized, perhaps it's not correctly installed as a system font.

For getting the “traditional” calligraphic and blackboard fonts you can use the standard setup.

\documentclass{article}
\usepackage{amsmath} % should go before unicode-math
%\usepackage{fontspec} % already loaded by unicode-math
\usepackage{unicode-math}
\usepackage{amsthm}

\setmainfont{Latin Modern Roman}
\setsansfont{Latin Modern Sans}
\setmonofont{Latin Modern Mono}
\setmathfont{Latin Modern Math}

\DeclareMathAlphabet{\mathcal}{OMS}{cmsy}{m}{n}
\let\mathbb\relax % remove the definition by unicode-math
\DeclareMathAlphabet{\mathbb}{U}{msb}{m}{n}

\begin{document}

abc \textsf{def} \texttt{ghi}

$a+b\in\mathbb{R}\setminus\mathcal{ABC}$

\end{document}

enter image description here