upright italics (math mode)?

Jesse Knight 05/15/2018. 5 answers, 277 views
fonts

Knuth's beautiful CMU font has many variants which are accessible from LaTeX:

  • \textrm,\mathrm - roman (default)
  • \textit,\mathit - italics
  • \textbf,\mathbf - bold
  • \textsc - small caps
  • \textsl - slanted (roman)

However, some additional variants like "upright italics" seem to have no invoking command. Is this true? Are there packages which make them accessible?

Thanks.

5 Answers


David Carlisle 05/15/2018.

CMU isn't Knuth's original Computer Modern font but a newer extended Unicode set using OpenType font format.

LaTeX only provides the simple named macros for the combinations that are most likely used but all of the original Computer Modern collection can be accessed by specifying appropriate font family or shapes, for example:

enter image description here

\documentclass{article}

\begin{document}



{\fontshape{ui}\selectfont abcdefg  upright italic}

{\bfseries  abcdefg bold extended}


{\fontseries{b}\selectfont  abcdefg bold non-extended}

{\fontfamily{cmfib}\selectfont  abcdefg fibonacci}

{\fontfamily{cmdh}\selectfont  abcdefg dunhill}


{\ttfamily  abcdefg non-variable typewriter}

{\fontfamily{cmvtt}\selectfont  abcdefg variable typewriter}


{\fontfamily{cmvtt}\itshape  abcdefg variable typewriter italic}





\end{document}

Mico 05/15/2018.

Are there packages which make [upright italics] accessible?

You could load the cfr-lm package, which provides the \uishape switch and the \textui macro. (ui is short of 'upright italic'.)

enter image description here

\documentclass{article}
\usepackage{cfr-lm}
\begin{document}
$aaa,\ \mathit{aaa},\ \textit{aaa},\ \textui{aaa}$

$fff,\ \mathit{f{}f{}f},\ \textit{f{}f{}f},\ \textui{f{}f{}f}$
\end{document}

Heiko Oberdiek 05/15/2018.

The CTAN/TeX Live/MiKTeX package cm-unicode also contains OpenType fonts that can be used with LuaLaTeX or XeLaTeX, e.g.:

\documentclass{article}
\usepackage{lipsum}
\usepackage{fontspec}

\newfontface\cmunui{CMU Serif Upright Italic}

\begin{document}
  \cmunui
  \lipsum[1]
\end{document}

Result


Davislor 05/16/2018.

Since you asked specifically about using them in math mode, one way to do that in unicode-math is:

\documentclass[varwidth, preview]{standalone}

\usepackage{amsmath}
\usepackage[math-style=ISO]{unicode-math}
\setmathfont{Latin Modern Math}
\setmathfont[range=up/{Latin,latin,Greek,greek}]{CMU Serif Upright Italic}

\begin{document}
\begin{align*}
  \symup{e}^{\symup{i} x} &= \cos{x} + \symup{i} \sin{x} \\
  \symup{e}^{\symup{i \pi}} + 1 &= 0
\end{align*}
\end{document}

Upright Italic sample in ISO style

The above is set in ISO style, with the constants e, i and π set upright, the variable x in italic, the digits 1 and 0 left unchanged (therefore still matching the default text font, so 10 looks the same as $10$) and the operator names cos and sin set in the text font. (The unicode-math package is smart enough to tell the difference between upright math symbols, \symup, and snippets of text such as \operatorname, \text or \mathrm.)

If you instead want to use upright italic letters by default, but still have the usual slanted italic available with \symit{x}, pass the [math-style=upright] option to \usepackage{unicode-math}. If you want to replace the italic rather than the upright math latters, change range=up to range=it.

Also beware that there is no matching CMU bold upright italic font, should you want to use bold upright math letters (e.g. for constant vectors) or bold italic math letters (e.g. for vector variables).

The most famous upright italic math font Donald Knuth was involved with was AMS Euler, by Hermann Zapf. This is available in OpenType as the font Neo Euler.

To use a TrueType or OpenType upright italic font as your text font, use fontspec (see Heiko Oberdiek’s answer). You can also use options on commands such as \setmainfont to replace only the italic style of a font family. You should only use a legacy NFSS toolchain if you’re forced to, for compatibility with an old document or old software.


Steven B. Segletes 05/16/2018.

No reason my approach for Greeks at Upright Greek font fitting to Computer Modern can't be applied directly to italic.

