# Non italic font in displaymath

I would like to render my math in non-italic font.

I tried various combinations of mathastext with no avail and am starting to believe this can't be achieved this way, but looking on TeX-StackExchange that seems to be the proper way.

Is there a simple way of not displaying math in italics, globally?

• Welcome to TeX.SE. Please be more specific as to what you've tried so far. E.g., which options did you set when loading the mathastext package? Please also provide information about the TeX engine (pdfLaTeX? XeLaTeX? LuaLaTeX? something else?), the document class, and any font packages you employ. – Mico Jul 29 '20 at 16:54

I'm not sure what the purpose of this is, except for trying to get really bad typesetting. But here it is.

\documentclass{article}
\usepackage{amsmath}
\usepackage{mathastext}

\begin{document}

This document has upright math $a+b=c$ everywhere. It's so bad
that my eyes bleed.
$$\label{xx} \begin{split} a& =b+c-d\\ & \quad +e-f\\ & =g+h\\ & =i \end{split}$$
A more complicated display
$$\label{e:barwq}\begin{split} H_c&=\frac{1}{2n} \sum^n_{l=0}(-1)^{l}(n-{l})^{p-2} \sum_{l _1+\dots+ l _p=l}\prod^p_{i=1} \binom{n_i}{l _i}\\ &\quad\cdot[(n-l )-(n_i-l _i)]^{n_i-l _i}\cdot \Bigl[(n-l )^2-\sum^p_{j=1}(n_i-l _i)^2\Bigr]. \end{split}$$

\end{document}


The displays were taken from the documentation of amsmath.

I also tried the same with XeLaTeX and LuaLaTeX (adding \usepackage{fontspec}) and the result is the same.

With unicode-maths, use the [range=it->up] option. Compile with xelatex/lualatex.

Presumably you aren't using 𝕽 anywhere.

MWE

\documentclass{article}
\usepackage{amsmath}
\usepackage{xcolor}
\usepackage{unicode-math}
\newcommand\mfname{Asana Math}
\setmainfont[Colour=blue]{\mfname}
\setmathfont{\mfname}
\setmathfont{XITS Math}[Colour=red,range={it->up}]
\usepackage{simpsons}

\begin{document}

Unicode (math mode):
$𝒢^{2} ∈ 𝕽_{θ_{i}}$

Unicode (text mode):

{\huge
𝒢\hspace{2pt}\textsuperscript{\normalsize 2} ∈ 𝕽\textsubscript{\Large{θ}\textsubscript{\textit{i}}}
}
\hfill\Left\Burns

x + \mscrL + \BbbN   + \mfrakH + \mbffrakR \ $\mapsto$ \  $x + \mscrL + \BbbN + \mfrakH + \mbffrakR$
\bigskip

egreg: This document has upright math $a+b=c$ everywhere. It's so bad
that my eyes bleed.
$$\label{xx} \begin{split} a& =b+c-d\\ & \quad +e-f\\ & =g+h\\ & =i \end{split}$$
A more complicated display
$$\label{e:barwq}\begin{split} H_c&=\frac{1}{2n} \sum^n_{l=0}(-1)^{l}(n-{l})^{p-2} \sum_{l _1+\dots+ l _p=l}\prod^p_{i=1} \binom{n_i}{l _i}\\ &\quad\cdot[(n-l )-(n_i-l _i)]^{n_i-l _i}\cdot \Bigl[(n-l )^2-\sum^p_{j=1}(n_i-l _i)^2\Bigr]. \end{split}$$

\end{document}


Plenty of math alphabets in Unicode, all in the one font file. Here are some: