upright italics (math mode)?

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

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?


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



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


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

$aaa,\ \mathit{aaa},\ \textit{aaa},\ \textui{aaa}$

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

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.:


\newfontface\cmunui{CMU Serif Upright Italic}



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}

\setmathfont{Latin Modern Math}
\setmathfont[range=up/{Latin,latin,Greek,greek}]{CMU Serif Upright Italic}

  \symup{e}^{\symup{i} x} &= \cos{x} + \symup{i} \sin{x} \\
  \symup{e}^{\symup{i \pi}} + 1 &= 0

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.

        \pdfsetmatrix{1 0 #1 1}%


\textit{slanted CM italic}

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

enter image description here

Related questions

Hot questions


Popular Tags