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.

3
  • 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 2 '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. – mathali Aug 2 '20 at 17:48
  • 6
    The main problem is that those books are typeset with less powerful methods. – egreg Aug 2 '20 at 18:29
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}
1

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.