TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I set my font to sans serif via


Now I want to use some symbols -not all- (only normal letters or greek letters) from the standard computer modern math font in mathmode.

Unfortunatly neither



{\fontfamily{cmm}\selectfont $w$}

will give me the desired result.

I want to use it in a tikz-environment, but I guess that's no difference to the usual usage.

update: I am a little confused about the fact, that I cannot change the font at all. Neither with the above mentioned selectfont-command nor in tikz via (for example)

\node[font=\rmfamily] at (0,0) {$w$};
share|improve this question

The following example using \mathrm seems to work nicely in MikTeX 2.9 with a tikz-box:



    \node[rectangle,inner xsep=10pt,inner ysep=10pt,
          anchor=south,text width=\columnwidth,shade]{#1};


sans serif text

\mycolorbox{Sans serif: $a + b$, CM: {$\mathrm{c}$}}


I think you need to explicitly enable this with the mathrmOrig option in sfmath. The result looks like this:

TeX example rendered

share|improve this answer
This works also for me with TexLive 2011 with pdflatex. – Nicolás Jan 26 '12 at 20:07
Thanks, that also works in TexLive2010. But is there a solution to get the computer modern math font (cmm) working, too? – Matz Jan 26 '12 at 20:19

Your Answer


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.