olsak / OpTeX

OpTeX - LuaTeX format with extended Plain TeX macros
http://petr.olsak.net/optex/
35 stars 14 forks source link

Math vs. text font change #10

Closed gromadan closed 3 years ago

gromadan commented 3 years ago

While the text font can be changed many times during the document using \fontfam, the same does not hold for math fonts (regardless of whether one uses \fontfam or \loadmath).

I am not sure, if this is a bug, or it is meant to work like this, but I find this behaviour strange. In particular, if one wants to do slides, that is, if you run \slides, then this command implicitly chooses \fontfam[heros] and hence if you want to choose another font for your slides, you must write something like

\fontfam[libertine]   %changes both text and math to libertine
\slides               %changes text to heros
\fontfam[libertine]   %changes text back to libertine

which I find a bit silly. (Or maybe I am missing something and I am using the macros wrong?)

olsak commented 3 years ago

You can use \noloadmath and \doloadmath as follows:

\noloadmath \slides
\doloadmath \fontfam[libertine]