Friday, August 31, 2012

san serif math fonts

So I switched formatting in my thesis to a san serif font because I prefer it and my figures all had san serif fonts in them already and I wanted them to match so... but I have some equations and lots of in-text symbols, superscripts and subscripts using math mode and when I switched to san serif they stayed serif, unless I used \text{} in math mode.
 I stumbled upon this post in stack exchange:
Some (partial) solutions I found:
  • Use fontspec to change the math font
Like this:
\setboldmathrm[BoldFont={Optima ExtraBlack}]{Optima Bold}
However this does not change the italic math font for some reason (and there does not seem to be an option to do this(?)).
  • Use sfmath, which comes with a couple of pre-packaged fonts
This works fairly well, but the choice of fonts is limited.
For example:
\setmathfont{XITS Math}
%\setmathfont[range=\mathit/{latin,Latin}]{Adobe Garamond Pro}
Although this has the problem that \setmathfont{} gives a bug when used in combination withamsmath...
fontspec required more effort than the one minute I really wanted to spend on it. sfmath didn't work for me??? and cmbright worked first go with just \usepackage{cmbright}. Font blends well with my current (supposedly Arial) san serif font.