# Math environment non-italic

I write a textbook and I have completed 40 pages, but I don't like that the texts inside the $..$ are italic. For example

(x-3y) not like

(x-3y) I want

\documentclass{article}

\begin{document}

$(x-3y)$

\end{document}


What can I do to make the texts non-italic? Also, I don't want to change them all one by one.

• It is the maths tradition to have italic letters for variables, at least for lowercase letters (in some countries, the tradition is to have non-italic letters for uppercase and the greek alphabet). Aug 2, 2020 at 17:44
• Sir you are absolutely right, but the book is for children 10-15 years old. When I browse such books, I can't see italic letters. So I wanted to do something like this. Aug 2, 2020 at 17:48
• The main problem is that those books are typeset with less powerful methods. Aug 2, 2020 at 18:29

To globally change all math output to use upright lettering, for both latin and greek alphabet letters, I have the following suggestions:

• If you use pdfLaTeX to compile your document, load the mathastext package with the option LGRgreek.

• If you use either XeLaTeX or LuaLaTeX, load the unicode-math package and specify the option math-style=upright when you run the \setmathfont directive.

\documentclass{article}
\usepackage{iftex}
\ifpdftex
\usepackage[LGRgreek]{mathastext}
\else
\usepackage{unicode-math}
\setmathfont{Latin Modern Math}[math-style=upright]
\fi

\begin{document}
$(x-3y)$ $\alpha\beta\gamma$ $ABC$
\end{document}


Try just this $\rm (x-3y)$, hope it will work

• Thanks it worked, but What else can I do instead of changing all equations one by one? Aug 2, 2020 at 17:49
• Probably it takes more efforts. Read this, please tex.stackexchange.com/questions/4155/… Aug 2, 2020 at 17:55
• \mathrm{...} it is the actual syntax instead of old notation \rm. Aug 2, 2020 at 19:14