\documentclass[a4paper]{article}
\newsavebox{\foobox}
\newcommand{\slantbox}[2][0]{\mbox{%
        \sbox{\foobox}{#2}%
        \hskip\wd\foobox
        \pdfsave
        \pdfsetmatrix{1 0 #1 1}%
        \llap{\usebox{\foobox}}%
        \pdfrestore
}}
\newcommand\unslant[2][-.25]{\slantbox[#1]{$#2$}}

\begin{document}
$\alpha\beta\gamma\delta\epsilon\eta\mu\phi\sigma\tau\omega\xi\psi\zeta$\par
\unslant\alpha\unslant\beta\unslant\gamma\unslant[-.1]\delta\unslant[-.1]\epsilon%
\unslant\eta\unslant\mu\unslant\phi\unslant\sigma\unslant\tau\unslant\omega%
\unslant[-.15]\xi\unslant\psi\unslant[-.15]\zeta

\textit{slanted CM italic}

\unslant[-.21]{\textit{unslanted CM italic}}
\end{document}

enter image description here


HighResolutionMusic.com - Download Hi-Res Songs

1 Martin Garrix

Yottabyte flac

Martin Garrix. 2018. Writer: Martin Garrix.
2 Alan Walker

Diamond Heart flac

Alan Walker. 2018. Writer: Alan Walker;Sophia Somajo;Mood Melodies;James Njie;Thomas Troelsen;Kristoffer Haugan;Edvard Normann;Anders Froen;Gunnar Greve;Yann Bargain;Victor Verpillat;Fredrik Borch Olsen.
3 Sia

I'm Still Here flac

Sia. 2018. Writer: Sia.
4 Blinders

Breach (Walk Alone) flac

Blinders. 2018. Writer: Dewain Whitmore;Ilsey Juber;Blinders;Martin Garrix.
5 Dyro

Latency flac

Dyro. 2018. Writer: Martin Garrix;Dyro.
6 Cardi B

Taki Taki flac

Cardi B. 2018. Writer: Bava;Juan Vasquez;Vicente Saavedra;Jordan Thorpe;DJ Snake;Ozuna;Cardi B;Selena Gomez.
7 Bradley Cooper

Shallow flac

Bradley Cooper. 2018. Writer: Andrew Wyatt;Anthony Rossomando;Mark Ronson;Lady Gaga.
8 Halsey

Without Me flac

Halsey. 2018. Writer: Halsey;Delacey;Louis Bell;Amy Allen;Justin Timberlake;Timbaland;Scott Storch.
9 Lady Gaga

I'll Never Love Again flac

Lady Gaga. 2018. Writer: Benjamin Rice;Lady Gaga.
10 Kelsea Ballerini

This Feeling flac

Kelsea Ballerini. 2018. Writer: Andrew Taggart;Alex Pall;Emily Warren.
11 Mako

Rise flac

Mako. 2018. Writer: Riot Music Team;Mako;Justin Tranter.
12 Dewain Whitmore

Burn Out flac

Dewain Whitmore. 2018. Writer: Dewain Whitmore;Ilsey Juber;Emilio Behr;Martijn Garritsen.
13 Bradley Cooper

Always Remember Us This Way flac

Bradley Cooper. 2018. Writer: Lady Gaga;Dave Cobb.
14 Little Mix

Woman Like Me flac

Little Mix. 2018. Writer: Nicki Minaj;Steve Mac;Ed Sheeran;Jess Glynne.
15 Charli XCX

1999 flac

Charli XCX. 2018. Writer: Charli XCX;Troye Sivan;Leland;Oscar Holter;Noonie Bao.
16 Rita Ora

Let You Love Me flac

Rita Ora. 2018. Writer: Rita Ora.
17 Diplo

Electricity flac

Diplo. 2018. Writer: Diplo;Mark Ronson;Picard Brothers;Wynter Gordon;Romy Madley Croft;Florence Welch.
18 Jonas Blue

Polaroid flac

Jonas Blue. 2018. Writer: Jonas Blue;Liam Payne;Lennon Stella.
19 Lady Gaga

Look What I Found flac

Lady Gaga. 2018. Writer: DJ White Shadow;Nick Monson;Mark Nilan Jr;Lady Gaga.
20 Avril Lavigne

Head Above Water flac

Avril Lavigne. 2018. Writer: Stephan Moccio;Travis Clark;Avril Lavigne.

Related questions

Hot questions

Language

Popular Tags