1

Everytime I use an equation I want the normal letters to be non-italic in the equation. I've tried \usepackage{mathastext} which makes the equations look funny, the parenthesis becomes small etc. I've tried \usepackage{eulervm} Which rotates the \leq.

The greek letters can stay italic, I've got another trick to make them non-italic. Is there a way only to make the normal text in the equation non-italic?

  • 1
    @Denis I am thinking the OP wants the math symbols upright by default, not merely to add \text to a math environment...but I could be wrong. – Steven B. Segletes May 10 '17 at 12:31
  • Is there a way to do it globally in the preamble? I've got a report her at approx 100 pages which is done. Doing it manually would take too much time. – Abdullah Kaçar May 10 '17 at 12:31
  • You can give a look to this similar question. – campa May 10 '17 at 12:40
2

I don't know if an approach like this would cover all bases?

I tell LaTeX to make math letters using the {cmr}{m}{n} font style. However, this screws up Greek letters, so I have to define a special greeksymbols class that uses {cmm}{m}{it} and then, for each Greek symbol, point it to the greeksymbols font style.

EDITED to take campa's suggestion to add additional symbols to the mix, such as harpoons, \imath (upright style), \wp, and \vec (accent).

The key in adding such symbols is to look at the cm font tables in the TeXbook, (Appendix F), to determine the slot number and font family of the desired glyph. You also need to know the functional category of glyph, such as \mathrel, \mathbin, \mathchar, \mathord, etc. and add all that information into the \DeclareMathSymbol declaration.

EDITED to make the greek letters \mathord category, per egreg's recommendation.

\documentclass{article}
\DeclareSymbolFont{letters}{OT1}{cmr}{m}{n}
\DeclareSymbolFont{greeksymbols}{OML}{cmm}{m}{it}

%GREEKS
\DeclareMathSymbol{\alpha}{\mathord}{greeksymbols}{"0B}
\DeclareMathSymbol{\beta}{\mathord}{greeksymbols}{"0C}
\DeclareMathSymbol{\gamma}{\mathord}{greeksymbols}{"0D}
\DeclareMathSymbol{\delta}{\mathord}{greeksymbols}{"0E}
\DeclareMathSymbol{\epsilon}{\mathord}{greeksymbols}{"0F}
\DeclareMathSymbol{\zeta}{\mathord}{greeksymbols}{"10}
\DeclareMathSymbol{\eta}{\mathord}{greeksymbols}{"11}
\DeclareMathSymbol{\theta}{\mathord}{greeksymbols}{"12}
\DeclareMathSymbol{\iota}{\mathord}{greeksymbols}{"13}
\DeclareMathSymbol{\kappa}{\mathord}{greeksymbols}{"14}
\DeclareMathSymbol{\lambda}{\mathord}{greeksymbols}{"15}
\DeclareMathSymbol{\mu}{\mathord}{greeksymbols}{"16}
\DeclareMathSymbol{\nu}{\mathord}{greeksymbols}{"17}
\DeclareMathSymbol{\xi}{\mathord}{greeksymbols}{"18}
\DeclareMathSymbol{\pi}{\mathord}{greeksymbols}{"19}
\DeclareMathSymbol{\rho}{\mathord}{greeksymbols}{"1A}
\DeclareMathSymbol{\sigma}{\mathord}{greeksymbols}{"1B}
\DeclareMathSymbol{\tau}{\mathord}{greeksymbols}{"1C}
\DeclareMathSymbol{\upsilon}{\mathord}{greeksymbols}{"1D}
\DeclareMathSymbol{\phi}{\mathord}{greeksymbols}{"1E}
\DeclareMathSymbol{\chi}{\mathord}{greeksymbols}{"1F}
\DeclareMathSymbol{\psi}{\mathord}{greeksymbols}{"20}
\DeclareMathSymbol{\omega}{\mathord}{greeksymbols}{"21}
\DeclareMathSymbol{\varepsilon}{\mathord}{greeksymbols}{"22}
\DeclareMathSymbol{\vartheta}{\mathord}{greeksymbols}{"23}
\DeclareMathSymbol{\varpi}{\mathord}{greeksymbols}{"24}
\DeclareMathSymbol{\rho}{\mathord}{greeksymbols}{"25}
\DeclareMathSymbol{\varsigma}{\mathord}{greeksymbols}{"26}
\DeclareMathSymbol{\varphi}{\mathord}{greeksymbols}{"27}
%SYMBOLS
\DeclareMathSymbol{\leftharpoonup}{\mathrel}{greeksymbols}{"28}
\DeclareMathSymbol{\leftharpoondown}{\mathrel}{greeksymbols}{"29}
\DeclareMathSymbol{\rightharpoonup}{\mathrel}{greeksymbols}{"2A}
\DeclareMathSymbol{\rightharpoondown}{\mathrel}{greeksymbols}{"2B}
\DeclareMathSymbol{\wp}{\mathord}{greeksymbols}{"7D}
%OTHERS
\DeclareMathSymbol{\imath}{\mathalpha}{letters}{"10}
\DeclareMathAccent{\vec}{\mathaccent}{greeksymbols}{"7E}
\begin{document}
\[
z = \alpha x + \beta y^2
\]
\[
x \leftharpoonup y \leftharpoondown z \rightharpoonup \imath \rightharpoondown i
\]
\[
A = \wp(\vec B)
\]
\end{document}

enter image description here

  • Thx \DeclareSymbolFont{letters}{OT1}{cmm}{m}{n} \DeclareSymbolFont{greeksymbols}{OML}{cmm}{m}{it} Was just what i was looking for. – Abdullah Kaçar May 10 '17 at 12:43
  • 1
    I agree that this is the way to go, but it's still not perfect: some symbols will still be broken, not only the greek letters, e.g. some harpoons, \imath, \wp, and most importantly the arrow from \vec :-). The list needs a couples of updates :-) – campa May 10 '17 at 12:49
  • 1
    The Greek letters should be \mathord – egreg May 10 '17 at 13:56
  • 1
    @StevenB.Segletes It depends on how you expect it to print in a \mathit context ( or similar). – egreg May 10 '17 at 15:22
  • 1
    \usepackage{sansmath} did the trick (Y) – Abdullah Kaçar May 12 '17 at 8:34
1

Another approach is to use unicode-math with math-style=upright option. This works for LuaLaTeX and XeLaTeX though.

The following code built via lualatex doc.tex or xelatex doc.tex

\documentclass{article}
\usepackage[math-style=upright]{unicode-math}
\begin{document}
\[
z = \alpha x + \beta y^2
\]
\[
x \leftharpoonup y \leftharpoondown z \rightharpoonup \imath \rightharpoondown i
\]
\[
A = \wp(\vec B)
\]
\end{document}

produces the following result

upright fonts with unicode-math

Note that Greek letters become upright as well.

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.