0

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

enter image description here

dow
  • 648
  • 4
  • 9

0 Answers0