I have a document whose main font is a sans serif font (Arial if you must know), but whose math mode uses a serif font. They look quite different.
So far, my documents which don't switch looks like this, and I've always used \mathit{} or \mathrm{} in order to fix the spacing in multi-letter expressions such as subscripts.
However, after switching fonts (which I am obliged to, this is the official template...), I'm discovering that \mathit{}, notwithstanding the "math" in its name does not actually use the math font but the text font, and suddenly all my multi-letter expressions (especially words or acryonyms in subscripts) look like I'm a five year-old who just discovered they can switch fonts every five words to make it look "more interesting".
I've looked around and found a few topics here:
Typesetting multi-letter variable names in math mode
Problem formatting a subscript in math mode
Difference between \mathit and math-style = TeX
Especially that last one explains that apparently \mathit{} is meant to use the plain text font? \textit{} definitely uses the plain text font, too. So... what then do I need to use to keep using the math font but change the kerning to get a group of letters to look like one word/acronym instead of multiple symbols, without defacing my document?
I've also found some useful hints about the unicode-math package via this question but as far as I can tell right now, the \symit{} and \symrm{} commands, although they stick to the math font, will also stick to the same spacing -- which has me scratching my head about what they are actually for, but that's a different question.
Examples: (requires \usepackage{unicode-math} and \usepackage{tabto})
\NumTabs{7}
single: \tab $m_k$ \tab $m_O$\\
multiple: \tab $tsfc_{ref}$\tab $m_{OEM}$\\
symit: \tab $\symit{tsfc}_{\symit{ref}}$\tab $m_{\symit{OEM}}$\\
mathit:\tab $\mathit{tsfc}_\mathit{ref}$\tab $m_\mathit{OEM}$\\
text:\tab $\text{tsfc}_\text{ref}$ \tab $m_\text{OEM}$\\
textsf:\tab $\textsf{tsfc}_\textsf{ref}$\tab $m_\textsf{OEM}$\\
textrm:\tab $\textrm{tsfc}_\textrm{ref}$\tab $m_\textrm{OEM}$\\
mathsf:\tab $\mathsf{tsfc}_\mathsf{ref}$ \tab$m_\mathsf{OEM}$\\
mathrm:\tab $\mathrm{tsfc}_\mathrm{ref}$ \tab$m_\mathrm{OEM}$\\
manual:\tab $t\!s\!f\!c_{r\!e\!f}$\tab $m_{O\!E\!M}$\\
The first line shows what regular single-letter expressions and subscripts look like. None of the other ones looks okay to me, next to that. The last line uses manual negative spaces to get the letters a bit closer together, but this is a very blunt tool and while it happens to kind-of work for the capital-letter expressions, it really does not for the lowercase ones.
So far, \mathit{} (or sometimes \mathrm{}) has been my go-to solution but with text and math fonts looking so differently, it's really not doing it. For better or worse, there are a lot of multi-letter variables in my discipline (I know, I don't like it but that's how it is), and I want them to make clear those letters form a unit, but I really don't want them to look like prose, and entirely out of place.
==> is there any command that uses the math font (upright or italic it not that important to me anymore...) but spaces the letters like normal text?
...or could this possibly be an issue with the choice of math font in my document? The text font is specified explicitly, but I haven't (yet) found out where the math fond is specified in the class.
What I did find: \setmainfont{Arial}, \setmathsf{Arial} and \setmathtt{Arial}. Commenting out the last two did not help, and leaving them in still produces serifs in all mathematical expressions (unless I wrap them in formatting commands, of course).
I prefer to keep serifs in the math font, but I'd like to be able to use kerning in multi-letter variables or subscripts.




\stxtand then use that. Then you can control from the preamble what is the best choice for your document. One might argue that it should be the up version of the text font, aka\textup, as it then better follow the current text choice. For example in beamer\mathrmis not correctly set to be equal to\mathsf, so\mathrmwould be wrong in a standard beamer doc. Therefore define a macro to use in the document, and control it from the preamble.\mathit(which should be set up to use an italic font compatible with your math font) or\textitwhich should use the italic font used in the non math part. If you are using some custom font setup perhaps one or both of\mmathitor\textitis not set up correctly, that could be fixed but we would need more information\setmainfont{Arial}in the .cls file, my whole text has serifs and\mathitindeed behaves as I would like it to. In that case, the characters become visually indistinguishable from the other math expressions but with closer spacing, as I want it. They are then also equal to what\textitproduces outside of a math environment. So the question remains: How to I make sure that\mathitproduces the same shapes as the math font, independent of the text font? Or: Where do I need to dig to find out?