I read many things about people wanting math mode in sans-serif font and doing crazy things with packages and options to get that, but I did not find anything that would simply make my math mode font non-italic.

Is there an (easy) way to set math mode font to be non-italic?

And is there a way to do that globally for the whole document?


5 Answers 5


On a case-by-case basis, it is possible to typeset text within math mode using \textrm{...} or \mathrm{...}, the latter being used predominantly for typesetting units or symbols and not pure text (since it gobbles spaces that are not escaped). \mbox{...} is another alternative to \textrm{...}, since it resets its contents to text mode by default. Here are some examples:

enter image description here

Here is a formula: $x=\exp(\log \mathrm{x})$

Here is another: $\sin^2 t+\cos^2 t = \textrm{famous identity}$

The above font changes do not work that well in general, since switching to a different font when using sub- and superscripts, say, does not always scale as expected. There are ways around it though. For example, using \text{...} from the amstext package (automatically loaded by amsmath - see the AMS package dependencies), which switches to the appropriate font size via \mathchoice:

enter image description here

\usepackage{amsmath}% http://ctan.org/pkg/amsmath
% amsmath loads the amstext package by default
Here is a formula: $x=y^{abc}$

Here it is again: $x=y^{\mbox{abc}}$

Compare that to: $x=y^{\text{abc}}$
  • 2
    Note that when using an environment created by \newtheorem, the default text is emphasized. So if you want non-italicized text in math using \text that appears in a theorem/axiom/etc, you may have to re-emphasize it by surrounding it in \emph. This additional \emph acts to turn off italics in order to "emphasize" text that's sitting in default italics.
    – user29020
    Sep 1, 2015 at 22:24

The results are not always perfect, but mathastext is what you're looking for, when you want to set globally the math font to upright (or to use another completely different font, check the documentation):


Here is a formula: $x=\exp(\log x)$

Here is another: $\sin^2 t+\cos^2 t = 1$

What about Greek? $\alpha+\beta$

enter image description here

Don't tell anybody that I recommended it. :) Indeed I strongly advise not to do evil things like printing all math upright. :)

  • So your advise is typing \mbox{...} before every math line?
    – cebe
    Dec 28, 2011 at 23:37
  • 6
    @cebe No, my advise is to use italics for math as typographers have done for centuries. If you really want to use roman letters for math, then mathastext is the right tool.
    – egreg
    Dec 28, 2011 at 23:41
  • 1
    Reluctantly I'm casting a vote for this answer:-) The mathastext package lets you cheat on proper math typesetting but sometimes it looks nice.
    – user10274
    Dec 28, 2011 at 23:52

Probably not what you are looking for, but you could use the Euler math font which is an upright math font (non-italic).

This is some text in Palatino with an inline equation $f(x)=\cos(x^2)$
followed by an equation:
  \int_{0}^{1}\frac{1}{1 + x^2}\mathrm{d}{x}

Just don't use them with Computer Modern. (My example here uses Palatino for the text font.)

Sample output

  • 2
    So far the only asthetic solution for upright maths :-)
    – Daniel
    Sep 25, 2013 at 10:48

Also if you're writing the same thing over, like units, I just created a new command and used it every time:


This returns "in." without italics, and a space after the number. :)

\frac{19\inch-2.75\inch}{2} + 0.54 \inch = 8.125\inch + 0.54\inch = 8.665\inch


enter image description here


Some packages (MinionPro, mathdesign, fourier, kpfonts) have an option "frenchmath” (the exact name depends on the package), which typesets uppercase roman letters and all greek letters upright, and takes care of the metrics.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .