W3cubDocs

/LaTeX

Font styles

The following type style commands are supported by LaTeX.

In the table below the listed commands, the \text... commands, is used with an argument, as in \textit{text}. This is the preferred form. But shown after it, in parenthesis, is the corresponding declaration form, which is often useful. This form takes no arguments, as in {\itshape text}. The scope of the declaration form lasts until the next type style command or the end of the current group. In addition, each has an environment form such as \begin{itshape}...\end{itshape}, which we’ll describe further at the end of the section.

These commands, in any of the three forms, are cumulative; for instance you can get bold sans serif by saying either of \sffamily\bfseries or \bfseries\sffamily.

One advantage of these commands is that they automatically insert italic corrections if needed (see \/). Specifically, they insert the italic correction unless the following character is in the list \nocorrlist, which by default consists of period and comma. To suppress the automatic insertion of italic correction, use \nocorr at the start or end of the command argument, such as \textit{\nocorr text} or \textsc{text \nocorr}.

\textrm (\rmfamily)

Roman.

\textit (\itshape)

Italics.

\textmd (\mdseries)

Medium weight (default).

\textbf (\bfseries)

Boldface.

\textup (\upshape)

Upright (default).

\textsl (\slshape)

Slanted.

\textsf (\sffamily)

Sans serif.

\textsc (\scshape)

Small caps.

\texttt (\ttfamily)

Typewriter.

\textnormal (\normalfont)

Main document font.

Although it also changes fonts, the \emph{text} command is semantic, for text to be emphasized, and should not be used as a substitute for \textit. For example, \emph{start text \emph{middle text} end text} will result in the start text and end text in italics, but middle text will be in roman.

LaTeX also provides the following commands, which unconditionally switch to the given style, that is, are not cumulative. They are used as declarations: {\cmd...} instead of \cmd{...}.

(The unconditional commands below are an older version of font switching. The earlier commands are an improvement in most circumstances. But sometimes an unconditional font switch is what is needed.)

\bf

Switch to bold face.

\cal

Switch to calligraphic letters for math.

\it

Italics.

\rm

Roman.

\sc

Small caps.

\sf

Sans serif.

\sl

Slanted (oblique).

\tt

Typewriter (monospace, fixed-width).

The \em command is the unconditional version of \emph.

The following commands are for use in math mode. They are not cumulative, so \mathbf{\mathit{symbol}} does not create a boldface and italic symbol; instead, it will just be in italics. This is because typically math symbols need consistent typographic treatment, regardless of the surrounding environment.

\mathrm

Roman, for use in math mode.

\mathbf

Boldface, for use in math mode.

\mathsf

Sans serif, for use in math mode.

\mathtt

Typewriter, for use in math mode.

\mathit
(\mit)

Italics, for use in math mode.

\mathnormal

For use in math mode, e.g., inside another type style declaration.

\mathcal

Calligraphic letters, for use in math mode.

In addition, the command \mathversion{bold} can be used for switching to bold letters and symbols in formulas. \mathversion{normal} restores the default.

Finally, the command \oldstylenums{numerals} will typeset so-called “old-style” numerals, which have differing heights and depths (and sometimes widths) from the standard “lining” numerals, which all have the same height as uppercase letters. LaTeX’s default fonts support this, and will respect \textbf (but not other styles; there are no italic old-style numerals in Computer Modern). Many other fonts have old-style numerals also; sometimes package options are provided to make them the default. FAQ entry: https://www.texfaq.org/FAQ-osf.

© 2007–2018 Karl Berry
Public Domain Software
http://latexref.xyz/Font-styles.html