I have followed this
https://tex.stackexchange.com/a/385068/80468
advice to enable me to change the font with \sffamily in math mode:
\DeclareMathVersion{sfmath}
\SetSymbolFont{letters}{sfmath}{OT1}{\sfdefault}{m}{n}
\xapptocmd{\sffamily}{\mathversion{sfmath}}{}{}
However, this gives some weird artifacts, particularly with the use of lowercase Greek characters and periods. In fact, periods are converted to colons, so that
{\sffamily $a_1 \ldots a_n$} actually prints as if I was typing {\sffamily $a_1 ::: a_n$}.
What is the best way to overcome this?
Edit (minimal working example)
\documentclass[american, hidelinks]{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{xpatch}
% Math fonts.
\DeclareMathVersion{sfmath}
\SetSymbolFont{letters}{sfmath}{OT1}{\sfdefault}{m}{n}
\xapptocmd{\sffamily}{\mathversion{sfmath}}{}{}
\begin{document}
{\sffamily
\[
a_1 \ldots a_n = \mathit{foo}
\]
}
\end{document}
gives

lettersis OML, mapping them in full to OT1 doesn't work. – Ulrike Fischer Aug 08 '17 at 19:37lettersfamily fromOMLtoOT1which means you need to redefine almost every math command to the new layout, most likely you have removed lower case greek altogether (as OT1 does not have lower case greek) – David Carlisle Aug 08 '17 at 20:02