matze / mtheme

A modern LaTeX Beamer theme
6.44k stars 845 forks source link

Use text font for Greek in math #352

Open beojan opened 5 years ago

beojan commented 5 years ago

I'm trying to use the text font for Greek letters in math. Following the font override code in Beamer, I have:

\AtBeginDocument{%
    \DeclareMathSymbol{\Gamma}\mathalpha{pureletters}{"0394}%
    \DeclareMathSymbol{\Delta}\mathalpha{pureletters}{"0395}%
    \DeclareMathSymbol{\Theta}\mathalpha{pureletters}{"0398}%
    \DeclareMathSymbol{\Lambda}\mathalpha{pureletters}{"039B}%
    \DeclareMathSymbol{\Xi}\mathalpha{pureletters}{"039E}%
    \DeclareMathSymbol{\Pi}\mathalpha{pureletters}{"03A0}%
    \DeclareMathSymbol{\Sigma}\mathalpha{pureletters}{"03A3}%
    \DeclareMathSymbol{\Upsilon}\mathalpha{pureletters}{"03A5}%
    \DeclareMathSymbol{\Phi}\mathalpha{pureletters}{"03A6}%
    \DeclareMathSymbol{\Psi}\mathalpha{pureletters}{"03A8}%
    \DeclareMathSymbol{\Omega}\mathalpha{pureletters}{"03A9}%
    %
    \DeclareMathSymbol{\alpha}\mathalpha{pureletters}{"03B1}%
    \DeclareMathSymbol{\beta}\mathalpha{pureletters}{"03B2}%
    \DeclareMathSymbol{\gamma}\mathalpha{pureletters}{"03B3}%
    \DeclareMathSymbol{\delta}\mathalpha{pureletters}{"03B4}%
    \DeclareMathSymbol{\epsilon}\mathalpha{pureletters}{"03F5}%
    \DeclareMathSymbol{\zeta}\mathalpha{pureletters}{"03B6}%
    \DeclareMathSymbol{\eta}\mathalpha{pureletters}{"03B7}%
    \DeclareMathSymbol{\theta}\mathalpha{pureletters}{"03B8}%
    \DeclareMathSymbol{\iota}\mathalpha{pureletters}{"03B9}%
    \DeclareMathSymbol{\kappa}\mathalpha{pureletters}{"03BA}%
    \DeclareMathSymbol{\lambda}\mathalpha{pureletters}{"03BB}%
    \DeclareMathSymbol{\mu}\mathalpha{pureletters}{"03BC}%
    \DeclareMathSymbol{\nu}\mathalpha{pureletters}{"03BD}%
    \DeclareMathSymbol{\xi}\mathalpha{pureletters}{"03BE}%
    \DeclareMathSymbol{\pi}\mathalpha{pureletters}{"03C0}%
    \DeclareMathSymbol{\rho}\mathalpha{pureletters}{"03C1}%
    \DeclareMathSymbol{\sigma}\mathalpha{pureletters}{"03C3}%
    \DeclareMathSymbol{\tau}\mathalpha{pureletters}{"03C4}%
    \DeclareMathSymbol{\upsilon}\mathalpha{pureletters}{"03C5}%
    \DeclareMathSymbol{\phi}\mathalpha{pureletters}{"03D5}%
    \DeclareMathSymbol{\chi}\mathalpha{pureletters}{"03C7}%
    \DeclareMathSymbol{\psi}\mathalpha{pureletters}{"03C8}%
    \DeclareMathSymbol{\omega}\mathalpha{pureletters}{"03C9}%
    %
    \DeclareMathSymbol{\varepsilon}\mathalpha{pureletters}{"03B5}%
    \DeclareMathSymbol{\vartheta}\mathalpha{pureletters}{"03D1}%
    \DeclareMathSymbol{\varrho}\mathalpha{pureletters}{"03F1}%
    \DeclareMathSymbol{\varphi}\mathalpha{pureletters}{"03C6}%
    %
}

Unfortunately, I get the wrong characters, presumably because the encoding isn't correctly set.

Is there some way to correctly set the encoding here? If so, this could be included in the theme, to use characters from the text font wherever possible (Greek letters, comparison symbols, etc.).