\documentclass[12pt]{ltxdoc}
\setlength\parskip{3pt}
\begin{document}
\title{The \textsf{sansmath} package}
\author{Donald Arseneau}
\date{2026/06/13, version 1.2}
\maketitle

\subsection*{Purpose}
The purpose of \textsf{sansmath} is to offer sans-serif math in the absence
of proper sans math fonts by using the text sans-serif font (as given
by \cs{sfdefault}). 

Despite the original hope of wide applicability to most sans-serif
(text) fonts, few have worked well with this package; 
the only really good results have been for Computer Modern with 
\textsf{cmss}, whereas the result for Helvetica was particularly vile.
(If you find other fonts that work well, please share the information!)

\subsection*{Use}

Declare |\usepackage{sansmath}| in the document preamble.  This will
define a new ``math version''
\texttt{sans}, together with a command \cs{sansmath}, which
is analogous to \cs{boldmath}.

There is also a command \cs{unsansmath} (to undo \cs{sansmath}), but 
it is probably better to use grouping if the effect of \cs{sansmath}
is to be localized (perhaps using 
|\begin{sansmath}| \dots\ |\end{sansmath}|).

When a \cs{sansmath} declaration is in effect, math characters
will be taken from the text sans-serif family as much as possible.
The actual sans fonts are OT1 encodings of those indicated by the 
meaning of \cs{sfdefault} \emph{WHEN THE PACKAGE WAS LOADED}, not the
meaning at each math environment!

Since the \texttt{OT1} text fonts do not provide the lower-case greek 
letters, there is a package option |[eulergreek]| to take the 
lower-case greek from the Euler maths\footnote{It is ``maths''
with thanks to and fond memory of Robin Fairbairns.} fonts.

Further, since some (many) sans fonts have no uppercase greek letters 
either (missing characters from the \texttt{OT1} encoding), there is an
option |[EULERGREEK]| to take \emph{all} greek letters from the
euler fonts.  In this case one should also investigate using
Euler fonts for \emph{all} mathematics in the document, using
package \textsf{eulervm} instead of this one!

\texttt{OT1} encoding is normally required to get the uppercase greek
letters, but if you use the |[EULERGREEK]| option or don't use
any uppercase greek letters, then you are welcome to define
\cs{sansmathencoding} \emph{before} loading this package.  There is
also a package option |[T1]| to perform that particuler
definition.  Note the comment above about only \textsf{cmss} being
good~--- even the \texttt{T1}-encoded {ec} fonts are poor
substitutes.

The package achieves maths-italic by reloading the slanted version of
the text sans-serif font, and changing a \texttt{fontdimen} parameter
(spaceskip).  This causes the italic correction to be applied between
letters (good) but does not break up the `fi' and `fl' ligatures
(bad).  (Why does a sans font have these ligatures anyway?)  As yet,
nothing is done about this bug. 

\end{document}
