Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

11
  • 1
    If it is a named index, then IMO it should always be upright. Best thing to do is to make a macro for it, say, \stxt and 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 \mathrm is not correctly set to be equal to \mathsf, so \mathrm would be wrong in a standard beamer doc. Therefore define a macro to use in the document, and control it from the preamble. Commented May 10, 2024 at 10:41
  • the math font has no information or glyphs suitable for multi-letter words, so your choice for an italic word is to use \mathit (which should be set up to use an italic font compatible with your math font) or \textit which should use the italic font used in the non math part. If you are using some custom font setup perhaps one or both of \mmathit or \textit is not set up correctly, that could be fixed but we would need more information Commented May 10, 2024 at 10:49
  • @DavidCarlisle what I worked out so far is that if I comment out \setmainfont{Arial} in the .cls file, my whole text has serifs and \mathit indeed 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 \textit produces outside of a math environment. So the question remains: How to I make sure that \mathit produces the same shapes as the math font, independent of the text font? Or: Where do I need to dig to find out? Commented May 10, 2024 at 11:15
  • You can't ensure that in general. Most math fonts are derived from a text italic font and you need to choose that font, eg by default the math is in latin modern math, and you therefore want latin modern italic. If you have changed the math to say TeX Gyre Termes math, then you want to use TeX Gyre Termes Italic, but the name association is not always so simple and you need to make a choice, eg if using Stix Two math you might still want TeX Gyre Termes Italic as they are both "Times Roman" in style Commented May 10, 2024 at 11:33
  • 1
    You really should always provide a test document, anyway I have posted an answer that would apply to most cases, but uses unicode-math in the example. Commented May 10, 2024 at 12:58