Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Here's a simple demonstration program:

\documentclass[12pt]{article}
\usepackage[utf8x]{inputenc}

\DeclareMathVersion{sans}
\SetSymbolFont{letters}{sans}{OT1}{cmss}{m}{sl}

\begin{document}
\[
    x +  \alpha \beta
\]
\mathversion{sans}
\[
    x  + \alpha \beta
\]
\end{document}  

It works fine, but the sans serif math does not have correct greek characters. Adding the following lines almost fixes the problem:

\usepackage[LGR]{fontenc}
\DeclareSymbolFont{grekletters}{LGR}{cmr}{m}{sl}
\DeclareMathSymbol{\alpha}{\mathord}{grekletters}{`a}
\DeclareMathSymbol{\beta}{\mathord}{grekletters}{`b}
%...
\SetSymbolFont{grekletters}{sans}{LGR}{cmss}{m}{n}

But now the Greek characters in math mode are not the original ones. Where are the original ones?

There's a similar question: Replacing greek glyphs in math mode. It is about luatex, though.

Also, I cannot use the sansmath package because it does not support my font encoding.

share|improve this question
add comment

1 Answer 1

up vote 4 down vote accepted

The letters font should be a font encoded as OML, not OT1; you can use CMBright for those and for the OMS family; a decent substitute for the large symbols can be Iwona:

\SetSymbolFont{operators}   {sans}{OT1}{cmss} {m}{n}
\SetSymbolFont{letters}     {sans}{OML}{cmbrm}{m}{it}
\SetSymbolFont{symbols}     {sans}{OMS}{cmbrs}{m}{n}
\SetSymbolFont{largesymbols}{sans}{OMX}{iwona}{m}{n}
share|improve this answer
    
What's the difference between cmbr and cmbrm? Anyway, it seems to work. Unfortunately the font does not end up vectorized in my final PDF. –  Ben Apr 16 '12 at 20:12
    
The omlcmbr.fd file just refers to fonts defined in omlcmbrm.fd, so I used the latter. In my TeX Live I have the Type1 fonts, which are in a hfbright directory. What distribution are you using? –  egreg Apr 16 '12 at 20:15
    
I'm using Miktex 2.9. I guess I could live with the sans serif greek characters being bitmaps, but I'll leave this question open for a while to see if anyone else has an idea. –  Ben Apr 16 '12 at 20:45
1  
The MiKTeX packages page refers to hfbright: miktex.org/packages/hfbright –  egreg Apr 16 '12 at 20:48
1  
@Speravir The CM-Super fonts have nothing to do with CM Bright. The description of the hfbright package for MiKTeX says: "The hfbright fonts (Type1 version of the CM Bright fonts)" –  egreg Apr 16 '12 at 23:17
show 3 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.