[Tex/LaTex] How to typeset some text including math content in sans serif

fontsmath-modesans-serif

I have a blurb of text in an external macro \SomeText, which I want to typeset in sans serif. However, \sffamily\SomeText does not change the math font and \sffamily\mathsf{\SomeText} does not work, as I am not in math mode.

So how can I typeset material in sans serif, whether it does or does not include math stuff?

\documentclass{article}
\usepackage{lmodern}

\newcommand{\SomeText}{This is some ($words \geq 5$) Text with math stuff in it: $a^2+b^2=c^2$}

\begin{document}
  \begin{description}
    \item[Roman:] \SomeText
    \item[Sans:] {\sffamily \SomeText \\ (however, the math is still Roman)}

%    LaTeX Error: \mathsf allowed only in math mode
%    \item[AllSans:] {\sffamily\mathsf \SomeText}
  \end{description}
\end{document}

Best Answer

Okay, I found a solution in embarrassingly short time after posting the question: The sansmath package provides the \sansmath command (and several environments) for this purpose.

I am yet curious to know if there is some solution that does not depend on an additional package.

\documentclass{article}
\usepackage{lmodern}
\usepackage{sansmath}
\newcommand{\SomeText}{This is some text with math stuff in it. 
    $x>5$, $a^2+b^2=c^2$}

\begin{document}
  \begin{description}
    \item[Roman:] \SomeText
    \item[Sans:] {\sffamily \SomeText \\ However, the math is still Roman.}
    \item[AllSans:] {\sffamily\sansmath \SomeText}
  \end{description}
\end{document}