Monday, 27 May 2013

Automatic upright math when text is in italic

Automatic upright math when text is in italic

This is in a way a follow-up to this question about upright math.
I would like to have upright math (essentially variable names) when I use a theorem-like environment with statement in italic. This used to be done that way in certain 19th century mathematical publications, and I would like to reproduce that look.
I could use \mathrm everywhere I need it in the formulas.
I could remove the $...$ everywhere only isolated letters are used in the statement.
I could use the mathastext LaTeX package with its "subdued" option
But
It's a pity to surcharge all the formulas for the special case of theorems
It's also not great to un-TeX math variables in theorems as well, also bad for proofreading, cuting and pasting.
The use of the mathastext package is quite heavy in consequences because of all its interaction with mathfonts, mathversions and seems a bit of a risk for a large document using already many packages. As its author himself writes:
Without the subdued option, the mathastextification applies by default to the whole of the document (and one may also define additional math versions in the preamble); with the subdued option the mathastextification is done only in math versions distinct from the standard and bold ones.
The previous description is in fact a bit optimistic: mathastext was not written initially in order to allow its action to be completely cancelled, and achieving this would require a complete rewrite of large portions of the code. In order to really have the displayed math (almost) as if mathastext had not been loaded, one must at a minimum also use the option defaultmathsizes. This does not quite suffice,[...]
So, is there a simple way I could define a theorem environment where (simple) math would be upright ?

No comments:

Post a Comment