Declaresymbolfont replaces dots with semicolon

When using this code: \DeclareSymbolFont{letters}{OT1}{cmss}{m}{n} % my dots become semicolon when they are inside of dollar markers $...$.

How can I fix this?

• That's quite normal, as the letters are usually in OML encoding. I guess you are trying to get sans-serif math. I suggest using the sansmathfonts package. May 12 '17 at 8:01
• I'm new at latex, so i'm not really sure what OML encoding is. What i was trying to do is to make my text in equation non-italic. Afterwards i made the greek letters non-italic using this code: \usepackage{upgreek,xspace}  \def\alpha{\ensuremath\upalpha\xspace} But now all of my dots became semi colons. Is there a work around for this problem? Thx. May 12 '17 at 8:08
• Thx @campa. \usepackage{sansmath} Did the trick. May 12 '17 at 8:32
• @campa Would you like to write up an answer? Jun 3 '17 at 20:58
• @TorbjørnT. Sorry, took a while... Jun 15 '17 at 13:18

The standard definition of the letters (from fontmath.ltx) is

\DeclareSymbolFont{letters}{OML}{cmm}{m}{it}


and a few lines later in the same file the period is defined as

\DeclareMathSymbol{.}{\mathord}{letters}{"3A}


This means that when you type a period . in math-mode, the symbol in the slot "3A (i.e. 58 in decimal numbers) from the letters is used. In an OML encoding this is indeed the period, as one may see from the following font table

With your command (whose purpose, I guess, is to have upright (?) sans-serif math)

\DeclareSymbolFont{letters}{OT1}{cmss}{m}{n}


your are saying that the letters have to be taken from a OT1-encoded Computer Modern sans-serif font; the font table is in this case

Comparing the two tables shows that the capital greek letters as well as the latin letters indeed take up the same slot in both cases, but most other symbols don't. In particular, typing . still looks for the slot "3A but now there is a colon there.

To make the long story short: if you want sans-serif math it's better you don't mess with low-level commands (unless you know them) but rather use dedicated packages like sansmath or sansmathfonts.