I am wondering how to alternate sans and serif greek fonts within mathematical expressions. The package sansmathfonts changes the font to the whole document, which I don't want to. I have read related posts and I think one has to define a special math alphabet, say \mathsfgreek, in some sense similarly to
\SetSymbolFont{letters}{sans}{OML}{cmbrm}{m}{it}.
I tried to use something like \usefont with similar parameters without success. I would like to have the choice between sans normal (upright), sans italic, sans bold normal, and sans bold italic, which should all be available in cmss. I would like to write something like
\[ \alpha\mathsfgreek{\alpha} \]
where \alpha on the left is normal and \alpha on the right is sans (upright). Can you give me some hint?
Thank you!

\ssigmainstead of\sigma). Is there a way to automate it? (e.g. writing\mathsf{\alpha}uses\salphainstead of\alpha: it seems to be a natural behavior for the\mathsfcommand, isn't it?). – Monte Carlo Oct 25 '16 at 16:22\sSigmaand also\supsigmaand so on). She should just write\mathsf{\Sigma}and get the capital, sans\Sigma. Then for upright letters there's a different new symbol font I guess. I can do it by myself if I have the command for the lower case letters. – Monte Carlo Oct 25 '16 at 16:24\SetMathAlphabet, e.g. something along the line of
– Monte Carlo Oct 25 '16 at 19:14\SetMathAlphabet{\mathsf}{normal}{\math@lph@encoding}{\mathsf@lph}{m}{n}? (just an idea)\sansfontthat can take latin or greek letters; 2) use\ifcat\noexpand#1\relaxto check whether the argument is latin or greek (not very robust but it works as long as we are aware that the argument has to be a latin or greek letter); 3) if the argument is a latin letter, use\mathsf; 4) otherwise, modify (in some way I am unaware of) the argument (which is a greek letter) by adding ansat the beginning, e.g. from\alphato\salpha– Monte Carlo Oct 26 '16 at 00:07\msf{\Sigma}command doesn't seem to work? Alternatively, should I just change\DeclareMathSymbol{\schi}{\mathord}{sfletters}{"1F}, presumably the last code? What the name of this "code", and where can I find a list (this one file:///home/matifou/Downloads/amssymb.pdf doesn't seem to have greek letters)? Thanks!! – Matifou Apr 11 '22 at 14:42\mathsf{\Gamma}? – egreg Apr 11 '22 at 20:31