sebschub / FontPro

LaTeX support for Adobe's Pro opentype fonts: Minion Pro, Myriad Pro, Cronos Pro and possibly more
231 stars 43 forks source link

Sans-serif Greek letters not available with MyriadPro's sansmath #30

Closed jhrmnn closed 11 years ago

jhrmnn commented 11 years ago

When MyriadPro is loaded with sansmath option, using \mathsf{\alpha} produces serif alpha, even though sans-serif alpha clearly is available when MyriadPro is fully loaded.

sebschub commented 11 years ago

In general and independently of FontPro, \mathsf as well as e.g. \mathbf do not act on greek letters. I adjusted the \boldsymbol command to fit your need:

\documentclass{article}

\usepackage[sansmath]{MyriadPro}

\makeatletter
\DeclareRobustCommand{\sanssymbol}[1]{
  \begingroup
  \let\@nomath\@gobble \mathversion{sans}%
  \math@atom{#1}{%
    \mathchoice%
    {\hbox{$\m@th\displaystyle#1$}}%
    {\hbox{$\m@th\textstyle#1$}}%
    {\hbox{$\m@th\scriptstyle#1$}}%
    {\hbox{$\m@th\scriptscriptstyle#1$}}}%
  \endgroup}
\makeatother

\begin{document}
$\mathsf{a}\mathsf{\alpha}$ $\mathbf{a}\mathbf{\alpha}$ $\sanssymbol{a}\sanssymbol{\alpha}$
\end{document}
jhrmnn commented 11 years ago

I see. Thank you very much for explanation and help!