File indexing completed on 2024-11-24 04:34:43
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>fontenc package (LaTeX2e unofficial reference manual (November 2018))</title> 0043 0044 <meta name="description" content="fontenc package (LaTeX2e unofficial reference manual (November 2018))"> 0045 <meta name="keywords" content="fontenc package (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="_005cDeclareFontEncoding.html#g_t_005cDeclareFontEncoding" rel="next" title="\DeclareFontEncoding"> 0054 <link href="Fonts.html#Fonts" rel="prev" title="Fonts"> 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="fontenc-package"></a> 0114 <div class="header"> 0115 <p> 0116 Next: <a href="Font-styles.html#Font-styles" accesskey="n" rel="next">Font styles</a>, Up: <a href="Fonts.html#Fonts" accesskey="u" rel="up">Fonts</a> [<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="fontenc-package-1"></a> 0120 <h3 class="section">4.1 <samp>fontenc</samp> package</h3> 0121 0122 <a name="index-Font-encoding"></a> 0123 <a name="index-UTF_002d8-1"></a> 0124 <a name="index-T1"></a> 0125 <a name="index-OT1"></a> 0126 <a name="index-fontenc"></a> 0127 0128 <p>Synopsis: 0129 </p> 0130 <div class="example"> 0131 <pre class="example">\usepackage[<var>font_encoding</var>]{fontenc} 0132 </pre></div> 0133 0134 <p>or 0135 </p> 0136 <div class="example"> 0137 <pre class="example">\usepackage[<var>font_encoding1</var>, <var>font_encoding2</var>, ...]{fontenc} 0138 </pre></div> 0139 0140 <p>Specify the font encodings. A font encoding is a mapping of the 0141 character codes to the font glyphs that are used to typeset your output. 0142 </p> 0143 <p>This package only applies if you use the <code>pdflatex</code> engine 0144 (see <a href="TeX-engines.html#TeX-engines">TeX engines</a>). If you use the <code>xelatex</code> or 0145 <code>lualatex</code> engine then instead use the <samp>fontspec</samp> package. 0146 </p> 0147 <p>TeX’s original font family, Computer Modern, has a limited character 0148 set. For instance, to make common accented characters you must use 0149 <code>\accent</code> (see <a href="_005caccent.html#g_t_005caccent">\accent</a>) but this disables hyphenation. TeX 0150 users have agreed on a number of standards to access the larger sets of 0151 characters provided by modern fonts. If you are using 0152 <code>pdflatex</code> then this in the preamble 0153 </p> 0154 <div class="example"> 0155 <pre class="example">\usepackage[T1]{fontenc} 0156 \usepackage[utf8]{inputenc} % Optional: encoding of input file 0157 </pre></div> 0158 0159 <p>gives you support for the most widespread European languages, including 0160 French, German, Italian, Polish, and others. In particular, if you have 0161 words with accented letters then LaTeX will hyphenate them and your 0162 output can be copied and pasted. (The optional second line allows you 0163 to directly enter accented characters into your source file.) 0164 </p> 0165 <a name="index-package_002c-lmodern"></a> 0166 <a name="index-lmodern-package"></a> 0167 <a name="index-package_002c-cm_002dsuper"></a> 0168 <a name="index-cm_002dsuper-package"></a> 0169 0170 <p>If you are using an encoding such as <code>T1</code> and the characters appear 0171 blurry or do not magnify well then your fonts may be bitmapped, 0172 sometimes called raster or Type 3. You want vector fonts. Use a 0173 package such as <samp>lmodern</samp> or <samp>cm-super</samp> to get a font that 0174 extends LaTeX’s default using vector fonts. 0175 </p> 0176 <p>For each <var>font_encoding</var> given as an option but not already 0177 declared, this package loads the encoding definition files, named 0178 <samp><var>font_encoding</var>enc.def</samp>. It also sets <code>\encodingdefault</code> 0179 to be the last encoding in the option list. 0180 </p> 0181 <p>These are the common values for <var>font_encoding</var>. 0182 </p> 0183 <dl compact="compact"> 0184 <dt><code>OT1</code></dt> 0185 <dd><p>The original encoding for TeX. Limited to mostly English characters. 0186 </p> 0187 </dd> 0188 <dt><code>OMS, OML</code></dt> 0189 <dd><p>Math symbols and math letters encoding. 0190 </p> 0191 </dd> 0192 <dt><code>T1</code></dt> 0193 <dd><p>TeX text extended. Sometimes called the Cork encoding for the Users 0194 Group meeting where it was developed. Gives access to most European 0195 accented characters. The most common option for this package. 0196 </p> 0197 </dd> 0198 <dt><code>TS1</code></dt> 0199 <dd><p>Text Companion encoding. 0200 </p></dd> 0201 </dl> 0202 0203 <p>LaTeX’s default is to load <code>OML</code>, <code>T1</code>, <code>OT1</code>, and 0204 then <code>OMS</code>, and set the default to <code>OT1</code>. 0205 </p> 0206 <p>Even if you do not use accented letters, you may need to specify a font 0207 encoding if your font requires it. 0208 </p> 0209 <p>If you use <code>T1</code> encoded fonts other than the default Computer 0210 Modern family then you may need to load the package that selects your 0211 fonts before loading <samp>fontenc</samp>, to prevent the system from loading 0212 any <code>T1</code> encoded fonts from the default. 0213 </p> 0214 <p>The LaTeX team reserve encoding names starting with: ‘<samp>T</samp>’ for the 0215 standard text encodings with 256 characters, ‘<samp>TS</samp>’ for symbols that 0216 extend the corresponding T encodings, ‘<samp>X</samp>’ for test encodings, 0217 ‘<samp>M</samp>’ for standard math encodings with 256 characters, ‘<samp>A</samp>’ for 0218 special applications, ‘<samp>OT</samp>’ for standard text encodings with 128 0219 characters, and ‘<samp>OM</samp>’ for standard math encodings with 128 0220 characters (‘<samp>O</samp>’ stands for ‘<samp>obsolete</samp>’). 0221 </p> 0222 <p>This package provides a number of commands, detailed below. Many of 0223 them are encoding-specific, so if you have defined a command that works 0224 for one encoding but the current encoding is different then the command 0225 is not in effect. 0226 </p> 0227 <table class="menu" border="0" cellspacing="0"> 0228 <tr><td align="left" valign="top">• <a href="_005cDeclareFontEncoding.html#g_t_005cDeclareFontEncoding" accesskey="1">\DeclareFontEncoding</a>:</td><td> </td><td align="left" valign="top">Define an encoding. 0229 </td></tr> 0230 <tr><td align="left" valign="top">• <a href="_005cDeclareTextAccent.html#g_t_005cDeclareTextAccent" accesskey="2">\DeclareTextAccent</a>:</td><td> </td><td align="left" valign="top">Define an accent in the encoding. 0231 </td></tr> 0232 <tr><td align="left" valign="top">• <a href="_005cDeclareTextAccentDefault.html#g_t_005cDeclareTextAccentDefault" accesskey="3">\DeclareTextAccentDefault</a>:</td><td> </td><td align="left" valign="top">Fallback for using an accent in the encoding. 0233 </td></tr> 0234 <tr><td align="left" valign="top">• <a href="_005cDeclareTextCommand-_0026-_005cProvideTextCommand.html#g_t_005cDeclareTextCommand-_0026-_005cProvideTextCommand" accesskey="4">\DeclareTextCommand & \ProvideTextCommand</a>:</td><td> </td><td align="left" valign="top">New encoding-specific command. 0235 </td></tr> 0236 <tr><td align="left" valign="top">• <a href="_005cDeclareTextCommandDefault-_0026-_005cProvideTextCommandDefault.html#g_t_005cDeclareTextCommandDefault-_0026-_005cProvideTextCommandDefault" accesskey="5">\DeclareTextCommandDefault & \ProvideTextCommandDefault</a>:</td><td> </td><td align="left" valign="top">Fallback for encoding-specific commands. 0237 </td></tr> 0238 <tr><td align="left" valign="top">• <a href="_005cDeclareTextComposite.html#g_t_005cDeclareTextComposite" accesskey="6">\DeclareTextComposite</a>:</td><td> </td><td align="left" valign="top">Directly access an accented glyph, in the encoding. 0239 </td></tr> 0240 <tr><td align="left" valign="top">• <a href="_005cDeclareTextCompositeCommand.html#g_t_005cDeclareTextCompositeCommand" accesskey="7">\DeclareTextCompositeCommand</a>:</td><td> </td><td align="left" valign="top">Run code in slot, in the encoding. 0241 </td></tr> 0242 <tr><td align="left" valign="top">• <a href="_005cDeclareTextSymbol.html#g_t_005cDeclareTextSymbol" accesskey="8">\DeclareTextSymbol</a>:</td><td> </td><td align="left" valign="top">Define a symbol in the encoding. 0243 </td></tr> 0244 <tr><td align="left" valign="top">• <a href="_005cDeclareTextSymbolDefault.html#g_t_005cDeclareTextSymbolDefault" accesskey="9">\DeclareTextSymbolDefault</a>:</td><td> </td><td align="left" valign="top">Fallback for a symbol in the encoding. 0245 </td></tr> 0246 <tr><td align="left" valign="top">• <a href="_005cLastDeclaredEncoding.html#g_t_005cLastDeclaredEncoding">\LastDeclaredEncoding</a>:</td><td> </td><td align="left" valign="top">Save most recently declared encoding. 0247 </td></tr> 0248 <tr><td align="left" valign="top">• <a href="_005cUseTextAccent-_0026-_005cUseTextSymbol.html#g_t_005cUseTextAccent-_0026-_005cUseTextSymbol">\UseTextAccent & \UseTextSymbol</a>:</td><td> </td><td align="left" valign="top">Temporarily switch to another encoding. 0249 </td></tr> 0250 </table> 0251 0252 0253 0254 0255 <hr/><div class='referenceinfo'> <a href='https://latexref.xyz/'> <i>Unofficial LaTeX2e reference manual</i></a></div> 0256 </body> 0257 </html>