I'm using the awesome-cv class file (from here) to write a statement, but I'm unhappy with the math fonts. Specifically, I don't like the result of using \mathbb. Also, math operators (even predefined ones like \log) are italicized while I would like them to be as in \mathrm (as shown below).
I tried installing a different font (Palatino) in the fonts directory, but this did not affect the math font at all.
I would even be willing to change the font entirely using, e.g., \usepackage{mathpazo}, but it doesn't seem to change anything, probably due to specifications in the awesome-cv.cls file.
The awesome-cv.cls file includes the line \RequirePackage[math-style=TeX,vargreek-shape=unicode]{unicode-math}, and it turned out that configuring the math font with this package was most of my problem.
Some useful posts:
Changing the operator font with unicode-math loaded, Unicode-math changes font outside of range, lost symbols with unicode-math
Final update thanks to Davislor's comments.
MWE:
% Important note:
% This template must be compiled with XeLaTeX, the below lines will ensure this
%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%----------------------------------------------------------------------------------------
% PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------
\documentclass[letterpaper]{awesome-cv}
\geometry{left=2cm, top=1.5cm, right=2cm, bottom=2cm, footskip=.5cm}
\fontdir[fonts/]
% math packages
%\usepackage{amssymb} % throws errors/conflicts
\usepackage{amsfonts}
\usepackage{amsmath}
% math commands
% new commands
\renewcommand{\C}{\mathbb C}
\newcommand{\R}{\mathbb R}
\newcommand{\Q}{\mathbb Q}
\newcommand{\Z}{\mathbb Z}
% new operators
\DeclareMathOperator{\Gal}{Gal}
\setmathfont[Path=fonts/STIXv2.0.0/OTF/]{STIX2Math.otf}
%\setmathfont[Path=fonts/,range=\sqrt]{SourceSansPro-Regular.otf}
\setmathfont[range=\mathnormal,Path=fonts/]{SourceSansPro-It.otf}
\ExplSyntaxOn
\makeatletter
\renewcommand{\operator@font}{\um_switchto_mathsf:}
\makeatother
\ExplSyntaxOff
%\setmainfont[Path=fonts/]{SourceSansPro-Regular.otf}
%\setmathfont[Path=fonts/]{SourceSansPro-It.otf}
\begin{document}
%----------------------------------------------------------------------------------------
% LETTER CONTENT
%----------------------------------------------------------------------------------------
\begin{cvletter}
%------------------------------------------------
$$
\log(N) \qquad \mathrm{log}(N)
$$
$$
\C \quad \R \quad \Q \quad \Z
$$
$$
\Gal(K/\Q) \quad \mathrm{Gal}(K/\Q)
$$
$$
\varphi: X \to Y
$$
\end{cvletter}
\end{document}
Thanks for any help!


$$...$$. See Why is\[...\]preferable to$$...$$? – Werner Oct 25 '18 at 02:11fontspec. You therefore probably want to loadunicode-mathand use the\setmathfontcommand. (You would want\setmathfont[range=it]{SourceSansPro-It.otf}and so on to match your text font.) You might also be able to usemathspec. – Davislor Oct 25 '18 at 21:21newpxtextandnewpxmathare more up-to-date thanmathpazo. – Davislor Oct 25 '18 at 21:28\RequirePackage[math-style=TeX,vargreek-shape=unicode]{unicode-math}. I tried adding something close to your suggestion,\setmathfont[range=\mathnormal,Path=fonts/]{SourceSansPro-It.otf}. As you can see in the updated picture, now the math operators are displayed correctly, but I've lost\mathbband math symbols like $\phi$. How do I fix this? Thanks again! – Viktor Vaughn Oct 25 '18 at 23:03\setmathfont{STIX Two Math}, and then override one or more of the math alphabets (up, it, by up, bfit, etc.). I would also suggest you set\defaultfontfeatures{Scale=MatchLowercase}before you start declaring any fonts. That will ensure they come out properly scaled. – Davislor Oct 26 '18 at 00:32\mathrm{Gal}problem. Since you appear to be using this font only for operator names, the simplest workaround is to use\operatorname{Gal}. You can also, however,\setmathfont[range=up]{SourceSansPro-Regular.otf}and use\symup, as well as overriding\setoperatorfontand\setmathrmif you need to. – Davislor Oct 26 '18 at 00:48\mathbbtypesetting. I think the class file is kind of wonky, so I did have to fix the operator fonts, too. I think\DeclareMathOperator{\Gal}{Gal}is just a wrapper for\newcommand{\Gal}{\operatorname{Gal}}, so I had to try something a bit trickier. I think my version ofunicode-mathneeds updating so I had to do some more fiddling, but the answer here worked. – Viktor Vaughn Oct 26 '18 at 01:31