In my latex document I would like to change the default font style (i.e italic) of the math mode to normal shape.

By now I am using \mathrm but is there a way to set the style of a specific math snippet?

Something like this:

\begin{align}[font=\rmfamily]
...
\end(align)

Really strange demand..

Changing math font may help you---font Euler can be loaded by \usepackage{euler}.

\documentclass{article}
\usepackage{euler}
\usepackage{amsmath}
\begin{document}
\[
    E = mc^2.
\]
\end{document}

In addition, \usepackage[LGRgreek]{mathastext} may be what you are looking for, see here:

\documentclass{article}
\usepackage[LGRgreek]{mathastext}
\usepackage{amsmath}
\begin{document}
\[
    E = mc^2.
\]
\end{document}

Or, if you want to use your own font, have a look at the section 3.4 "Declaring math alphabets" of document fntguide (type texdoc fntguide in terminal window).

Indeed, I strongly advise not to do evil things like printing all math upright.. PLUS ONE.

  • Printing math upright? Something that's easy to do with the-program-I-never-mention-the-name-of. ;-) Not reader's friendly at all. – egreg Oct 16 '13 at 11:02
  • Hah, that's really evil, acting like "I'm shy, don't look at me".. lol @egreg – Ch'en Meng Oct 16 '13 at 11:54
  • you should load mathastext after amsmath. – jfbu Nov 10 '15 at 20:38

Simply put these in your preamble:

\everymath\expandafter{\the\everymath\mathgroup0}
\everydisplay\expandafter{\the\everydisplay\mathgroup0}

It doesn't look good though, so I guess you may also want to change font.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.