615

As can be seen in above picture, there are lots of fonts or font styles that can be used in math mode.

What are all the fonts or font styles I can use in math mode, and which packages are required in order to use them?

Let's assume I'm using standard Computer Modern or Latin Modern (lmodern) fonts.

Edit: It'd be great to see examples of what the different styles look like, probably via images.


I'm not interested in a reproduction of the picture, which can be found at What type of font is this?; the picture is for illustration purposes only. Furthermore, this is supposed to become a one-catches-all question for questions like the beforementioned. If I actually were looking for these fonts, I wouldn't just lazily ask here but look e.g. at The Not So Short Introduction to LaTeX2e, tables 3.14 and 6.4 first.)

2
  • see e.g. tug.dk/FontCatalogue
    – daleif
    Commented Jun 1, 2012 at 10:16
  • 4
    @daleif I'm actually not looking for more font families, but for what I called styles within Computer Modern or Latin Modern, e.g. \mathcal.
    – doncherry
    Commented Jun 1, 2012 at 10:23

6 Answers 6

792

In texdoc symbols (the Comprehensive LaTeX Symbol List) you can find Table 348:

Table 213

The footnotes are explained in the document. Table 327 will additionally explain bold math.

Oh and needless to say but if you were asking this question because you need more mathematical symbols, the Comprehensive List is just your document. Greek variants, Hebrew, Tables 139 to 147 are letter-like symbols ... you'll probably never run out of symbols again.

Edit: After reading this answer https://tex.stackexchange.com/a/60018/13450 I feel the need to also point to the mathalfa package that is referenced there, providing even more alternatives than shown above.

Edit 2: This answer seems so popular that I decided to include the mathalfa table as an image as well. This is taken from the mathalfa documentation and some of the fonts are commercial or need to be installed from external sources. See the documentation for more information if you consider using any of these fonts. Warning, very long table ahead (stitched together from a multi-page table).

Edit 3: With this thread being so popular for reasons I don't entirely understand, I feel compelled to say that there is rarely a point in using more styles than regular, bold, italic, script/calligraphic (I wouldn't even mix those) and blackboard bold. What these tables really show are typefaces you can use for these styles, not a huge number of styles (which would be pointless and ugly anyway). If, however, you are just searching for math fonts to go with your main font, the overview you probably actually want before even consulting these tables is the list of math fonts on the LaTeX Font Catalogue.

Complete mathalfa list

15
  • 7
    Although it might've been the least work to put together, I decided to accept this answer because it shows the output directly on here. Nonetheless, I'd advise everybody to read the other answers as well since they contain valuable information!
    – doncherry
    Commented Jun 3, 2012 at 10:12
  • meta.tex.stackexchange.com/a/616/13450 That's somewhat relevant I guess.
    – Christian
    Commented Jun 3, 2012 at 12:55
  • 9
    I can offer an explanation of why this answer is so popular: although it references well known documents, it extracts from them the common cases. The Comprehensive LaTeX Symbol List is, well, comprehensive, so it takes just as much effort to find rarely used symbols as to find commonly used symbols. Your answer fishes out the common cases and is a useful, task-oriented reminder to a majority of users.
    – Reb.Cabin
    Commented Mar 20, 2016 at 17:05
  • 2
    In newest version of the Comprehensive LaTeX Symbol List the first table is in 299 (p. 216).
    – webelo
    Commented Aug 16, 2016 at 19:09
  • 3
    What about \mathsf? Is it missing from the math alphabets table, or am I confused on what constitutes a "math alphabet" Commented Sep 27, 2021 at 4:21
116

LaTeX kernel

The LaTeX kernel defines several math alphabets in fontmath.ltx

\DeclareSymbolFontAlphabet{\mathrm}    {operators}
\DeclareSymbolFontAlphabet{\mathnormal}{letters}
\DeclareSymbolFontAlphabet{\mathcal}   {symbols}
\DeclareMathAlphabet      {\mathbf}{OT1}{cmr}{bx}{n}
\DeclareMathAlphabet      {\mathsf}{OT1}{cmss}{m}{n}
\DeclareMathAlphabet      {\mathit}{OT1}{cmr}{m}{it}
\DeclareMathAlphabet      {\mathtt}{OT1}{cmtt}{m}{n}

This must be completed by the previous declarations

\DeclareSymbolFont{operators}   {OT1}{cmr} {m}{n}
\DeclareSymbolFont{letters}     {OML}{cmm} {m}{it}
\DeclareSymbolFont{symbols}     {OMS}{cmsy}{m}{n}

so that we know precisely to which font correspond each math command:

  1. \mathrm is the normal upright Roman font

  2. \mathnormal is the normal math italic font: $\mathnormal{a}$ and $a$ give the same result

  3. \mathcal is the special calligraphic font for uppercase letters only

  4. \mathbf gives upright Roman boldface letters

  5. \mathsf gives upright sans serif letters

  6. \mathit gives text italic letters: $different\ne\mathit{different}$

  7. \mathtt gives upright letters from the typewriter type font

