On this page
Low-level font commands
These commands are primarily intended for writers of macros and packages. The commands listed here are only a subset of the available ones.
-
\fontencoding{encoding}¶ -
Select the font encoding, the encoding of the output font. There are a large number of valid encodings. The most common are
OT1, Knuth’s original encoding for Computer Modern (the default), andT1, also known as the Cork encoding, which has support for the accented characters used by the most widespread European languages (German, French, Italian, Polish and others), which allows TeX to hyphenate words containing accented letters. For more, see https://ctan.org/pkg/encguide. -
\fontfamily{family}¶ -
Select the font family. The web page https://tug.org/FontCatalogue/ provides one way to browse through many of the fonts easily used with LaTeX. Here are examples of some common families.
pagAvant Garde fvsBitstream Vera Sans pbkBookman bchCharter ccrComputer Concrete cmrComputer Modern cmssComputer Modern Sans Serif cmttComputer Modern Typewriter pcrCourier phvHelvetica fi4Inconsolata lmrLatin Modern lmssLatin Modern Sans lmttLatin Modern Typewriter pncNew Century Schoolbook pplPalatino ptmTimes unclUncial putUtopia pzcZapf Chancery -
\fontseries{series}¶ -
Select the font series. A series combines a weight and a width. Typically, a font supports only a few of the possible combinations. Some common combined series values include:
mMedium (normal) bBold cCondensed bcBold condensed bxBold extended The possible values for weight, individually, are:
ulUltra light elExtra light lLight slSemi light mMedium (normal) sbSemi bold bBold ebExtra bold ubUltra bold The possible values for width, individually, are (the meaning and relationship of these terms varies with individual typefaces):
ucUltra condensed ecExtra condensed cCondensed scSemi condensed mMedium sxSemi expanded xExpanded exExtra expanded uxUltra expanded When forming the series string from the weight and width, drop the
mthat stands for medium weight or medium width, unless both weight and width arem, in which case use just one (‘m’). -
\fontshape{shape}¶ -
Select font shape. Valid shapes are:
nUpright (normal) itItalic slSlanted (oblique) scSmall caps uiUpright italics olOutline The two last shapes are not available for most font families, and small caps are often missing as well.
-
\fontsize{size}{skip}¶ -
Set the font size and the line spacing. The unit of both parameters defaults to points (
pt). The line spacing is the nominal vertical space between lines, baseline to baseline. It is stored in the parameter\baselineskip. The default\baselineskipfor the Computer Modern typeface is 1.2 times the\fontsize. Changing\baselineskipdirectly is inadvisable since its value is reset every time a size change happens; instead use\baselinestretch. (see\baselineskip&\baselinestretch). -
\linespread{factor}¶ -
Equivalent to
\renewcommand{\baselinestretch}{factor}, and therefore must be followed by\selectfontto have any effect. Best specified in the preamble. See\baselineskip&\baselinestretch, for usingsetspacepackage instead. -
\selectfont¶ -
The effects of the font commands described above do not happen until
\selectfontis called, as in\fontfamily{familyname}\selectfont. It is often useful to put this in a macro:
\newcommand*{\myfont}{\fontfamily{familyname}\selectfont}
(see\newcommand&\renewcommand). -
\usefont{enc}{family}{series}{shape}¶ -
The same as invoking
\fontencoding,\fontfamily,\fontseriesand\fontshapewith the given parameters, followed by\selectfont. For example:\usefont{ot1}{cmr}{m}{n}
© 2007–2018 Karl Berry
Public Domain Software
http://latexref.xyz/Low_002dlevel-font-commands.html