9

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)

2 Answers 2

5

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.

3
  • 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, 2013 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, 2013 at 11:54
  • you should load mathastext after amsmath.
    – user4686
    Nov 10, 2015 at 20:38
3

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.

You must log in to answer this question.

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