One should notice that the argument to each of those commands is typeset in math mode, so spaces are ignored and hyphens become minus signs. Using those commands with arguments not consisting only of normal letters can give unexpected (and sometimes bizarre) results.

No package has to be loaded for being able to use those alphabets.

AMSfonts

With the amsfonts package, which is loaded automatically by amssymb one has access also to

  1. \mathfrak for Fraktur (aka Gothic) letters, upper and lower case

  2. \mathbb for "blackboard bold" uppercase letters

RSFS

The package mathrsfs makes available the "Ralph Smith's Formal Script" font as a math alphabet, with the command \mathrsfs, while calrsfs will do the same but also turning \mathcal to choose the RSFS font (only uppercase letters).

Zapf's Euler Script

The package euscript will load a different calligraphic alphabet, Euler Script, designed by Hermann Zapf. Depending on the options, it will provide \mathscr (to go along with the original \mathcal) or change \mathcal to use Zapf's font:

\usepackage{eucal}
\usepackage[mathcal]{eucal}
\usepackage[mathscr]{eucal}

The first two calls are equivalent and \mathcal will use Euler Script; the last call will provide \mathscr for Euler Script and leave \mathcal as is.

In my opinion only one type of calligraphic letters should be used, be it Knuth's, RSFS or Euler Script.

6
  • Concerning your last sentence: do you mean that you do not recommend, for example, using both mathfrak and mathbb in the same document?
    – anderstood
    Commented Dec 29, 2015 at 18:06
  • @anderstood I was referring to calligraphic; Fraktur and blackboard bold are really different alphabets.
    – egreg
    Commented Dec 29, 2015 at 18:08
  • Is this an example of what you do not recommend?
    – anderstood
    Commented Dec 29, 2015 at 18:12
  • @anderstood I'm not sure the choice of fonts is consistent, but that depends on conventions in the particular field, I guess.
    – egreg
    Commented Dec 29, 2015 at 18:15
  • 1
    You write \mathnormal is the normal math italic font, but is that really the case? \mathnormal doesn't use the same numbers as the normal italic font. For example $\mathnormal{a1}$ isn't the same as $a1$. Or maybe that's what you meant by Using those commands with arguments not consisting only of normal letters can give unexpected (and sometimes bizarre) results.?
    – Clément
    Commented Jun 20, 2019 at 2:59
62

I believe your question is of a (deliberately) introductory or basic nature. Apologies if this is not your intention. A preliminary remark: Most of the text snippet you show is actually set in text mode (italics and bold-upright, resp.), and I won't have anything to say about text-mode alphabets.

  • Math italics: In many math texts since (at least?!) the middle or late 18th century (Euler's influence?), variables and letter-like symbols are typeset by convention in a slanted or, rather, italicized style. In TeX's math mode, letters are automatically set in math italics unless one explicitly chooses a different style. A very importance difference between math italics and ordinary italics is that the latter obey kerning and ligature rules that are of no relevance (and are, in fact, undesirable) for math. This is especially noticeable when using letters such as f which have (in italics mode) both ascenders and descenders.

    • In TeX's Computer Modern font family, lowercase greek symbols are also set in slanted mode in math -- I suppose in order to harmonize nicely with any nearby italicized latin letters.

    • When using LaTeX, \mathit{} instructs TeX to typeset the argument in text-mode italics. (In contrast, in Plain TeX the instruction \mit serves to set its argument in math italics.) In the argument of \mathit{}, spaces are ignored. To generate a snippet of text that contains spaces in math mode, use the command \textit{} instead.

  • Math roman: In math mode, again by convention, abbreviations of operators such as sin, cos, tan, ln, and many others, are set in upright or "roman" style to distinguish them from ordinary symbols and letters (which are set in italics, see above). Matth roman and text roman generally look very similar but can differ when ligatures and kerning rules are involved. When in math mode, \mathrm{} instructs TeX to typeset the argument in math roman; as with \mathit, \mathrm ignores spaces. (Use \textrm to generate upright text with spaces.)

  • Bold versions of mathrm and mathit: To further help the visual definition of symbols, it's possible to embolden letters. This is often (but not always!) done for vectors. In the Computer Modern math font world, bold letters generated via \mathbf are available only in upright or "Roman" style; other math font families, though, also offer bold-italics for math.

  • Math sans-serif and Math typewriter: Use of sans-serif fonts in math settings isn't commonly done, but it can be used to set off visually certain entities that have special meanings. In your example, gen, enc, and dec are typeset with \mathsf{}, while Combine and Reveal are typeset with \mathtt.

  • Special math alphabets: In addition to the preceding four math alphabets, there are also special alphabets -- such as "Math Blackboard Bold" (invoked with \mathbb{}, "Math Caligraphic" (invoked with \mathcal{}), and "Math Fraktur" (invoked with mathfrak). They are frequently used for sets (e.g., \mathbb{R} and \mathbb{C} for the sets of real and complex numbers) and other entities the author wants to distinguish visually from the surrounding material. In the basic TeX distributions with the Computer Modern fonts, there are only uppercase letters for the math blackboard-bold, caligraphic, and Fraktur alphabets; however, there are packages that provide lowercase letters for these math alphabets as well.

    • In LaTeX when using the Computer Modern fonts, it's usually necessary to load one or more specialized packages, such as amsfonts, in order to access some of the special math alphabets.
  • Unlike what can be done with text-mode alphabets (to be precise, since the advent of LaTeX2e in 1994 and its "new font selection system"), math-mode alphabets can't be combined, at least not in "basic" LaTeX when using CM fonts. E.g., the commands \mathcal{\mathbb{}} and \mathbf{\mathsf{}} won't work as one might expect (or wish?).

OK, this is admittedly a very basic introduction to math alphabets in TeX.

4
  • 8
    sadly, the meaning of "math italic" is not the same in latex and plain tex. in plain tex, \mit does use the math italic font (texbook, p.164, bottom of page), but latex defines \mathit to use the text italic font (lamport, p.51, example with "different") so that "words" can be included as italic in math expressions. (by default, any latin letters in math mode are italic, so there's no need to specify italic for variables. the situation is muddled for uppercase greek.) i guess lamport chose \mathit to mean it could be used only in math. Commented Jun 1, 2012 at 12:36
  • @barbarabeeton - you're absolutely correct! I'll fix the statement right away.
    – Mico
    Commented Jun 1, 2012 at 12:57
  • another comment on the math italic: as i understand it, the reason lowercase greek is sloped is that that's the only lowercase greek font that was available when math books started to be set in type. (i haven't found a reference yet, but will keep looking.) Commented Jun 1, 2012 at 13:02
  • 2
    yet another comment ... instead of using \mathrm directly for things like "lim", "sin", etc., it's better to use the defined \lim, \sin, etc., which are defined as "operator names" with preset behavior for how to treat limits. and if you need an operator name that isn't already defined, amsmath (via amsopn) provides a mechanism for creating a robust definition, e.g. \DeclareMathOperator{lcd}. Commented Jun 3, 2012 at 13:40
32

With unicode-math

The unicode-math package defines all the following math alphabets:

\mathup Upright serif

\mathbfup Bold upright serif

\mathit Italic serif

\mathbfit Bold italic serif

\mathsfup Upright sans-serif

\mathsfit Italic sans-serif

\mathbfsfup Bold upright sans-serif

\mathbfsfit¹ Bold italic sans-serif

\mathtt Typewriter

\mathbb Blackboard bold

\mathbbit Blackboard bold italic

\mathscr Script

\mathbfscr Bold script²

\mathcal Calligraphic

\mathbfcal Bold calligraphic²

\mathfrak Fraktur

\mathbffrak Bold Fraktur²

It is also possible to \setoperatorfont to change the font of operators such as \sin and \cos.

The package supports uppercase and lowercase, Latin and Greek, and numerals for all the alphabets that Unicode does.

The package declares synonyms for backward-compatibility, such as \mathrm for \mathup. It also defines \mathnormal, whose behavior can be changed with the math-style= package option, and \symliteral, to display symbols exactly as they are typed in.

Each of these also has a corresponding command such as \symup, \symit and so on, and these can be set to a different math alphabet from the corresponding text-mode math alphabet. The \sym variants are intended for strings of individual math symbols, and the \math variants for words to be rendered as text (and for backwards-compatibility).

The range= option of \setmathfont provides a very flexible way to load each of these math alphabets, or subsets of them, or even individual symbols, from any Unicode font.

By default, unicode-math loads both \mathcal and \mathscr as the same alphabet, but you can nevertheless load a different font for both (although it would be unusual to use both \mathcal and \mathscr within the same document). The \mathrm and \symup alphabets are also both set to the text font, but either can be changed: \mathrm is for words such as tan or PROFIT = REVENUE - COSTS, and \symup is for upright mathematical symbols such as 2πi. You can change the \mathrm font with \setmathrm, and the math bold, italic and bold italic fonts by passing said command the BoldFont = option. This will not change fonts such as \symit.

Here is an example where \mathrm and \symup are set to different alpabets. In this document, the text font and therefore \mathrm are a Palatino clone (TeX Gyre Pagella) and the math font is another Palatino clone (Asana Math), while \symup is set to a different font (Neo Euler, a clone of AMS Euler). This sets the Euler equation in ISO style, with the symbols for constants upright and the symbols for variables italic. Notice the contrast between the upright i symbol for the imaginary unit, the letter i in sin, and the italic variable x. This example also doesn’t change the numerals (despite their being part of the upright serif math alphabet), so that $1$ still looks the same as 1.

\documentclass[varwidth, preview]{standalone}

\usepackage{mathtools}
\usepackage[math-style=ISO]{unicode-math}
  
\setmainfont{TeX Gyre Pagella}
\defaultfontfeatures{Scale=MatchLowercase}

\setmathfont{Asana Math}
\setmathfont[range={up/{Latin,latin,Greek,greek}, 
                    bfup/{Latin,latin,Greek,greek}},
             script-features={}, sscript-features={}
            ]{Neo Euler}

\newcommand\upe{\symup{e}}
\newcommand\upi{\symup{i}}

\begin{document}
\begin{align*}
  \upe^{\upi x} &= \cos{x} + \upi \sin{x} \\
  \upe^{\upi \uppi} + 1 &= 0
\end{align*}
\end{document}

Different \mathrm and \symup

The package also supports bold math style and the commands \mathbold, write \mathversion{bold} and \boldsymbol from amsmath, so it would let you call \boldsymbol\mathbb{C}. If you load a Unicode math font that has a bold version, unicode-math will load it for you. As of July 2019, that applies to XITS Math, Libertinus Math and Minion Math. You can also load one manually with a command such as \setmathfont[version=bold]{Minion Math Semibold}.

You do not need any other packages to use any of these alphabets, other than the packages for your OTF fonts.

With NFSS

Any Unicode math font will give you more alphabets than any combination of legacy packages. It isn’t even possible to define that many alphabets in NFSS.

As egreg mentioned, the LaTeX kernel defines \mathrm, \mathnormal, \mathit, \mathbf, \mathsf, \mathtt, and \mathcal.

A large number of packages define more math alphabets, but two are especially convenient for setting up properly-scaled math alphabets with a comprehensive selection of fonts. The isomath package defines the alphabets \mathbfit, \mathsfit, and \mathsfbfit,¹ loads Greek letters for some alphabets that didn’t have them, and allows you to choose between several different fonts. The mathalpha (formerly mathalfa) package allows you to set \mathcal, as well as the new alphabets \mathbb, \mathfrak, \mathscr, \mathbcal, \mathbbb, \mathbfrak and \mathbscr.² You may also use the \bm and \hm commands from the bm package to get bold and heavy math symbols, respectively.

Traditionally, you would get \mathfrak and \mathbb from amsfonts, or the AMS also provided alternatives in the eucal and eufrak packages. The \mathscr command started as an alternative script alphabet for “Lagrangian density, Hamiltonian density, or the measure in the path integral” in physics papers. It became a way to load an alternative script alphabet without overriding \mathcal, and most such alphabets could instead be loaded as \mathcal. For example, euscript or eucal load Euler Script as \mathscr or \mathcal, and mathrsfs or calrsfs load Ralph Smith Formal Script as \mathscr or \mathcal. It would be unusual to use both alphabets in the same document, but if you do need to, I recommend rfsfo as one that’s distinct from \mathcal, appropriate for the original purpose of \mathscr, and not too slanted.

Many font packages also add math alphabets, including lmodern, stix, stix2, newtxmath, newpxmath and ccfonts. These usually use the same names as amsfonts and unicode-math. Table 307 of the Comprehensive LaTeX Symbol List shows math alphabets defined by other legacy packages.

¹ The math bold italic sans-serif command is \mathbfsfit in unicode-math but \mathsfbfit in isomath.

² The \mathbfcal, \mathbffrak, and \mathbfscr alphabets previously had different names in mathalpha, and there is a compatibility option to use their old names. There is no bold double-struck alphabet in unicode-math, although you could define a bold math style and use its \symbb, and no italic blackboard bold in mathalpha.

25

I created a package called shortsym which offers macros for math symbols of different fonts. It utilizes prefixes, for example \BA means a bold A.

It is still work in progress, but I don't think there will be major changes in the future.

Read the documentation for all information (compile shortsym.tex). Here are the available prefixes for the Latin alphabet:

enter image description here

1
  • @user94293 That sort of command works if you leave a space after the macro: \U a. That is also possible, but I feel like the additional spaces would result in more confusing code.
    – osolmaz
    Commented Jan 14, 2017 at 16:28
2

Here is a collection of a lot of fonts that can be used in LaTeX. I myself was searching for this question and hence for the purpose of collection of answers on this topic, I have included it. It is quite useful.

1
  • The usual Stack guildeline is that an answer should be able to work even without html markup. For that, you should at least specify that you're linking to tug.org/FontCatalogue/alphfonts.html, although it would be even better to show how it's used.
    – Teepeemm
    Commented Feb 11, 2023 at 17:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .