File indexing completed on 2024-11-24 04:34:44

0001 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
0002 <html>
0003 <!-- This document is an unofficial reference manual for LaTeX, a
0004 document preparation system, version of November 2018.
0005 
0006 This manual was originally translated from LATEX.HLP v1.0a in the
0007 VMS Help Library.  The pre-translation version was written by
0008 George D. Greenwade of Sam Houston State University.  The
0009 LaTeX 2.09 version was written by Stephen Gilmore.  The
0010 LaTeX2e version was adapted from this by Torsten Martinsen.  Karl
0011 Berry made further updates and additions, and gratefully acknowledges
0012 using Hypertext Help with LaTeX, by Sheldon Green, and
0013 LaTeX Command Summary (for LaTeX 2.09) by
0014 L. Botway and C. Biemesderfer (published by the TeX Users
0015 Group as TeXniques number 10), as reference material.  We also
0016 gratefully acknowledge additional material appearing in
0017 latex2e-reference by Martin Herbert Dietze.  (From these references no
0018 text was directly copied.)
0019 
0020 Copyright 2007, 2008, 2009, 2010, 2011, 2012, 2013,
0021 2014, 2015, 2016, 2017, 2018 Karl Berry.
0022 
0023 Copyright 1988, 1994, 2007 Stephen Gilmore.
0024 
0025 Copyright 1994, 1995, 1996 Torsten Martinsen.
0026 
0027 Permission is granted to make and distribute verbatim copies of
0028 this manual provided the copyright notice and this permission notice
0029 are preserved on all copies.
0030 
0031 
0032 Permission is granted to copy and distribute modified versions of this
0033 manual under the conditions for verbatim copying, provided that the entire
0034 resulting derived work is distributed under the terms of a permission
0035 notice identical to this one.
0036 
0037 Permission is granted to copy and distribute translations of this manual
0038 into another language, under the above conditions for modified versions. -->
0039 <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
0040 <head>
0041 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
0042 <title>Low-level font commands (LaTeX2e unofficial reference manual (November 2018))</title>
0043 
0044 <meta name="description" content="Low-level font commands (LaTeX2e unofficial reference manual (November 2018))">
0045 <meta name="keywords" content="Low-level font commands (LaTeX2e unofficial reference manual (November 2018))">
0046 <meta name="resource-type" content="document">
0047 <meta name="distribution" content="global">
0048 <meta name="Generator" content="makeinfo">
0049 <link href="index.html#Top" rel="start" title="Top">
0050 <link href="IndexDocument.html#Index" rel="index" title="Index">
0051 <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
0052 <link href="Fonts.html#Fonts" rel="up" title="Fonts">
0053 <link href="Layout.html#Layout" rel="next" title="Layout">
0054 <link href="Font-sizes.html#Font-sizes" rel="prev" title="Font sizes">
0055 <style type="text/css">
0056 <!--
0057 /* $Id: latex2e.css 690 2018-09-15 15:20:19Z jimhefferon $
0058    Minor css for latexrefman. Public domain.
0059    Originally written by Jim Hefferon and Karl Berry, 2018. */
0060 
0061 /* So you can style for yourself */
0062 @import url("/css/latexreflocal.css");
0063 
0064 
0065 
0066 a.summary-letter {text-decoration: none}
0067 blockquote.indentedblock {margin-right: 0em}
0068 blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
0069 blockquote.smallquotation {font-size: smaller}
0070 div.display {margin-left: 3.2em}
0071 div.example {margin-left: 3.2em}
0072 div.lisp {margin-left: 3.2em}
0073 div.smalldisplay {margin-left: 3.2em}
0074 div.smallexample {margin-left: 3.2em}
0075 div.smalllisp {margin-left: 3.2em}
0076 kbd {font-style: oblique}
0077 pre.display {font-family: inherit}
0078 pre.format {font-family: inherit}
0079 pre.menu-comment {font-family: serif}
0080 pre.menu-preformatted {font-family: serif}
0081 pre.smalldisplay {font-family: inherit; font-size: smaller}
0082 pre.smallexample {font-size: smaller}
0083 pre.smallformat {font-family: inherit; font-size: smaller}
0084 pre.smalllisp {font-size: smaller}
0085 span.nolinebreak {white-space: nowrap}
0086 span.roman {font-family: initial; font-weight: normal}
0087 span.sansserif {font-family: sans-serif; font-weight: normal}
0088 ul.no-bullet {list-style: none}
0089 BODY {
0090   margin-top: 1em;
0091   margin-left: 1em; /* auto results in two-digit <ol> lost off left */
0092   margin-right: 1em;
0093   margin-bottom: 1em;
0094   /* the idea is to use the whole window, unless it is ridiculously
0095      wide, probably with too-small fonts, too.  */
0096   max-width: 64em;
0097 }
0098 
0099 /* Because we want @math{... @code ...} to be upright, not slanted,
0100    and Texinfo won't fix it. */
0101 code {font-style:normal; font-family:monospace; }
0102 
0103 /* We put a link to our own home page at the bottom. */
0104 div.referenceinfo {font-size:small;}
0105 
0106 -->
0107 </style>
0108 
0109 
0110 </head>
0111 
0112 <body lang="en">
0113 <a name="Low_002dlevel-font-commands"></a>
0114 <div class="header">
0115 <p>
0116 Previous: <a href="Font-sizes.html#Font-sizes" accesskey="p" rel="prev">Font sizes</a>, Up: <a href="Fonts.html#Fonts" accesskey="u" rel="up">Fonts</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="IndexDocument.html#Index" title="Index" rel="index">Index</a>]</p>
0117 </div>
0118 <hr>
0119 <a name="Low_002dlevel-font-commands-1"></a>
0120 <h3 class="section">4.4 Low-level font commands</h3>
0121 
0122 <a name="index-low_002dlevel-font-commands"></a>
0123 <a name="index-font-commands_002c-low_002dlevel"></a>
0124 
0125 <p>These commands are primarily intended for writers of macros and
0126 packages.  The commands listed here are only a subset of the available
0127 ones.
0128 </p>
0129 <dl compact="compact">
0130 <dd><a name="low-level-font-commands-fontencoding"></a></dd>
0131 <dt><code>\fontencoding{<var>encoding</var>}</code></dt>
0132 <dd><a name="index-_005cfontencoding"></a>
0133 <p>Select the font encoding, the encoding of the output font. There are a
0134 large number of valid encodings.  The most common are <code>OT1</code>,
0135 Knuth&rsquo;s original encoding for Computer Modern (the default), and
0136 <code>T1</code>, also known as the Cork encoding, which has support for the
0137 accented characters used by the most widespread European languages
0138 (German, French, Italian, Polish and others), which allows TeX to
0139 hyphenate words containing accented letters. For more, see
0140 <a href="https://ctan.org/pkg/encguide">https://ctan.org/pkg/encguide</a>.
0141 </p>
0142 <a name="low-level-font-commands-fontfamily"></a></dd>
0143 <dt><code>\fontfamily{<var>family</var>}</code></dt>
0144 <dd><a name="index-_005cfontfamily"></a>
0145 <a name="index-families_002c-of-fonts"></a>
0146 <a name="index-font-catalogue"></a>
0147 <p>Select the font family.  The web page
0148 <a href="http://www.tug.dk/FontCatalogue/">http://www.tug.dk/FontCatalogue/</a> provides one way to browse
0149 through many of the fonts easily used with LaTeX.  Here are
0150 examples of some common families.
0151 </p>
0152 <table>
0153 <tr><td><code>pag</code></td><td>Avant Garde</td></tr>
0154 <tr><td><code>fvs</code></td><td>Bitstream Vera Sans</td></tr>
0155 <tr><td><code>pbk</code></td><td>Bookman</td></tr>
0156 <tr><td><code>bch</code></td><td>Charter</td></tr>
0157 <tr><td><code>ccr</code></td><td>Computer Concrete</td></tr>
0158 <tr><td><code>cmr</code></td><td>Computer Modern</td></tr>
0159 <tr><td><code>cmss</code></td><td>Computer Modern Sans Serif</td></tr>
0160 <tr><td><code>cmtt</code></td><td>Computer Modern Typewriter</td></tr>
0161 <tr><td><code>pcr</code></td><td>Courier</td></tr>
0162 <tr><td><code>phv</code></td><td>Helvetica</td></tr>
0163 <tr><td><code>fi4</code></td><td>Inconsolata</td></tr>
0164 <tr><td><code>lmr</code></td><td>Latin Modern</td></tr>
0165 <tr><td><code>lmss</code></td><td>Latin Modern Sans</td></tr>
0166 <tr><td><code>lmtt</code></td><td>Latin Modern Typewriter</td></tr>
0167 <tr><td><code>pnc</code></td><td>New Century Schoolbook</td></tr>
0168 <tr><td><code>ppl</code></td><td>Palatino</td></tr>
0169 <tr><td><code>ptm</code></td><td>Times</td></tr>
0170 <tr><td><code>uncl</code></td><td>Uncial</td></tr>
0171 <tr><td><code>put</code></td><td>Utopia</td></tr>
0172 <tr><td><code>pzc</code></td><td>Zapf Chancery</td></tr>
0173 </table>
0174 
0175 
0176 <a name="low-level-font-commands-fontseries"></a></dd>
0177 <dt><code>\fontseries{<var>series</var>}</code></dt>
0178 <dd><a name="index-_005cfontseries"></a>
0179 <a name="index-series_002c-of-fonts"></a>
0180 <p>Select the font series.  A <em>series</em> combines a <em>weight</em> and a
0181 <em>width</em>.  Typically, a font supports only a few of the possible
0182 combinations.  Some common combined series values include:
0183 </p>
0184 <table>
0185 <tr><td><code>m</code></td><td>Medium (normal)</td></tr>
0186 <tr><td><code>b</code></td><td>Bold</td></tr>
0187 <tr><td><code>c</code></td><td>Condensed</td></tr>
0188 <tr><td><code>bc</code></td><td>Bold condensed</td></tr>
0189 <tr><td><code>bx</code></td><td>Bold extended</td></tr>
0190 </table>
0191 
0192 <a name="index-weights_002c-of-fonts"></a>
0193 <p>The possible values for weight, individually, are:
0194 </p>
0195 <table>
0196 <tr><td><code>ul</code></td><td>Ultra light</td></tr>
0197 <tr><td><code>el</code></td><td>Extra light</td></tr>
0198 <tr><td><code>l</code></td><td>Light</td></tr>
0199 <tr><td><code>sl</code></td><td>Semi light</td></tr>
0200 <tr><td><code>m</code></td><td>Medium (normal)</td></tr>
0201 <tr><td><code>sb</code></td><td>Semi bold</td></tr>
0202 <tr><td><code>b</code></td><td>Bold</td></tr>
0203 <tr><td><code>eb</code></td><td>Extra bold</td></tr>
0204 <tr><td><code>ub</code></td><td>Ultra bold</td></tr>
0205 </table>
0206  
0207 <a name="index-widths_002c-of-fonts"></a>
0208 <p>The possible values for width, individually, are (the meaning and
0209 relationship of these terms varies with individual typefaces):
0210 </p>
0211 <table>
0212 <tr><td><code>uc</code></td><td>Ultra condensed</td></tr>
0213 <tr><td><code>ec</code></td><td>Extra condensed</td></tr>
0214 <tr><td><code>c</code></td><td>Condensed</td></tr>
0215 <tr><td><code>sc</code></td><td>Semi condensed</td></tr>
0216 <tr><td><code>m</code></td><td>Medium</td></tr>
0217 <tr><td><code>sx</code></td><td>Semi expanded</td></tr>
0218 <tr><td><code>x</code></td><td>Expanded</td></tr>
0219 <tr><td><code>ex</code></td><td>Extra expanded</td></tr>
0220 <tr><td><code>ux</code></td><td>Ultra expanded</td></tr>
0221 </table>
0222 
0223 <p>When forming the <var>series</var> string from the weight and width, drop the
0224 <code>m</code> that stands for medium weight or medium width, unless both
0225 weight and width are <code>m</code>, in which case use just one
0226 (&lsquo;<samp><code>m</code></samp>&rsquo;).
0227 </p> 
0228 </dd>
0229 <dt><code>\fontshape{<var>shape</var>}</code></dt>
0230 <dd><a name="index-_005cfontshape"></a>
0231 <a name="index-shapes_002c-of-fonts"></a>
0232 <a name="low-level-font-commands-fontshape"></a><p>Select font shape. Valid shapes are:
0233 </p>
0234 <table>
0235 <tr><td><code>n</code></td><td>Upright (normal)</td></tr>
0236 <tr><td><code>it</code></td><td>Italic</td></tr>
0237 <tr><td><code>sl</code></td><td>Slanted (oblique)</td></tr>
0238 <tr><td><code>sc</code></td><td>Small caps</td></tr>
0239 <tr><td><code>ui</code></td><td>Upright italics</td></tr>
0240 <tr><td><code>ol</code></td><td>Outline</td></tr>
0241 </table>
0242 
0243 <p>The two last shapes are not available for most font families, and
0244 small caps are often missing as well.
0245 </p>
0246 <a name="low-level-font-commands-fontsize"></a></dd>
0247 <dt><code>\fontsize{<var>size</var>}{<var>skip</var>}</code></dt>
0248 <dd><a name="index-_005cfontsize"></a>
0249 <a name="index-font-size"></a>
0250 <a name="index-_005cbaselineskip"></a>
0251 <p>Set the font size and the line spacing.  The unit of both parameters
0252 defaults to points (<code>pt</code>).  The line spacing is the nominal
0253 vertical space between lines, baseline to baseline.  It is stored in the
0254 parameter <code>\baselineskip</code>.  The default <code>\baselineskip</code> for
0255 the Computer Modern typeface is 1.2 times the <code>\fontsize</code>.
0256 Changing <code>\baselineskip</code> directly is inadvisable since its value is
0257 reset every time a size change happens; see <code>\baselinestretch</code>, next.
0258 </p>
0259 <a name="low-level-font-commands-baselinestretch"></a></dd>
0260 <dt><code>\baselinestretch</code></dt>
0261 <dd><a name="index-_005cbaselinestretch"></a>
0262 <p>LaTeX multiplies the line spacing by the value of the
0263 <code>\baselinestretch</code> parameter; the default factor is 1.  A change
0264 takes effect when <code>\selectfont</code> (see below) is called.  You can
0265 make a line skip change happen for the entire document, for instance
0266 doubling it, by doing <code>\renewcommand{\baselinestretch}{2.0}</code> in
0267 the preamble.
0268 </p>
0269 <a name="index-package_002c-setspace"></a>
0270 <a name="index-setspace-package"></a>
0271 
0272 <a name="index-double-spacing"></a>
0273 <p>However, the best way to double-space a document is to use the
0274 <samp>setspace</samp> package.  In addition to offering a number of spacing
0275 options, this package keeps the line spacing single-spaced in places
0276 where that is typically desirable, such as footnotes and figure
0277 captions.  See the package documentation.
0278 </p>
0279 <a name="low-level-font-commands-linespread"></a></dd>
0280 <dt><code>\linespread{<var>factor</var>}</code></dt>
0281 <dd><a name="index-_005clinespread"></a>
0282 <p>Equivalent to
0283 <code>\renewcommand{\baselinestretch}{<var>factor</var>}</code>, and
0284 therefore must be followed by <code>\selectfont</code> to have any effect.
0285 Best specified in the preamble, or use the <code>setspace</code> package, as
0286 just described.
0287 </p>
0288 <a name="low-level-font-commands-selectfont"></a></dd>
0289 <dt><code>\selectfont</code></dt>
0290 <dd><a name="index-_005cselectfont"></a>
0291 <p>The effects of the font commands described above do not happen until
0292 <code>\selectfont</code> is called, as in
0293 <code>\fontfamily{<var>familyname</var>}\selectfont</code>.  It is often useful
0294 to put this in a macro:<br>
0295 <code>\newcommand*{\myfont}{\fontfamily{<var>familyname</var>}\selectfont}</code><br>
0296 (see <a href="_005cnewcommand-_0026-_005crenewcommand.html#g_t_005cnewcommand-_0026-_005crenewcommand">\newcommand &amp; \renewcommand</a>).
0297 </p>
0298 <a name="low-level-font-commands-usefont"></a></dd>
0299 <dt><code>\usefont{<var>enc</var>}{<var>family</var>}{<var>series</var>}{<var>shape</var>}</code></dt>
0300 <dd><a name="index-_005cusefont"></a>
0301 <p>The same as invoking <code>\fontencoding</code>, <code>\fontfamily</code>,
0302 <code>\fontseries</code> and <code>\fontshape</code> with the given parameters,
0303 followed by <code>\selectfont</code>.  For example:
0304 </p>
0305 <div class="example">
0306 <pre class="example">\usefont{ot1}{cmr}{m}{n}
0307 </pre></div>
0308 
0309 </dd>
0310 </dl>
0311 
0312 
0313 
0314 
0315 <hr/><div class='referenceinfo'> <a href='https://latexref.xyz/'> <i>Unofficial LaTeX2e reference manual</i></a></div>
0316 </body>
0317 </html>