Text FormattingDeclaring upright e, i, and pi in Computer Modern mathmode

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
User avatar
svend_tveskaeg
Posts: 478
Joined: Sun Jul 12, 2009 5:31 am

Declaring upright e, i, and pi in Computer Modern mathmode

Post by svend_tveskaeg »

Dear (La)TeX friends.

Well, the headline says it all. I got the idea of this from Will Robertson's blog, but I have no idea of what to write when I am not using the upright maths font Euler.

Thanks in advance!
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10334
Joined: Mon Mar 10, 2008 9:44 pm

Declaring upright e, i, and pi in Computer Modern mathmode

Post by Stefan Kottwitz »

Hi,

you could use \mathrm{ei}.
Computer Modern Roman provides an upright italic font shape. Try:

Code: Select all

\fontshape{ui}\selectfont ei
But this does not apply to \pi.

Stefan
LaTeX.org admin
User avatar
svend_tveskaeg
Posts: 478
Joined: Sun Jul 12, 2009 5:31 am

Declaring upright e, i, and pi in Computer Modern mathmode

Post by svend_tveskaeg »

Hi Stefen.

Code: Select all

\fontshape{ui}\selectfont ei
was definitely not was I was looking for; my entire index and my headlines are typeset in upright italic mode. :o

Well, never mind that, if I use \mathrm{e} and \mathrm{i}, respectively, I get what I want.

Is there no way of getting an upright mathmode pi with the Computer Modern font?

Thanks in advance!
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)
User avatar
Stefan Kottwitz
Site Admin
Posts: 10334
Joined: Mon Mar 10, 2008 9:44 pm

Declaring upright e, i, and pi in Computer Modern mathmode

Post by Stefan Kottwitz »

svend_tveskaeg wrote:my entire index and my headlines are typeset in upright italic mode. :o
Just use curly braces to limit the effect:

Code: Select all

{\fontfamily{cmss}\fontshape{ui}\selectfont upright italic} normal shape
\normalfont may also be used.

Stefan
LaTeX.org admin
User avatar
svend_tveskaeg
Posts: 478
Joined: Sun Jul 12, 2009 5:31 am

Declaring upright e, i, and pi in Computer Modern mathmode

Post by svend_tveskaeg »

Thank you very much!

I am wondering if there is a way of getting an upright mathmode pi with the Computer Modern font?

Update: Table 134 in "The Comprehensive LaTeX Symbol List" gave me the answer.
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)
Post Reply