5

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.

midmotor
  • 187
  • 7
    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). – Bernard Aug 02 '20 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. – midmotor Aug 02 '20 at 17:48
  • 6
    The main problem is that those books are typeset with less powerful methods. – egreg Aug 02 '20 at 18:29

2 Answers2

10

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.

enter image description here

\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}

Mico
  • 506,678
1

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

Olga K
  • 981