TransWikia.com

Non italic font in displaymath

TeX - LaTeX Asked by noItalicInMath on October 2, 2021

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?

2 Answers

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.
begin{equation}label{xx}
begin{split}
a& =b+c-d
 & quad +e-f
 & =g+h
 & =i
end{split}
end{equation}
A more complicated display
begin{equation}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}
&quadcdot[(n-l )-(n_i-l _i)]^{n_i-l _i}cdot
  Bigl[(n-l )^2-sum^p_{j=1}(n_i-l _i)^2Bigr].
end{split}end{equation}

end{document}

The displays were taken from the documentation of amsmath.

enter image description here

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

Answered by egreg on October 2, 2021

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

Presumably you aren't using ? anywhere.

italic to upright

MWE

documentclass{article}
usepackage{amsmath}
usepackage{xcolor}
usepackage{unicode-math}
newcommandmfname{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}}}
}
hfillLeftBurns

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.
begin{equation}label{xx}
begin{split}
a& =b+c-d
 & quad +e-f
 & =g+h
 & =i
end{split}
end{equation}
A more complicated display
begin{equation}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}
&quadcdot[(n-l )-(n_i-l _i)]^{n_i-l _i}cdot
  Bigl[(n-l )^2-sum^p_{j=1}(n_i-l _i)^2Bigr].
end{split}end{equation}


end{document}

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

half of the alphabets

Answered by Cicada on October 2, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP