5

I would like to have

  • Calibri for text, and
  • CM Bright for math.

Is this possible?

My own attempt was to override the CM Bright text font using fontspec with the no-math option. However this does not work. Does anybody have an idea?

\documentclass{article}
\usepackage{cmbright}
\usepackage[no-math]{fontspec}
\setmainfont{Calibri}
\begin{document}
Test $test\int\xi$
\end{document}

[This is Windows. For Linux include the fonts in the directory and use \setmainfont[BoldItalicFont=calibriz.ttf, BoldFont=calibrib.ttf, ItalicFont=calibrii.ttf]{calibri.ttf}]

Carucel
  • 1,035
  • I had a similar question about how to correctly set CM Bright while using fontspec. Maybe the answer there also helps you. https://tex.stackexchange.com/questions/358418/using-cmbright-in-xelatex-for-math-and-text – Georg May 20 '17 at 15:30

2 Answers2

2

The cmbright package wrongly does \normalfont at the end.

\documentclass{article}

% fix the error in cmbright.sty that executes \normalfont
\let\latexnormalfont\normalfont
\let\normalfont\relax
% load cmbright
\usepackage{cmbright}
% restore the meaning of \normalfont
\let\normalfont\latexnormalfont

% restore the standard fonts for text
\renewcommand{\familydefault}{\rmdefault}
\renewcommand{\sfdefault}{cmr}
\renewcommand{\ttdefault}{cmtt}

\usepackage[no-math]{fontspec}

\setmainfont{Futura} % I don't have Calibri

\begin{document}

Test $test\int\xi$

\end{document}

enter image description here

egreg
  • 1,121,712
1

The following seems to work:

\usepackage{cmbright}
\usepackage{fontspec}
\setmainfont{Calibri}
\renewcommand{\familydefault}{\rmdefault}

However, I am still not sure why and if this is the correct way (does this work for all types of fonts?).

Carucel
  • 1,035