diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /info/beginlatex/html/chapter8.html |
Initial commit
Diffstat (limited to 'info/beginlatex/html/chapter8.html')
-rw-r--r-- | info/beginlatex/html/chapter8.html | 2391 |
1 files changed, 2391 insertions, 0 deletions
diff --git a/info/beginlatex/html/chapter8.html b/info/beginlatex/html/chapter8.html new file mode 100644 index 0000000000..98bfc185ba --- /dev/null +++ b/info/beginlatex/html/chapter8.html @@ -0,0 +1,2391 @@ +<!DOCTYPE html + PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "/dtds/html4t.dtd"> + +<!--Generated from beginlatex.XML.xml with typebook-html.xslt on 2005-04-04T01:02:41--><html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + + <title>Formatting information: Chapter 8 — Fonts and layouts</title> + <link rel="stylesheet" href="typebook.css" type="text/css"> + <meta http-equiv="Content-Style-Type" content="text/css"> + </head> + <body> + <table width="100%"> + <tr> + <th class="title" width="66%"> + <h1><a name="doctitle">Formatting information</a></h1> + <h2>A beginner's introduction to typesetting with + <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span></h2> + <h3>Chapter 8 — Fonts and layouts</h3> + <h3>Peter Flynn</h3> + <h4>Silmaril Consultants<br>Textual Therapy Division + </h4><br>v. 3.6 (March 2005) + </th> + <td class="toc" width="33%"> + <h4><a name="doctoc">Contents</a></h4> + <dl> + <dd class=""><a href="intro.html#intro">Introduction</a></dd> + <dd class=""><a href="foreword.html#foreword">Foreword</a></dd> + <dd class=""><a href="preface.html#preface">Preface</a></dd> + </dl> + <ol> + <li class=""><a href="chapter1.html#get">Installing <span class="TEX">T<span class="E">E</span>X</span> and <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span></a></li> + <li class=""><a href="chapter2.html#plaintext">Using your editor to create documents</a></li> + <li class=""><a href="chapter3.html#basic">Basic document structures</a></li> + <li class=""><a href="chapter4.html#process">Typesetting, viewing and printing</a></li> + <li class=""><a href="chapter5.html#ctan">CTAN, packages, and online help</a></li> + <li class=""><a href="chapter6.html#otherdoc">Other document structures</a></li> + <li class=""><a href="chapter7.html#texttools">Textual tools</a></li> + <li class="current"><a href="chapter8.html#typo">Fonts and layouts</a></li> + <li class=""><a href="chapter9.html#macros">Programmability (macros)</a></li> + <li class=""><a href="chapter10.html#compat">Compatibility with other systems</a></li> + </ol> + <ol type="A"> + <li class=""><a href="appendixA.html#cnf">Configuring <span class="TEX">T<span class="E">E</span>X</span> search paths</a></li> + <li class=""><a href="appendixB.html#tugform"><span class="TEX">T<span class="E">E</span>X</span> Users Group membership</a></li> + <li class=""><a href="appendixC.html#asciicharset">The ASCII character set</a></li> + <li class=""><a href="appendixD.html#gfdl">GNU Free Documentation License</a></li> + </ol> + <dl> + <dd class=""><a href="bibliography.html#biblio">References</a></dd> + <dd class=""><a href="index.html#index">Index</a></dd> + </dl> + </td> + </tr> + <tr> + <td class="credits"> + <p>This edition of <cite>Formatting + Information</cite> was prompted by the generous help I + have received from <span class="TEX">T<span class="E">E</span>X</span> users too numerous to mention + individually. Shortly after TUGboat published the November + 2003 edition, I was reminded by a spate of email of the + fragility of documentation for a system like <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> which is + constantly under development. There have been revisions to + packages; issues of new distributions, new tools, and new + interfaces; new books and other new documents; corrections to + my own errors; suggestions for rewording; and in one or two + cases mild abuse for having omitted package X which the author + felt to be indispensable to users. ¶ I am grateful as always to the people who sent me + corrections and suggestions for improvement. Please keep them + coming: only this way can this book reflect what people + want to learn. The same limitation still applies, however: no + mathematics, as there are already a dozen or more excellent + books on the market — as well as other online + documents — dealing with mathematical typesetting in + <span class="TEX">T<span class="E">E</span>X</span> and <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> in finer and better detail than I am + capable of. ¶ The structure remains the same, but I have revised and + rephrased a lot of material, especially in the earlier + chapters where a new user cannot be expected yet to have + acquired any depth of knowledge. Many of the screenshots have + been updated, and most of the examples and code fragments have + been retested. ¶ As I was finishing this edition, I was asked to review + an article for <cite><a href="http://www.tug.org/pracjourn/" name="C3">The Prac<span class="TEX">T<span class="E">E</span>X</span> Journal</a></cite>, which + grew out of the Practical <span class="TEX">T<span class="E">E</span>X</span> Conference in 2004. The + author specifically took the writers of documentation to task + for failing to explain things more clearly, and as I read + more, I found myself agreeing, and resolving to clear up some + specific problems areas as far as possible. It is very + difficult for people who write technical documentation to + remember how they struggled to learn what has now become a + familiar system. So much of what we do is second nature, and a + lot of it actually has nothing to do with the software, but + more with the way in which we view and approach information, + and the general level of knowledge of computing. If I have + obscured something by making unreasonable assumptions about + <em>your</em> knowledge, please let me know so + that I can correct it. + <p>Peter Flynn is author of <cite><a href="bibliography.html#htmlbook" name="C4">The HTML Handbook</a></cite> and <cite><a href="bibliography.html#sgmltools" name="C5">Understanding SGML and XML Tools</a></cite>, and editor of <cite><a href="http://www.ucc.ie/xml/" name="C6">The XML FAQ</a></cite>. + </p> + </p> + </td> + <td class="legal"> + <p> + <p>This document is Copyright © 1999–2005 by + Silmaril Consultants under the terms of what is now the GNU + Free Documentation License (copyleft). + </p> + <p>Permission is granted to copy, distribute and/or modify + this document under the terms of the GNU Free Documentation + License, Version 1.2 or any later version published by the + Free Software Foundation; with no Invariant Sections, no + Front-Cover Texts, and no Back-Cover Texts. A copy of the + license is included in the section entitled <cite><a href="http://www.fsf.org/copyleft/fdl.html" name="C1">The GNU Free Documentation License</a></cite>. + </p> + <p>You are allowed to distribute, reproduce, and modify it + without fee or further requirement for consent subject to the + conditions in <a href="appendixD.html#gfdl-4">section D.5</a>. The author has + asserted his right to be identified as the author of this + document. If you make useful modifications you are asked to + inform the author so that the master copy can be updated. See + the full text of the License in <a href="appendixD.html#gfdl">Appendix D</a>. + + </p> + </p> + </td> + </tr> + </table> + <div class="chapter"> + <table width="100%"> + <tr> + <td align="center"><small><i class="chaphead"><b><a name="typo">CHAPTER</a></b></i></small><br><table border="1"> + <tr> + <td class="chapno">8</td> + </tr> + </table> + </td> + <td><pre class="spacing"></pre></td> + <td> + <p> </p> + <h1>Fonts and layouts</h1> + </td> + <td class="toc"> + <p> </p> + <ol> + <li><a href="#layouts">Changing layout</a></li> + <li><a href="#fontuse">Using fonts</a></li> + <li><a href="#instfonts">Installing new fonts</a></li> + </ol> + </td> + <td align="right"><a href="#doctoc"><img src="top.png" title="Table of Contents" width="32" alt="ToC" align="right" border="0"></a></td> + </tr> + </table><a name="I126"></a><p>This is the chapter that most users want first, because they + come to structured documents from a wordprocessing environment + where the <em>only</em> way to convey different + types of information is to fiddle with the font and size + drop-down menus. + </p> + <p>As I hope you have seen, this is normally completely + unnecessary in <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span>, which does most of the hard work for you + automatically. However, there are occasions when you need to + make manual typographic changes, and this chapter is about how + to do them. + </p> + <div class="sect1"> + <h2><a href="#typo"><img src="up.png" title="Chapter Contents" width="32" alt="ToC" align="right" border="0"></a>8.1 <a name="layouts">Changing layout</a></h2> + <p>The design of the page can be a very subjective matter, + and also rather a subtle one. Many organisations large and + small pay considerable sums to designers to come up with page + layouts to suit their purposes. Styles in page layouts change + with the years, as do fashions in everything else, so what may + have looked attractive in 1991 may look rather dated in + 2011. + </p> + <p>As with most aspects of typography, making the document + readable involves making it consistent, so the reader is not + interrupted or distracted too much by apparently random + changes in margins, widths, or placement of objects. However, + there are a number of different occasions where the layout + usually <em>does</em> change, related to the + frequency with which the format appears. + </p> + <ul> + <li> + <p>The title page, the half-title, copyright page, + dedication, and other one-page preliminaries (if you use + them) are usually designed individually, as the information + on it only occurs once in that format anywhere in the + document. + </p> + </li> + <li> + <p>The table of contents and other related lists like + figures and tables all need to share one + design. + </p> + </li> + <li> + <p>The prelims like Foreword, Introduction, and Preface + should likewise follow the same format between + them. + </p> + </li> + <li> + <p>Chapter and Appendix start pages usually share a + layout. + </p> + </li> + <li> + <p>Other (normal) pages have a single layout, but it may + specify individual variations to handle tables, lists, + figures, sidebars, exercises, footnotes, etc. + </p> + </li> + </ul> + <p>If you are going to design a whole document, it's + probably a good idea to read a couple of books on layout + design first, to get a feel for the conventions which + contribute to making the reader comfortable reading. + </p> + <p>While unusual or radical layouts have an important role in + attention-grabbing, or in making a socio-political statement + (<cite><a href="bibliography.html#wired" name="C38">WIRED</a></cite> magazine is an obvious + recent example), they are usually out of place in business + reports, white papers, books, theses, and journals. In + ephemera, on the other hand, as in advertising, they are + probably critical. + </p> + <div class="sect2"> + <h3><a href="#doctoc"><img src="up.png" title="Chapter Contents" width="32" alt="ToC" align="right" border="0"></a>8.1.1 <a name="spacing">Spacing</a></h3><a name="I127"></a><a name="I128"></a><p>We mentioned in <a href="chapter7.html#marginals">section 7.3</a> and + elsewhere the existence of the + <span class="package"><a name="m67">geometry</a></span> package which lets you + change margins. It also lets you set the text-area height + and width and a lot of other layout settings: read the + documentation for details (see <a href="chapter5.html#packagedoc">section 5.1.2</a> for how to read package + documentation). + </p> + <blockquote><pre> +\usepackage[left=2cm,top=1cm,bottom=2cm,right=3cm, + nohead,nofoot]{geometry} + </pre></blockquote> + <p>The spacing around the individual textual components + (headings, paragraphs, lists, footnotes, etc.) can + also be changed on a document-wide basis, as we saw with + paragraph spacing and indentation in <a href="chapter3.html#paraspace">the text in section 3.6</a>. + </p> + <p>Changing the spacing of section headings for the whole + document can be done with the + <span class="package"><a name="m68">sectsty</a></span> package, designed to let + you adjust section-head spacing without having to know about + the internal <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> coding, which is quite complex. + </p> + <p>The spacing for lists can be adjusted with the + <span class="package"><a name="m69">mdwlist</a></span> package. In both cases the + user with highly specific requirements such as a + publisher's Compositor's Specification should read + the relevant sections in the <cite><a href="bibliography.html#companion" name="C39">The <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> Companion</a></cite> or ask for expert help, as + there are many internal settings which can also be changed + to fine-tune your design, but which need some knowledge of + <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span>'s internals. + </p> + <p>All the above are for automating changes so that they + occur every time in a consistent manner. You can also make + manual changes whenever you need: + </p> + <blockquote> + <dl> + <dt><b>Flexible vertical space</b></dt> + <dd><a name="I130"></a><p>There are three commands + <code class="command"><a name="c190">\smallskip</a></code>, + <code class="command"><a name="c191">\medskip</a></code>, and + <code class="command"><a name="c192">\bigskip</a></code>. These output flexible + (dynamic, or ‘rubber’) space, + approximately 3pt, 6pt, and 12pt high respectively, + and they will automatically compress or expand a + little, depending on the demands of the rest of the + page (for example to allow one extra line to fit, or a + heading to be moved to the next page without anyone + except a typographer noticing the change). These + commands can only be used after a paragraph break (a + blank line or the command + <code class="command"><a name="c193">\par</a></code>). + </p> + </dd> + <dt><b>Fixed vertical space</b></dt> + <dd><a name="I131"></a><a name="I132"></a><p>For a fixed-height space which will + <em>not</em> stretch or shrink, use the + command <code class="command"><a name="c194">\vspace</a></code> followed by a length + in curly braces, e.g. <code class="literal">\vspace{18pt}</code> + (again, this has to be after a paragraph break). Bear + in mind that extra space which ends up at a page-break + when the document is formatted <em>will get + discarded entirely</em> to make the bottom and + top lines fall in the correct places. To force a + vertical space to remain and be taken into account + even after a page break (very rare), use the starred + variant <code class="command"><a name="c195">\vspace*</a></code>, e.g. + <code class="literal">\vspace*{19pt}</code>. + </p> + </dd> + <dt><b>Double spacing</b></dt> + <dd><a name="I133"></a><a name="I134"></a><p>Double-spacing normal lines of text is usually a + bad idea, as it looks very ugly. It is still + unfortunately a requirement in some universities for + thesis submission, a historical relic from the days of + typewriters. Nowadays, 1⅓ or 1½ line + spacing is considered acceptable, according to your + font size. If your institution still thinks they + should have double line spacing, they are probably + wrong, and just don't understand that the world has + moved on since the typewriter. Show them this + paragraph and explain that they need to enter the 21st + century and adapt to the features of computer + typesetting. If they still insist, use the + <span class="package"><a name="m70">setspace</a></span> package,which has + commands for double line-spacing and one-and-a-half + line spacing, but be prepared for some very ugly + output (so warn your supervisor and extern). + </p> + <p>The space between lines is defined by the value of + the length variable <tt>\<a name="d29">baselineskip</a></tt> multiplied + by the value of the <code class="command"><a name="c196">\baselinestretch</a></code> + command. In general, <em>don't meddle with + <tt>\<a name="d30">baselineskip</a></tt> at + all</em>, and with + <code class="command"><a name="c197">\baselinestretch</a></code> only if you know + what you are doing. (Both can, however, safely be used + as reference values in commands like + <code class="literal">\vspace{\baselineskip}</code> to leave a + whole line space.) + </p> + <p>The value of <tt>\<a name="d31">baselineskip</a></tt> changes with + the font size (see <a href="chapter8.html#fontsize">section 8.2.4</a>) but is conventionally set to + 1.2 times the current nominal font size. This is a + value derived from long experience: only change it if + you understand what it means and what effect it will + have. + </p> + <p>Quite separately, there are some perfectly genuine + and normal reasons for wanting wide line spacing, + for example when typesetting a proof of a + critical or variorum edition, where editors and + contributors are going to want to add notes manually + by writing between the lines, or where the text is + going to be overprinted by something else like + Braille, or in advertising or display text for special + effects. + </p> + </dd> + <dt><b>Horizontal space</b></dt> + <dd><a name="I137"></a><p>There is a horizontal equivalent to the + <code class="command"><a name="c198">\vspace</a></code> command: + <code class="command"><a name="c199">\hspace</a></code>, which works in the same + way, so I can force a 1″ space like + this<img src="whitespace.png" align="middle" height="10px" alt="\hspace*{1in}" width="72">in + mid-paragraph. There are also some predefined + (shorter) spaces available: + </p> + <ul> + <li> + <p><code class="command"><a name="c200">\thinspace</a></code> (1/6em), + which we saw between single and double quotes in + <a href="chapter2.html#thinspace">the last paragraph in section 2.6</a>. It's also + sometimes used between the full point after + abbreviations and a following number, as in page + references like p. 199, where a word space + would look too big, and setting it solid would + look too tight. + </p> + </li> + <li> + <p><code class="command"><a name="c201">\enspace</a></code> (½em). + There is no direct equivalent predefined in + <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> for mid and thick spaces as used by metal + typesetters, although it would be possible to + define them. The en as a unit is often used as the + width of a single digit in some fonts, as a + convenience so that tables of figures are easy to + line up. + </p> + </li> + <li> + <p><code class="command"><a name="c202">\quad</a></code> (1em). + </p> + </li> + <li> + <p><code class="command"><a name="c203">\qquad</a></code> (2em). + </p> + </li> + </ul> + <p>Beyond this, all horizontal space within + paragraphs is automatically flexible, + <a name="I139"></a> as this is what + <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> uses to achieve justification. Never be + tempted to try and change the spacing between letters + unless you have some professional training in + typography. Some systems use letterspacing + (incorrectly called ‘tracking’) as an aid + to justification and it is almost always wrong to do + so (and looks it). While it <em>is</em> + possible to change letterspacing (with the + <span class="package"><a name="m71">soul</a></span> package), it should only + be done by a typographer, and then only very rarely, + as the settings are very subtle and beyond the scope + of this book. + </p> + </dd> + </dl> + </blockquote> + </div> + <div class="sect2"> + <h3><a href="#doctoc"><img src="up.png" title="Chapter Contents" width="32" alt="ToC" align="right" border="0"></a>8.1.2 <a name="runningheads">Headers and footers</a></h3> + <p><span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> has built-in settings to control the page style + of its default page layouts. These are implemented with the + <code class="command"><a name="c204">\pagestyle</a></code> command, which can take one of + the following arguments. + </p> + <blockquote> + <dl> + <dt><b><span class="option"><a name="o15">plain</a></span></b></dt> + <dd> + <p>for a page number centered at the bottom;</p> + </dd> + <dt><b><span class="option"><a name="o16">empty</a></span></b></dt> + <dd> + <p>for nothing at all, not even a page number;</p> + </dd> + <dt><b><span class="option"><a name="o17">headings</a></span></b></dt> + <dd> + <p>for running heads based on the current chapter and + section; + </p> + </dd> + <dt><b><span class="option"><a name="o18">myheadings</a></span></b></dt> + <dd> + <p>which lets you use your own reprogrammed + definitions of how <code class="command"><a name="c205">\markright</a></code> and + <code class="command"><a name="c206">\markboth</a></code> commands, which control + how chapter and section titles get into page + headers. + </p> + </dd> + </dl> + </blockquote> + <p>The command <code class="command"><a name="c207">\thispagestyle</a></code> (taking the + same arguments) can be used to force a specific style for + the current page only. + </p> + <p>However, the easiest way is to use the + <span class="package"><a name="m72">fancyhdr</a></span> package, which lets you + redefine the left-hand, centre, and right-hand page headers + and footers for both odd and even pages (twelve objects in + all). These areas can contain a page number, fixed text, + variable text (like the current chapter or section title, or + the catch-words of a dictionary), or even a small image. + They can also be used to do page backgrounds and frames, by + making one of them the top corner of an invisible box which + ‘hangs’ text or images down over the whole + page. + </p> + <p>The settings for the downloadable version of this + document can be used as an example: for the whole story you + have to read the documentation. + </p> + <blockquote><pre> +\pagestyle{fancy}\fancyhead{} +\renewcommand\headrulewidth{.1pt} +\fancyhead[LO,RE]{\footnotesize\sffamily\lite\leftmark} +\fancyhead[LE,RO]{\footnotesize\sffamily\lite\itshape + \rightmark} +\fancyfoot[C]{} +\fancyfoot[LE,RO]{\setlength{\fboxsep}{2pt}\ovalbox% + {\footnotesize\sffamily\thepage}} +\fancyfoot[LO,RE]{\footnotesize\sffamily\lite\@title} +\fancypagestyle{plain}{\fancyhf{} + \fancyfoot[R]{\setlength{\fboxsep}{2pt}\ovalbox{% + \footnotesize\sffamily\thepage}} + \fancyfoot[L]{\footnotesize\sffamily\lite\@title} + \renewcommand{\headrulewidth}{0pt}} + </pre></blockquote> + <p>This is probably more complex than most documents, but + it illustrates some common requirements: + </p> + <ol type="1"> + <li> + <p>Settings are prefixed by making the + <code class="command"><a name="c208">\pagestyle</a></code> ‘fancy’ + and setting the <code class="command"><a name="c209">\fancyhead</a></code> to + null to zap any predefined values. + </p> + </li> + <li> + <p>The thickness of the rule at the top of the page can + be changed (or set to 0pt to make it disappear). + </p> + </li> + <li> + <p>The header and footer settings are specified with L, + C, and R for left, centre, and right; and with O and E + for Odd and Even numbered pages. In each setting, the + typeface style, size, and font can be specified along + with macros which implement various dynamic texts (here, + the current chapter and section titles, which <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> + stores in <code class="command"><a name="c210">\rightmark</a></code> and + <code class="command"><a name="c211">\leftmark</a></code>). + </p> + </li> + <li> + <p>The ‘plain’ variant is used for chapter + starts, and resets some of the parameters + accordingly. + </p> + </li> + </ol> + </div> + </div> + <div class="sect1"> + <h2><a href="#typo"><img src="up.png" title="Chapter Contents" width="32" alt="ToC" align="right" border="0"></a>8.2 <a name="fontuse">Using fonts</a></h2><a name="I140"></a><p>The default typeface in <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> is <a name="CM" class="acroref">Computer Modern</a> (<small>CM</small>). This typeface was + designed by Knuth for use with <span class="TEX">T<span class="E">E</span>X</span> because it is a book + face, and he designed <span class="TEX">T<span class="E">E</span>X</span> originally for typesetting books. + Because it is one of the very few book typefaces with a + comprehensive set of fonts, including a full suite of + mathematics, it has remained the default, rather than the + Times you find in wordprocessors, because until recently the + mathematical symbols for Times were a commercial product often + unavailable to users of free software. + </p> + <p><a name="I141"></a><a name="I142"></a><span style="font-family:Times; font-size:12ptpt; "><img src="cmr.png" width="100%" class="invisible"></span></p> + <blockquote class="warning"><a name=""></a><p><img src="warning.png" align="left" alt="!!!">If you are reading this in a web browser, the above + paragraph is only a low-resolution copy because browsers + don't usually have the Computer Modern font available. + All the rest of this document is set in your current browser serif font, with + your current browser sans-serif font for some of the headings and your current browser monospace font for the + fixed-width type. + </p> + </blockquote> + <p>In addition to <small><a href="chapter8.html#CM" class="acroref" name="A189" title="Computer Modern">CM</a></small>, there are + many other METAFONT fonts which can be downloaded from + <small><a href="chapter5.html#CTAN" class="acroref" name="A190" title="Comprehensive Archive Network">CTAN</a></small>, including a large collection + of historical, symbol, initial, and non-Latin fonts. <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> + also comes with the ‘Adobe 35’ + typefaces which are built into laser printers and other + <small><a href="preface.html#DTP" class="acroref" name="A191" title="desktop publishing">DTP</a></small> systems, and some more fonts + donated by the X Consortium. Plus, of course, standard + <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> can use any of the thousands of + Type 1 fonts available, and + <i><a name="p195">pdf<span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span></a></i> can use any of the + thousands of TrueType fonts as well. + </p> + <p>In the following lists, if there is a package available, + its name is given in parentheses after the name of the + typeface. The font-family name is shown on the right-hand + side. If a non-standard font-encoding is needed, its name is + shown before the font-family name. + </p><a name="I143"></a><a name="I144"></a><a name="I145"></a><a name="I146"></a><div align="center" class="sampler"><a name="fontable-mf"></a><h3 align="left" class="tablehead">Latin-alphabet typefaces (METAFONT)</h3> + <hr> + <table width="100%"> + <tr> + <th align="left"><small>Computer Modern Roman</small></th> + <td align="right"><small>cmr</small></td> + </tr> + </table><img src="p70-01.png" alt="Sample of cmr" width="100%"><hr> + <table width="100%"> + <tr> + <th align="left"><small>Computer Modern Sans</small></th> + <td align="right"><small>cmss</small></td> + </tr> + </table><img src="p70-02.png" alt="Sample of cmss" width="100%"><hr> + <table width="100%"> + <tr> + <th align="left"><small>Computer Modern Typewriter</small></th> + <td align="right"><small>cmtt</small></td> + </tr> + </table><img src="p70-03.png" alt="Sample of cmtt" width="100%"><hr> + <table width="100%"> + <tr> + <th align="left"><small>Pandora</small></th> + <td align="right"><small>panr</small></td> + </tr> + </table><img src="p70-04.png" alt="Sample of panr" width="100%"><hr> + <table width="100%"> + <tr> + <th align="left"><small>Pandora Sans</small></th> + <td align="right"><small>pss</small></td> + </tr> + </table><img src="p70-05.png" alt="Sample of pss" width="100%"><hr> + <table width="100%"> + <tr> + <th align="left"><small>Pandora Typewriter</small></th> + <td align="right"><small>pntt</small></td> + </tr> + </table><img src="p70-05.png" alt="Sample of pntt" width="100%"><hr> + <table width="100%"> + <tr> + <th align="left"><small>Universal</small></th> + <td align="right"><small>uni</small></td> + </tr> + </table><img src="p70-06.png" alt="Sample of uni" width="100%"><hr> + <table width="100%"> + <tr> + <th align="left"><small>Concrete</small></th> + <td align="right"><small>ccr</small></td> + </tr> + </table><img src="p70-07.png" alt="Sample of ccr" width="100%"><hr> + <table width="100%"> + <tr> + <th align="left"><small>Éıreannach</small></th> + <td align="right"><small>eiad</small></td> + </tr> + </table><img src="p70-10.png" alt="Sample of eiad" width="100%"><hr> + <table width="100%"> + <tr> + <th align="left"><small>Rustic</small></th> + <td align="right"><small>rust</small></td> + </tr> + </table><img src="p70-15.png" alt="Sample of rust" width="100%"><hr> + <table width="100%"> + <tr> + <th align="left"><small>Uncial</small></th> + <td align="right"><small>uncl</small></td> + </tr> + </table><img src="p70-17.png" alt="Sample of uncl" width="100%"><hr> + <table width="100%"> + <tr> + <th align="left"><small>Dürer</small></th> + <td align="right"><small>zdu</small></td> + </tr> + </table><img src="p70-18.png" alt="Sample of zdu" width="100%"><hr> + <table width="100%"> + <tr> + <th align="left"><small>Fraktur</small></th> + <td align="right"><small>yfrak</small></td> + </tr> + </table><img src="p70-19.png" alt="Sample of yfrak" width="100%"><hr> + <table width="100%"> + <tr> + <th align="left"><small>Gothic</small></th> + <td align="right"><small>ygoth</small></td> + </tr> + </table><img src="p70-20.png" alt="Sample of ygoth" width="100%"><hr> + <table width="100%"> + <tr> + <th align="left"><small>Schwäbische</small></th> + <td align="right"><small>yswab</small></td> + </tr> + </table><img src="p70-21.png" alt="Sample of yswab" width="100%"><hr> + </div> + <div align="center" class="sampler"><a name="fontable-adobe"></a><h3 align="left" class="tablehead">Latin-alphabet typefaces (PostScript Type 1) from + Adobe + </h3> + <hr> + <table width="100%"> + <tr> + <th align="left"><small>Avant Garde</small></th> + <td align="right"><small>pag</small></td> + </tr> + </table><img src="p70-26.png" alt="Sample of pag" width="100%"><hr> + <table width="100%"> + <tr> + <th align="left"><small>Bookman</small></th> + <td align="right"><small>pbk</small></td> + </tr> + </table><img src="p70-22.png" alt="Sample of pbk" width="100%">Uses Avant Garde as the sans-serif and Courier for + monospace. + <hr> + <table width="100%"> + <tr> + <th align="left"><small>Courier</small></th> + <td align="right"><small>pcr</small></td> + </tr> + </table><img src="p70-29.png" alt="Sample of pcr" width="100%"><hr> + <table width="100%"> + <tr> + <th align="left"><small>Helvetica</small></th> + <td align="right"><small>phv</small></td> + </tr> + </table><img src="p70-27.png" alt="Sample of phv" width="100%"><hr> + <table width="100%"> + <tr> + <th align="left"><small>New Century Schoolbook</small></th> + <td align="right"><small>pnc</small></td> + </tr> + </table><img src="p70-23.png" alt="Sample of pnc" width="100%">Uses Helvetica as the sans-serif font and Courier + for monospace. + <hr> + <table width="100%"> + <tr> + <th align="left"><small>Palatino</small></th> + <td align="right"><small>ppl</small></td> + </tr> + </table><img src="p70-24.png" alt="Sample of ppl" width="100%">Uses Avant Garde as the sans-serif and Courier for + monospace. + <hr> + <table width="100%"> + <tr> + <th align="left"><small>Symbol</small></th> + <td align="right"><small>psy</small></td> + </tr> + </table><img src="p70-31.png" alt="Sample of psy" width="100%"><hr> + <table width="100%"> + <tr> + <th align="left"><small>Times New Roman</small></th> + <td align="right"><small>ptm</small></td> + </tr> + </table><img src="p70-25.png" alt="Sample of ptm" width="100%">Uses Helvetica as the sans-serif font and Courier + for monospace. Mathematical symbols for Times are + available both free and commercially. + <hr> + <table width="100%"> + <tr> + <th align="left"><small>Zapf Chancery</small></th> + <td align="right"><small>pzc</small></td> + </tr> + </table><img src="p70-28.png" alt="Sample of pzc" width="100%"><hr> + <table width="100%"> + <tr> + <th align="left"><small>Zapf Dingbats</small></th> + <td align="right"><small>pzd</small></td> + </tr> + </table><img src="p70-30.png" alt="Sample of pzd" width="100%"><hr> + </div> + <p>As mentioned in <a href="chapter4.html#print">section 4.4</a>, the + ‘Adobe 35’ fonts can be used with any + printer, not just a laser printer or typesetter. The + <i><a name="p196">Ghostscript</a></i> interpreter and the + <i><a name="p197">GSview</a></i> viewer come with a large set + of printer drivers, so you just create PostScript output and + print from <i><a name="p198">GSview</a></i>. + </p> + <p>Incidentally, the 35 refers to the total number of fonts + for the 10 typefaces, including their bold, italic, and + bold-italic variants. + </p> + <p>Postscript Type 1 fonts have been the mainstay of the + graphic arts industries for many years, as they allow much + better definition of variance + (‘hinting’) than most other formats. + However, the font format remains proprietary to Adobe, even + though they have released it for public use, which means they + could change it without warning. A new format called + ‘OpenType’ is designed to overcome + this, and some versions of <span class="TEX">T<span class="E">E</span>X</span> are + already able to use OpenType fonts. + </p> + <div align="center" class="sampler"><a name="fontable-x"></a><h3 align="left" class="tablehead">Latin-alphabet fonts (PostScript Type 1) from the X + Consortium + </h3> + <hr> + <table width="100%"> + <tr> + <th align="left"><small>Charter</small></th> + <td align="right"><small>bch</small></td> + </tr> + </table><img src="p70-32.png" alt="Sample of bch" width="100%"><hr> + <table width="100%"> + <tr> + <th align="left"><small>Nimbus Roman</small></th> + <td align="right"><small>unm</small></td> + </tr> + </table><img src="p70-33.png" alt="Sample of unm" width="100%"><hr> + <table width="100%"> + <tr> + <th align="left"><small>Nimbus Sans</small></th> + <td align="right"><small>unms</small></td> + </tr> + </table><img src="p70-34.png" alt="Sample of unms" width="100%"><hr> + <table width="100%"> + <tr> + <th align="left"><small>URW Antiqua</small></th> + <td align="right"><small>uaq</small></td> + </tr> + </table><img src="p70-35.png" alt="Sample of uaq" width="100%"><hr> + <table width="100%"> + <tr> + <th align="left"><small>URW Grotesk</small></th> + <td align="right"><small>ugq</small></td> + </tr> + </table><img src="p70-36.png" alt="Sample of ugq" width="100%"><hr> + <table width="100%"> + <tr> + <th align="left"><small>Utopia</small></th> + <td align="right"><small>put</small></td> + </tr> + </table><img src="p70-37.png" alt="Sample of put" width="100%">Removed from recent distributions as it is not + free. + <hr> + </div> + <div align="center" class="sampler"><a name="fontable-nonlat"></a><h3 align="left" class="tablehead">Non-Latin-alphabet typefaces (METAFONT)</h3> + <hr> + <table width="100%"> + <tr> + <th align="left"><small>BB Dingbats</small></th> + <td align="right"><small>ding</small></td> + </tr> + </table><img src="p70-08.png" alt="Sample of ding" width="100%"><hr> + <table width="100%"> + <tr> + <th align="left"><small>Cypriot</small></th> + <td align="right"><small>cypr</small></td> + </tr> + </table><img src="p70-09.png" alt="Sample of cypr" width="100%"><hr> + <table width="100%"> + <tr> + <th align="left"><small>Etruscan</small></th> + <td align="right"><small>etr</small></td> + </tr> + </table><img src="p70-11.png" alt="Sample of etr" width="100%"><hr> + <table width="100%"> + <tr> + <th align="left"><small>Linear `B'</small></th> + <td align="right"><small>linb</small></td> + </tr> + </table><img src="p70-12.png" alt="Sample of linb" width="100%"><hr> + <table width="100%"> + <tr> + <th align="left"><small>Phoenician</small></th> + <td align="right"><small>phnc</small></td> + </tr> + </table><img src="p70-13.png" alt="Sample of phnc" width="100%"><hr> + <table width="100%"> + <tr> + <th align="left"><small>Runic</small></th> + <td align="right"><small>fut</small></td> + </tr> + </table><img src="p70-14.png" alt="Sample of fut" width="100%"><hr> + <table width="100%"> + <tr> + <th align="left"><small>Bard</small></th> + <td align="right"><small>zba</small></td> + </tr> + </table><img src="p70-16.png" alt="Sample of zba" width="100%"><hr> + </div> + <blockquote class="warning"><a name=""></a><p><img src="warning.png" align="left" alt="!!!">Just to make it clear: standard <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> uses only + METAFONT and <a name="t32">PostScript</a> Type 1 + fonts. <i><a name="p199">pdf<span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span></a></i> can use TrueType + fonts as well. + </p> + </blockquote> + <div class="sect2"> + <h3><a href="#doctoc"><img src="up.png" title="Chapter Contents" width="32" alt="ToC" align="right" border="0"></a>8.2.1 Changing the default font family + </h3><a name="I147"></a><p><span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> expects to work with three font families as + defaults: + </p><a name="I148"></a><div align="center"> + <table> + <tr class="headfoot"> + <th valign="bottom" align="left">Font family</th> + <th valign="bottom" align="left">Code</th> + </tr> + <tr> + <td valign="top" align="left">Roman (serif, with tails on the uprights), the + default + </td> + <td valign="top" align="left" style="font-family:monospace;">rm</td> + </tr> + <tr> + <td valign="top" align="left">Sans-serif, with no tails on + the uprights + </td> + <td valign="top" align="left" style="font-family:monospace;">sf</td> + </tr> + <tr> + <td valign="top" align="left">Monospace (fixed-width or + typewriter) + </td> + <td valign="top" align="left" style="font-family:monospace;">tt</td> + </tr> + </table> + </div> + <p>The start-up default for <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> equates the + <code class="literal">rm</code> default with the + <i><a name="v32">cmr</a></i> font-family (Computer Modern Roman), + <code class="literal">sf</code> with <i><a name="v33">cmss</a></i>, and + <code class="literal">tt</code> with <i><a name="v34">cmtt</a></i>. If you + use one of the packages listed in <a href="chapter8.html#fontable-mf">the table in section 8.2</a>, it will + replace the defaults of the same type: for example, + <code class="literal">\usepackage{bookman}</code> makes the default + <code class="literal">rm</code> font-family Bookman + (<i><a name="v35">pbk</a></i>), but leaves the sans-serif + (<code class="literal">sf</code>) and monospace + (<code class="literal">tt</code>) families untouched. Equally, + <code class="literal">\usepackage{helvet}</code> changes the default + sans-serif family to Helvetica but leaves the serif (Roman) + and monospace families untouched. Using both commands will + change both defaults because they operate + independently. + </p> + <p><em>However</em>...as it is common to + want to change all three defaults at the same time, some of + the most common ‘suites’ of typefaces + are provided as packages: + </p> + <blockquote> + <dl> + <dt><b><span class="package"><a name="m73">times</a></span></b></dt> + <dd> + <p>changes to Times/Helvetica/Courier.</p> + </dd> + <dt><b><span class="package"><a name="m74">pslatex</a></span></b></dt> + <dd> + <p>same as <span class="package"><a name="m75">times</a></span> but uses a + specially narrowed Courier to save space (normal + Courier is rather inelegantly wide). This is the + preferred setting if you want Times.<sup><a href="#F43">1</a></sup></p> + </dd> + <dt><b><span class="package"><a name="m78">newcent</a></span></b></dt> + <dd> + <p>changes to New Century + Schoolbook/Helvetica/Courier. + </p> + </dd> + <dt><b><span class="package"><a name="m79">palatino</a></span></b></dt> + <dd> + <p>changes to Palatino/Avant Garde/Courier.</p> + </dd> + <dt><b><span class="package"><a name="m80">palatcm</a></span></b></dt> + <dd> + <p>changes the roman to Palatino only, but with + <small><a href="chapter8.html#CM" class="acroref" name="A192" title="Computer Modern">CM</a></small> mathematics + </p> + </dd> + </dl> + </blockquote> + <p>Where no package name is given in <a href="chapter8.html#fontable-mf">the table in section 8.2</a>, it means the + font is rarely used as a default by itself except in special + cases like users' own homebrew packages. To use such a + font you have to specify it manually, or make a little macro + for yourself if you use it more than once. + </p> + <ol class="footnotes" start="1"> + <li><a name="F43">The <span class="package"><a name="m76">pslatex</a></span> package + is also said to be outdated by some experts + because it implements rather long-windedly what + can now be done in three commands. However, until + these replace the current version, I recommend + continuing to use <span class="package"><a name="m77">pslatex</a></span> + when you want Times with Helvetica and narrow + Courier.</a></li> + </ol> + </div> + <div class="sect2"> + <h3><a href="#doctoc"><img src="up.png" title="Chapter Contents" width="32" alt="ToC" align="right" border="0"></a>8.2.2 <a name="fontfam">Changing the font-family temporarily</a></h3><a name="I149"></a><p>To shift to another font family on a temporary basis, + use the commands <code class="command"><a name="c212">\fontencoding</a></code> (if + needed), <code class="command"><a name="c213">\fontfamily</a></code>, and + <code class="command"><a name="c214">\selectfont</a></code>, and <em>enclose the + commands <span class="normal">and</span> the text in curly + braces</em>. Note that this is a + <em>different</em> way of using curly braces to + how we have used them before: it limits the effect of a + change to the material inside the braces. + </p> + <blockquote class="example"><pre> +{\fontfamily{phv}\selectfont +Helvetica looks like this}: +{\fontencoding{OT1}\fontfamily{bch}\selectfont +Charter looks like this}. + </pre><p class="example"><span style="font-family:Helvetica; ">Helvetica + looks like this</span>: <span style="font-family:; ">Charter looks like + this</span>. + </p> + </blockquote> + <p>In this example, the <code class="command"><a name="c215">\fontencoding</a></code> + command has been used to ensure that the typeface will work + even if the sentence is used in the middle of something + typeset in a different encoding (like this + document).<sup><a href="#F44">2</a></sup></p> + <div align="center" class="sidebar"> + <table width="75%"> + <tr> + <td align="left" class="sidebar"> + <h3><img src="ktip.png" align="middle"> <a name="grouping">Grouping</a></h3><a name="I150"></a><p>Note carefully this use of curly braces to restrict + the scope of a change rather than delimit the argument to + a command. This is called + ‘grouping’ and it makes the effect + any changes made <em>inside</em> the braces + local, so that they do not interfere with the text + following. Any changes to fonts or other values made + within the curly braces cease when the closing curly brace + is processed. + </p> + </td> + </tr> + </table> + </div> + <p>In a normal document, of course, random typeface changes + like this are rather rare. You select your typeface[s] once + at the start of the document, and stick with them. + </p> + <p>Most cases where people want to do unusual typeface + changes involve things like special symbols on a repetitive + basis, and <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> provides much easier programmable ways + to make these changes into shorthand commands (called + macros: see <a href="chapter9.html#macros">Chapter 9</a>). You could, for + example, make a macro called <code class="command"><a name="c216">\product</a></code> + which would let you typeset product names in a distinct + typeface: + </p> + <blockquote><pre> +Andlinger, Inc., has replaced \product{Splosh} with +\product{SuperSplosh}. + </pre></blockquote> + <p>This is one of <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span>'s most powerful features. + It means that if you needed to change your + <code class="command"><a name="c217">\product</a></code> command at some later stage to + use a different font, you only have to change three + characters in the macro (the font-family name), and + you don't need to edit your document text at all! + What's more, a macro could do other things at the same time, + like add an entry to an index of products. + </p> + <p>However, vastly more common are changes to type + <em>style</em>, while staying with the same + font-family. + </p> + <ol class="footnotes" start="2"> + <li><a name="F44">Test for the observant reader: in what typeface will + the colon (:) in the example be set?</a></li> + </ol> + </div> + <div class="sect2"> + <h3><a href="#doctoc"><img src="up.png" title="Chapter Contents" width="32" alt="ToC" align="right" border="0"></a>8.2.3 Changing font style + </h3><a name="I151"></a><p>Within each typeface or font family there are usually + several different ‘looks’ to the type + design. <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> distinguishes between font <b><i><a name="family">family</a></i></b>, font <b><i><a name="shape">shape</a></i></b>, and font <b><i><a name="series">series</a></i></b>: + </p> + <div align="center"> + <table> + <tr class="headfoot"> + <th valign="bottom" align="left">Type style</th> + <th valign="bottom" align="left">Command</th> + <th valign="bottom" align="left">Example (using Computer Modern)</th> + </tr> + <tr> + <td valign="top" align="left">Upright</td> + <td valign="top" align="left" style="font-family:monospace;"><code class="command"><a name="c218">\upshape</a></code>* + </td> + <td valign="top" align="left"><span style="font-family:Times; "><img src="p71-01.png" width="100%" class="invisible"></span></td> + </tr> + <tr> + <td valign="top" align="left">Italic</td> + <td valign="top" align="left" style="font-family:monospace;"><code class="command"><a name="c219">\itshape</a></code></td> + <td valign="top" align="left"><span style="font-family:Times; font-style:italic; "><img src="p71-02.png" width="100%" class="invisible"></span></td> + </tr> + <tr> + <td valign="top" align="left">Slanted</td> + <td valign="top" align="left" style="font-family:monospace;"><code class="command"><a name="c220">\slshape</a></code>* + </td> + <td valign="top" align="left"><span style="font-family:Times; font-style:italic; "><img src="p71-03.png" width="100%" class="invisible"></span></td> + </tr> + <tr> + <td valign="top" align="left">Small Capitals</td> + <td valign="top" align="left" style="font-family:monospace;"><code class="command"><a name="c221">\scshape</a></code>* + </td> + <td valign="top" align="left"><span style="font-family:Times; font-style:smallcaps; "><small>THE QUICK BROWN FOX + JUMPS OVER THE</small></span></td> + </tr> + <tr> + <td valign="top" align="left">Bold</td> + <td valign="top" align="left" style="font-family:monospace;"><code class="command"><a name="c222">\bfseries</a></code>* + </td> + <td valign="top" align="left"><span style="font-family:Times; font-weight:bold; "><img src="p71-05.png" width="100%" class="invisible"></span></td> + </tr> + <tr> + <td valign="top" align="left">Bold Extended</td> + <td valign="top" align="left" style="font-family:monospace;"><code class="command"><a name="c223">\bfseries</a></code>† + </td> + <td valign="top" align="left"><span style="font-family:Times; font-weight:bold; "><img src="p71-06.png" width="100%" class="invisible"></span></td> + </tr> + <tr> + <td valign="top" align="left">Sans-serif</td> + <td valign="top" align="left" style="font-family:monospace;"><code class="command"><a name="c224">\sffamily</a></code></td> + <td valign="top" align="left"><span style="font-family:Helvetica; "><img src="p71-07.png" width="100%" class="invisible"></span></td> + </tr> + <tr> + <td valign="top" align="left">Monospace</td> + <td valign="top" align="left" style="font-family:monospace;"><code class="command"><a name="c225">\ttfamily</a></code></td> + <td valign="top" align="left"><span style="font-family:Courier; "><img src="p71-08.png" width="100%" class="invisible"></span></td> + </tr> + </table> + <div align="left"> + <dl><small> + <dd><i>*</i>) Not all typefaces have all + variants! Some only have bold and italics. + </dd> + <dd><i>†</i>) Some typefaces do not have + both bold and bold extended: by default <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> uses + <code class="command"><a name="c226">\bfseries</a></code> for bold + extended. + </dd></small></dl> + </div> + </div> + <p>These ‘shape’, + ‘series’, and + ‘family’ commands are <b><i><a name="commutative">commutative</a></i></b>, so you can + combine a shape with a series and/or a family, without the + need to use <code class="command"><a name="c227">\selectfont</a></code>: + </p> + <blockquote><pre> +This gives you {\bfseries\itshape\sffamily bold +italic sans-serif type}, but beware + </pre></blockquote> + <p>This gives you <span style="font-family:sans-serif; font-weight:bold; font-style:italic; ">bold italic sans-serif type</span>, but + beware of pushing your fonts beyond their limits unless you + are a typographer. It is not normally meaningful to combine + one shape or series class with another of the same class, + such as trying to get slanted-italics. It's an + impossibility to combine one family with another (such as a + seriffed sans-serif typeface!). Slanted plus italics, for + example, doesn't make sense, as italics are already + slanted (although it is technically possible); and while + some typefaces may well possess italic small caps, they are + not in common use. Sans-serif and monospace (typewriter) are + different fonts, and often different typeface families + entirely.<sup><a href="#F45">3</a></sup></p> + <p>There is an alternative syntax for the most common type + shape and series commands which uses curly braces in the + normal ‘argument’ manner: + </p> + <div align="center"><a name="fontcmds"></a><table> + <tr class="headfoot"> + <th valign="bottom" align="left">Type style</th> + <th valign="bottom" align="left">Command</th> + <th valign="bottom" align="left">Example</th> + </tr> + <tr> + <td valign="top" align="left">Italic</td> + <td valign="top" align="left" style="font-family:monospace;"><code class="literal">\textit{text}</code></td> + <td valign="top" align="left">puts <span style="font-style:italic; ">text</span> + into italics + </td> + </tr> + <tr> + <td valign="top" align="left">Slanted</td> + <td valign="top" align="left" style="font-family:monospace;"><code class="literal">\textsl{text}</code></td> + <td valign="top" align="left">puts <span style="font-family:Times; font-style:italic; ">text</span> into + slanted type* + </td> + </tr> + <tr> + <td valign="top" align="left">Small Capitals</td> + <td valign="top" align="left" style="font-family:monospace;"><code class="literal">\textsc{text}</code></td> + <td valign="top" align="left">puts <span style="font-style:smallcaps; "><small>TEXT</small></span> into + small caps + </td> + </tr> + <tr> + <td valign="top" align="left">Bold</td> + <td valign="top" align="left" style="font-family:monospace;"><code class="literal">\textbf{text}</code></td> + <td valign="top" align="left">puts <span style="font-weight:bold; ">text</span> into + bold type + </td> + </tr> + <tr> + <td valign="top" align="left">Sans-serif</td> + <td valign="top" align="left" style="font-family:monospace;"><code class="literal">\textsf{text}</code></td> + <td valign="top" align="left">puts <span style="font-family:sans-serif; ">text</span> + into sans-serif type + </td> + </tr> + <tr> + <td valign="top" align="left">Monospace</td> + <td valign="top" align="left" style="font-family:monospace;"><code class="literal">\texttt{text}</code></td> + <td valign="top" align="left">puts <span style="font-family:monospace; ">text</span> into + typewriter type + </td> + </tr> + </table> + <div align="left"> + <dl><small> + <dd><i>*</i>) If slanted is available separately + from italics. + </dd></small></dl> + </div> + </div> + <p>You can nest these inside one another too:</p> + <blockquote><pre> +...\textbf{\itshape\textsf{bold italic +sans-serif type}}... + </pre></blockquote> + <p><a name="uline"></a>Underlining isn't a font, and it is extremely + rare in typography except for special purposes. If you think + you need it, use the <span class="package"><a name="m81">ulem</a></span> package + with the <code class="literal">normalem</code> option, and the + <code class="command"><a name="c228">\uline</a></code> command. + </p> + <ol class="footnotes" start="3"> + <li><a name="F45">Although if you're a typographer wanting to + experiment with typewriter typefaces with and without + serifs, you can use METAFONT to do exactly this kind + of thing. But that's way outside the scope of this + document.</a></li> + </ol> + </div> + <div class="sect2"> + <h3><a href="#doctoc"><img src="up.png" title="Chapter Contents" width="32" alt="ToC" align="right" border="0"></a>8.2.4 <a name="fontsize">Font sizes</a></h3><a name="I152"></a><p><span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> has built into its defaults a set of predefined + font size steps corresponding more or less to the + traditional sizes available to metal typesetters. This is + deliberate, as these sizes have grown up over 500 years of + printing as those which go best together for book-work, + which is where <span class="TEX">T<span class="E">E</span>X</span> originated. + </p> + <p>These sizes are also reflected in the size steps at + which Computer Modern was designed. It often comes as a + surprise to new users that many typefaces are not designed + as a single font and just scaled up or down, but specially + drawn at different sizes to make them more legible. + </p> + <p>As an example, <img src="cmr12-12.png" align="middle" alt="here's 12pt Computer Modern" height="12pt">, and <img src="cmr5-12.png" align="middle" height="10px" alt="{\font\cmbig=cmr5 at12pt\cmbig here's 5pt Computer Modern scaled up to 12pt}">, and + <img src="cmr17-12.png" align="middle" height="10px" alt="{\font\cmsmall=cmr17 at12pt\cmsmall here's 17pt Computer Modern scaled down to 12pt}"> so you can see there really is a + significant difference. In general, you probably don't + want to go scaling fonts too much beyond their design size + because they will start to look very odd. + </p> + <p>The default sizes (and the commands that operate them) + are based on the use of a 10pt font, which is the normal + size for most texts. Using the larger defaults (11pt and + 12pt) for the body font will use 11pt and 12pt designs, with + other sizes (eg headings) resized to match. The exact sizes + used are listed in the macros in the Class Option files + <code>size10.clo</code>, + <code>size11.clo</code> and + <code>size12.clo</code>. <span class="TEX">T<span class="E">E</span>X</span>'s default fonts + above 10pt are in fact scaled by a factor of 1.2, as shown + in the fourth column of the table below. + </p> + <div align="center"> + <table> + <tr class="headfoot"> + <th valign="bottom" align="left">Command</th> + <th valign="bottom" align="left">Example</th> + <th valign="bottom" align="left">Nominal point + size + </th> + <th valign="bottom" align="left">Exact point + size + </th> + </tr> + <tr> + <td valign="top" align="left"><code class="command"><a name="c229">\tiny</a></code></td> + <td valign="top" align="left"><span style="font-family:Times; font-size:5pt; ">The quick brown fox + jumps over the lazy dog</span></td> + <td valign="top" align="right">5</td> + <td valign="top" align="right">5</td> + </tr> + <tr> + <td valign="top" align="left"><code class="command"><a name="c230">\scriptsize</a></code></td> + <td valign="top" align="left"><span style="font-family:Times; font-size:7pt; ">The quick brown + fox jumps over the laz</span></td> + <td valign="top" align="right">7</td> + <td valign="top" align="right">7</td> + </tr> + <tr> + <td valign="top" align="left"><code class="command"><a name="c231">\footnotesize</a></code></td> + <td valign="top" align="left"><span style="font-family:Times; font-size:8pt; ">The quick + brown fox jumps over the l</span></td> + <td valign="top" align="right">8</td> + <td valign="top" align="right">8</td> + </tr> + <tr> + <td valign="top" align="left"><code class="command"><a name="c232">\small</a></code></td> + <td valign="top" align="left"><span style="font-family:Times; font-size:9pt; ">The quick brown fox + jumps over th</span></td> + <td valign="top" align="right">9</td> + <td valign="top" align="right">9</td> + </tr> + <tr> + <td valign="top" align="left"><code class="command"><a name="c233">\normalsize</a></code></td> + <td valign="top" align="left"><span style="font-family:Times; font-size:10pt; ">The quick + brown fox jumps over</span></td> + <td valign="top" align="right">10</td> + <td valign="top" align="right">10</td> + </tr> + <tr> + <td valign="top" align="left"><code class="command"><a name="c234">\large</a></code></td> + <td valign="top" align="left"><span style="font-family:Times; font-size:12pt; ">The quick brown fox + jumps</span></td> + <td valign="top" align="right">12</td> + <td valign="top" align="right">12</td> + </tr> + <tr> + <td valign="top" align="left"><code class="command"><a name="c235">\Large</a></code></td> + <td valign="top" align="left"><span style="font-family:Times; font-size:14pt; ">The quick brown fox + ju</span></td> + <td valign="top" align="right">14</td> + <td valign="top" align="right">14.40</td> + </tr> + <tr> + <td valign="top" align="left"><code class="command"><a name="c236">\LARGE</a></code></td> + <td valign="top" align="left"><span style="font-family:Times; font-size:18pt; ">The quick brown + fo</span></td> + <td valign="top" align="right">18</td> + <td valign="top" align="right">17.28</td> + </tr> + <tr> + <td valign="top" align="left"><code class="command"><a name="c237">\huge</a></code></td> + <td valign="top" align="left"><span style="font-family:Times; font-size:20pt; ">The quick + brown</span></td> + <td valign="top" align="right">20</td> + <td valign="top" align="right">20.74</td> + </tr> + <tr> + <td valign="top" align="left"><code class="command"><a name="c238">\Huge</a></code></td> + <td valign="top" align="left"><span style="font-family:Times; font-size:24pt; ">The quick + bro</span></td> + <td valign="top" align="right">24</td> + <td valign="top" align="right">24.88</td> + </tr> + </table> + </div> + <p>While these ‘shorthand’ commands + relieve the beginner of having to worry about the + ‘right’ size for a given task, when + you need a specific size there is the + <code class="command"><a name="c239">\fontsize</a></code> command: + </p> + <blockquote><pre> +\fontsize{22}{28}\selectfont This is 22pt +type 6pt leaded + </pre></blockquote> + <p>‘Leading’ comes from the old metal-type + practice of adding a lead strip between lines to increase the + spacing. + </p> + <p>The <code class="command"><a name="c240">\fontsize</a></code> command takes two + arguments: the point size and the baseline distance. The + above example gives you 22pt type on a 28pt baseline + (i.e. with 6pt extra space or + ‘leading’ between the lines). + </p> + <blockquote class="warning"><a name=""></a><p><img src="warning.png" align="left" alt="!!!">Computer Modern fonts (the default) come fixed at the + named size steps shown in the table, and if you try to use + an odd size in between, <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> will pick the closest + step instead. If you really need to use <small><a href="chapter8.html#CM" class="acroref" name="A193" title="Computer Modern">CM</a></small> at arbitrary sizes there is a + package <span class="package"><a name="m82">type1cm</a></span> which lets you + override the default steps. If you use + <a name="t33">PostScript</a> (Type 1) fonts, the + step sizes do not apply and the font scaling is infinitely + variable. + </p> + </blockquote> + </div> + <div class="sect2"> + <h3><a href="#doctoc"><img src="up.png" title="Chapter Contents" width="32" alt="ToC" align="right" border="0"></a>8.2.5 Logical markup + </h3> + <p>All this playing around with fonts is very pretty but + you normally only do it for a reason, even if that reason is + just to be decorative. Italics, for example, are used for + many things: + </p> + <div align="center"> + <table> + <tr class="headfoot"> + <th valign="bottom" align="left">Cause</th> + <th valign="bottom" align="left">Effect</th> + </tr> + <tr> + <td valign="top" align="left">Foreign words</td> + <td valign="top" align="left" style="font-style:italic;">ex officio</td> + </tr> + <tr> + <td valign="top" align="left">Scientific names</td> + <td valign="top" align="left" style="font-style:italic;">Ranunculus ficaria</td> + </tr> + <tr> + <td valign="top" align="left">Emphasis</td> + <td valign="top" align="left" style="font-style:italic;">must not</td> + </tr> + <tr> + <td valign="top" align="left">Titles of documents</td> + <td valign="top" align="left" style="font-style:italic;">The <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> Companion + </td> + </tr> + <tr> + <td valign="top" align="left">Product names</td> + <td valign="top" align="left" style="font-style:italic;">Corel's WordPerfect</td> + </tr> + <tr> + <td valign="top" align="left">Variables in maths</td> + <td valign="top" align="left" style="font-style:italic;"><span class="math"><i>E=mc</i><sup>2</sup></span></td> + </tr> + <tr> + <td valign="top" align="left">Subtitles or headings</td> + <td valign="top" align="left" style="font-style:italic;">How to get started</td> + </tr> + <tr> + <td valign="top" align="left">Decoration</td> + <td valign="top" align="left" style="font-style:italic;">FREE UPGRADE!!!</td> + </tr> + </table> + </div> + <p>Humans usually have no problem telling the difference + between these reasons, because they can read and understand + the meaning and context. Computers cannot (yet), so it has + become conventional to use descriptive names which make the + distinction explicit, even though the appearance may be the + same. + </p> + <p><span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> has some of these built in, like + <code class="command"><a name="c241">\emph</a></code>, which provides + <em>emphasis</em>. This has a special feature + because <span style="font-style:italic; ">when the surrounding text is + already italic, <span class="normal">emphasis</span> + automatically reverts to <span class="normal">upright + type</span></span>, which is the normal practice + for typesetting. + </p> + <blockquote><pre> +This has a special feature because {\itshape when the +surrounding text is already italic, \emph{emphasis} +automatically reverts to upright type, which is the + </pre></blockquote> + <p><a name="emph"></a>This sensitivity to logic is programmed into + the definition of <code class="command"><a name="c242">\emph</a></code> and it's not + hard to make up other commands of your own which could do + the same, such as <code class="command"><a name="c243">\foreign</a></code> or + <code class="command"><a name="c244">\product</a></code>. + </p> + <p>But why would you bother? In a short document it's + probably not important, but if you're writing a long + report, or a formal document like an article, a book, or a + thesis, it makes writing and editing hugely easier if you + can control whole groups of special effects with a single + command, such as italicising, indexing, or cross-referencing + to a glossary. If a format needs changing, you only have to + change the definition, and every occurrence automatically + follows suit. + </p> + <blockquote class="warning"><a name=""></a><p><img src="warning.png" align="left" alt="!!!">Beware of this ‘vaine conceipt of simple men, + which judge things by ther effects, and not by ther + causes’. (Edmund Spenser, 1633) It's hugely + more efficient to have control of the cause than the + effect. + </p> + </blockquote> + <p>It also makes it possible to find and act on groups of + meanings — such as making an index of scientific names + or product names (as in this document) — if they are + identified with a special command. Otherwise you'd + spend weeks hunting manually through every + <code class="command"><a name="c245">\textit</a></code> command to find the ones you + wanted. This is the importance of automation: it can save + you time and money. + </p> + <p>In <a href="chapter9.html#macros">Chapter 9</a> we will see how to make your + own simple commands like this. + </p> + </div> + <div class="sect2"> + <h3><a href="#doctoc"><img src="up.png" title="Chapter Contents" width="32" alt="ToC" align="right" border="0"></a>8.2.6 Colour + </h3><a name="I153"></a><a name="I154"></a><p>You can typeset anything in <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> in any colour you + want using the <span class="package"><a name="m83">color</a></span> package. + First, you need to add the command + <code class="literal">\usepackage{color}</code> to your preamble (note + the US spelling of color!). This makes available a default + palette of primary colours: <span style="color:red; ">red</span>, <span style="color:green; ">green</span>, and <span style="color:blue; ">blue</span> for the <small><a href="chapter8.html#RGB" class="acroref" name="A194" title="Red-Green-Blue">RGB</a></small> colour model used for emitted light + (television screens), and <span style="color:cyan; ">cyan</span>, <span style="color:magenta; ">magenta</span>, <span style="color:yellow; ">yellow</span>, and black for the + <small><a href="chapter8.html#CMYK" class="acroref" name="A195" title="Cyan-Magenta-Yellow-Black">CMYK</a></small> colour model used for + reflected light (printing). + </p> + <p>For the occasional word or phrase in colour, use the + command <code class="command"><a name="c246">\textcolor</a></code> with two arguments, the + colour name and the text: <code class="literal">\textcolor{red}{like + this}</code>. There is a <code class="command"><a name="c247">\color</a></code> + command as well, for use within groups: + </p> + <blockquote><pre> +...{\color{blue}some text in blue}... + </pre></blockquote> + <p>If you have the <a name="t34">PostScript</a> + printer driver <i><a name="p200">dvips</a></i> installed, + you also get a separate 64-colour palette of predefined + <b><i><a name="colornames">color names</a></i></b>. These + represent approximately the colours in the big box of + <i><a name="p201">Crayola</a></i> colouring pencils much + favoured by artists and designers. This adds a new colour + model called ‘<code class="literal">named</code>’, so if + you want the <i><a name="p202">Crayola</a></i> colour + <span style="color:#FF00DD; ">RubineRed</span>, you can use the + <code class="command"><a name="c248">\color</a></code> or <code class="command"><a name="c249">\textcolor</a></code> + commands with a preceding optional argument + ‘<span class="option"><a name="o19">named</a></span>’: + </p> + <blockquote><pre> +\color[named]{RubineRed} +\textcolor[named]{RubineRed}{some red text} +</pre></blockquote> + <p>As some of the ‘<code class="literal">named</code>’ + colour names are quite long, you can create a short name of + your own for colours you use frequently, using the + <code class="command"><a name="c250">\definecolor</a></code> command: + </p> + <blockquote><pre> +\definecolor{mb}{named}{MidnightBlue} + </pre></blockquote> + <p>The <code class="command"><a name="c251">\definecolor</a></code> command needs three + arguments: your shorthand name, the name of the colour model, + and the colour specification. In the case of the + ‘<code class="literal">named</code>’ model, the last + argument is one of the 64 colour names. To + use these names with <i><a name="p203">pdf<span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span></a></i>, + you need to use the <span class="option"><a name="o20">pdftex</a></span> option to the + <span class="package"><a name="m84">color</a></span> package. + </p> + <p>Using the <code class="command"><a name="c252">\definecolor</a></code> command, you + can define any colour you want by giving it a name, + specifying which colour model, and providing the <a name="RGB" class="acroref">Red-Green-Blue</a> (<small>RGB</small>) or <a name="CMYK" class="acroref">Cyan-Magenta-Yellow-Black</a> (<small>CMYK</small>) colour + values expressed as decimals, separated by commas. For + example, an <small><a href="chapter8.html#RGB" class="acroref" name="A198" title="Red-Green-Blue">RGB</a></small> shade given as + (37,125,224) in decimal (#250FE0 in hexadecimal as used + on the Web) can be given as + <blockquote><pre> +\definecolor{midblue}{rgb}{0.145,0.490,0.882} + </pre></blockquote> (divide each value by 255, the maximum for + each of the hues in the Red-Green-Blue colour model). You + can then use <code class="command"><a name="c253">\textcolor</a></code> with your new + colour name: <span style="color:midblue; ">the midblue looks like + this if you're reading in colour.</span></p> + <p>The <span class="package"><a name="m85">color</a></span> package also provides + a colour version of <code class="command"><a name="c254">\fbox</a></code> (see <a href="chapter6.html#fbox">section 6.7.2</a>) called + <code class="command"><a name="c255">\colorbox</a></code>: + </p> + <blockquote><pre> +\colorbox{midblue}{\color{magenta}Magenta on midblue} + </pre></blockquote> + <p><span style="background-color:#257DE2;color:magenta; ">Magenta on midblue</span>: you can + see how careful you need to be with colours! + </p> + </div> + </div> + <div class="sect1"> + <h2><a href="#typo"><img src="up.png" title="Chapter Contents" width="32" alt="ToC" align="right" border="0"></a>8.3 <a name="instfonts">Installing new fonts</a></h2><a name="I155"></a><p>Different fonts come in a variety of packagings: the three + most common used with <span class="TEX">T<span class="E">E</span>X</span> systems are + <a name="t35">PostScript</a> fonts, TrueType fonts, and + METAFONT fonts. How you install them and where they go + depends on how you installed <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span>: all I can deal with here + are the standard locations within the <small><a href="chapter5.html#TDS" class="acroref" name="A199" title="Directory Structure">TDS</a></small>. + </p> + <p>Typefaces come supplied as one or more font + ‘outline’ files and a number of + ancillary files: + </p> + <blockquote> + <dl> + <dt><b>METAFONT typefaces</b></dt> + <dd> + <p>have a number of <code>.mf</code> source + (outline) files, possibly also some + <code>.fd</code> (font definition) files and a + <code>.sty</code> (style) file. The + <code>.tfm</code> (<span class="TEX">T<span class="E">E</span>X</span> font metric) files are + not needed, as they can be generated from the + outlines. + </p> + </dd> + <dt><b>PostScript typefaces</b></dt> + <dd> + <p>come as a pair of files: a <code>.pfb</code> + (PostScript font binary) or <code>.pfa</code> + (PostScript font <small><a href="chapter2.html#ASCII" class="acroref" name="A200" title="American Standard Code for Information Interchange">ASCII</a></small>) + outline, and an <code>.afm</code> (Adobe font + metric) file. There may also be + <code>.inf</code> and other files but these are + not needed for use with <span class="TEX">T<span class="E">E</span>X</span> systems. + </p> + </dd> + <dt><b>TrueType typefaces</b></dt> + <dd> + <p>are a single <code>.ttf</code> file, which + combines outline and metrics in one. + </p> + </dd> + </dl> + </blockquote> + <p>The instructions here assume the use of the <a name="NFSS" class="acroref">New Font Selection Scheme</a> (<small>NFSS</small>) used in + <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span>ε</span>. If you are running the obsolete <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> 2.09, + upgrade it now. + </p> + <div class="sect2"> + <h3><a href="#doctoc"><img src="up.png" title="Chapter Contents" width="32" alt="ToC" align="right" border="0"></a>8.3.1 <a name="mffonts">Installing METAFONT fonts</a></h3> + <p>This is the simplest installation. When you download + METAFONT fonts from <small><a href="chapter5.html#CTAN" class="acroref" name="A202" title="Comprehensive Archive Network">CTAN</a></small>, + you'll usually find a large number of outline files + (<code>.mf</code> files) and maybe some other types + as well (see below). + </p> + <div class="figure" align="center"> + <hr> + <caption><i>Figure 8.1</i>: <a name="mkfontdir">Creating a new subdirectory for a font</a></caption> + <div align="center" style="margin:12px"><img src="public.png" width="75%"></div> + <hr> + </div> + <ol> + <li> + <p>Create a new subdirectory named after the typeface + you're installing in + <code>texmf-local/fonts/source/public/</code>: + </p> + </li> + <li> + <p>Copy all the <code>.mf</code> + files to this directory. + </p> + </li> + <li> + <p>Copy the <code>.fd</code> (Font Definition) + file[s] and the <code>.sty</code> (style) file + to your <code>texmf/tex/latex/mfnfss</code> + directory. + </p> + </li> + <li> + <p>Run your <span class="TEX">T<span class="E">E</span>X</span> indexer program (see <a href="chapter5.html#texindex">step 4 in the procedure in section 5.2.2</a>). + </p> + </li> + </ol> + <p>That's it. Unlike <a name="t36">PostScript</a> + fonts, METAFONT fonts can be used to generate the font + metric file (<code>.tfm</code> files) automatically + on-the-fly the first time the typeface is used, so there + should be nothing else to install. + </p> + <p>Now you can put a <code class="command"><a name="c256">\usepackage</a></code> command + in your preamble with whatever name the + <code class="literal">.sty</code> file was called, and read the + documentation to see what commands it gives to use the font + (refer to <a href="chapter5.html#packinst">the last paragraph in section 5.2.1</a> and <a href="chapter5.html#dtxdoc">step 2</a>). + </p> + <p>If the font came <em>without</em><code>.fd</code> or <code>.sty</code> files, + you'll need to find someone who can make them for you + (or follow the outline in <a href="chapter8.html#psfonts">section 8.3.2</a>, <a href="chapter8.html#fdfiles">step 11</a>). + </p> + <div class="sect3"> + <h4><a href="#doctoc"><img src="up.png" title="Chapter Contents" width="32" alt="ToC" align="right" border="0"></a>8.3.1.1 Pre-generated metrics (optional) + </h4> + <p>Some METAFONT fonts come with pre-generated + <code>.tfm</code> files which you can install if + your system is slow at generating them itself: + </p> + <ol> + <li> + <p>Create a new subdirectory within + <code>texmf-local/fonts/tfm/public/</code> + named the same as the one you created for the + <code>.mf</code> files above. + </p> + </li> + <li> + <p>Copy all the <code>.tfm</code> files into + this subdirectory. + </p> + </li> + <li> + <p>Run your <span class="TEX">T<span class="E">E</span>X</span> indexer program (see <a href="chapter5.html#texindex">step 4 in the procedure in section 5.2.2</a>). + </p> + </li> + </ol> + </div> + <div class="sect3"> + <h4><a href="#doctoc"><img src="up.png" title="Chapter Contents" width="32" alt="ToC" align="right" border="0"></a>8.3.1.2 Pre-generated bitmaps (optional) + </h4> + <p>In some rare cases, pre-generated packed bitmap fonts + (<code>.pk</code> files) are also available from + <small><a href="chapter5.html#CTAN" class="acroref" name="A203" title="Comprehensive Archive Network">CTAN</a></small> (normally your previewer + and print driver creates these automatically, but you can + use the pre-generated ones if you have a very slow + system). If you really want to install these, it's a + similar procedure to the <code>.tfm</code> + files: + </p> + <ol> + <li> + <p>Create a new subdirectory within + <code>texmf-local/fonts/pk/modeless/</code> + named the same as the one you created for the + <code>.mf</code> and <code>.tfm</code> + files above. + </p> + </li> + <li> + <p>Copy all the <code>.nnnpk</code> files + into this subdirectory (<i>nnn</i> is + a number reflecting the dot-density of the bitmap). On + Microsoft systems the files may just end in + <code>.pk</code> and be kept in subdirectories + named after the dot-density, e.g. + <code>dpi360</code>. + </p> + </li> + <li> + <p>Run your <span class="TEX">T<span class="E">E</span>X</span> indexer program (see <a href="chapter5.html#texindex">step 4 in the procedure in section 5.2.2</a>). + </p> + </li> + </ol> + </div> + </div> + <div class="sect2"> + <h3><a href="#doctoc"><img src="up.png" title="Chapter Contents" width="32" alt="ToC" align="right" border="0"></a>8.3.2 <a name="psfonts">Installing PostScript fonts</a></h3><a name="I156"></a><p>Lots of people will tell you that + <a name="t37">PostScript</a> fonts and PostScript + output are dead and that TrueType or OpenType fonts and PDF + output are the way to go. While this is true for many cases, + standard <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> does not work with TrueType fonts and does + not produce <small><a href="chapter4.html#PDF" class="acroref" name="A204" title="Portable Document Format">PDF</a></small> directly. Only + <i><a name="p204">pdf<span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span></a></i> does that, and there are + still many printers whose typesetters and platemakers use + <a name="t38">PostScript</a> rather than <small><a href="chapter4.html#PDF" class="acroref" name="A205" title="Portable Document Format">PDF</a></small>. In addition, operating system + support for scalable fonts is still very poor on Unix + systems (including Linux), despite the advances in recent + years, so in many cases it still makes sense to use + <span class="TEX">T<span class="E">E</span>X</span>'s built-in support for PostScript. + </p> + <p>Two files are needed for each font: the + <code>.afm</code><a name="AFM" class="acroref">Adobe Font + Metric</a> (<small>AFM</small>) and the <code>.pfb</code><a name="PFB" class="acroref">PostScript Font Binary</a> (<small>PFB</small>) files. + <em>You must have both for each font before you + start.</em> If you only have the near-obsolete + <code>.pfa</code><a name="PFA" class="acroref">PostScript Font + ASCII</a> (<small>PFA</small>) files, it may be possible to generate the + <code>.pfb</code> files using the + <i><a name="p205">t1binary</a></i> program from the + <i><a name="p206">t1utils</a></i> suite (see <a href="http://gnuwin32.sourceforge.net/packages/t1utils.htm"><tt>http://gnuwin32.sourceforge.net/packages/t1utils.htm</tt></a>) + or the excellent <i><a name="p207">PFAedit</a></i> font + editor (from <a href="http://pfaedit.sourceforge.net"><tt>http://pfaedit.sourceforge.net</tt></a>). There are + unfortunately still some companies distributing Type 1 + fonts in <code>.pfa</code> format (Mathematica is + one reported recently). + </p> + <blockquote class="warning"><a name=""></a><p><img src="warning.png" align="left" alt="!!!">The installation method I described in earlier + editions has worked perfectly for me for years, but I have + updated it here to use the facilities of the + <i><a name="p208">updmap</a></i> program (which comes + with your <span class="TEX">T<span class="E">E</span>X</span> installation). This removes the need for + one of the steps I gave before, which required editing the + <code>psfonts.map</code> file, as this is now + recreated by <i><a name="p209">updmap</a></i>. The + procedure below is <em>not</em> the official + way (that's <i><a name="p210">fontinst</a></i>), but + it is the basis for a script I am working on called + <i><a name="p211">Gutta-Percha</a></i><sup><a href="#F46">4</a></sup>, which automates the whole process. + </p> + </blockquote> + <p>I'll repeat this: before you start, make sure you + have all the <code>.afm</code> and + <code>.pfb</code> files for the typeface you want. + In the example below, I'm going to use a single font + from an imaginary typeface called Foo, so I have + <code class="literal">foo.afm</code> and + <code class="literal">foo.pfb</code> files. + </p> + <ol> + <li><b>Put the files in your temporary directory</b><br><p>This is <code>/tmp</code> on Linux, and + should be <code>C:\tmp</code> or + <code>C:\temp</code> or even + <code>C:\Windows\temp</code> on Microsoft + Windows. + </p> + </li> + <li><b>Decide on the short font name to use + inside <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span>.</b><br><p>This is <em>not</em> the full + descriptive name (e.g. Baskerville Italic Bold + Extended) but an encoded font name in the format + <code class="literal">fnnsseec</code>, devised by <a name="N18">Karl Berry</a>, which stores the same information in no + more than eight characters for compatibility with + systems which cannot handle long filenames. The letters + in the format above have the following meanings (see the + <i><a name="p212">fontname</a></i> documentation on + your computer for more details): + </p> + <div align="center"> + <table> + <tr class="headfoot"> + <th valign="bottom" align="left">Letter</th> + <th valign="bottom" align="left">Meaning</th> + <th valign="bottom" align="left">Examples</th> + </tr> + <tr> + <td valign="top" align="left"><code class="literal">f</code></td> + <td valign="top" align="left">foundry</td> + <td valign="top" align="left"><code class="literal">b</code>=Bitstream, + <code class="literal">m</code>=Monotype, + <code class="literal">p</code>=Adobe + </td> + </tr> + <tr> + <td valign="top" align="left"><code class="literal">nn</code></td> + <td valign="top" align="left">typeface</td> + <td valign="top" align="left"><code class="literal">ba</code>=Baskerville, + <code class="literal">tm</code>=Times, + <code class="literal">pl</code>=Palatino + </td> + </tr> + <tr> + <td valign="top" align="left"><code class="literal">ss</code></td> + <td valign="top" align="left">series/shape</td> + <td valign="top" align="left"><code class="literal">r</code>=roman, + <code class="literal">bi</code>=bold italic, etc. + </td> + </tr> + <tr> + <td valign="top" align="left"><code class="literal">ee</code></td> + <td valign="top" align="left">encoding</td> + <td valign="top" align="left"><code class="literal">8a</code>=default 8-bit ANSI, + <code class="literal">ly</code>=Y&Y's + <span class="TEX">T<span class="E">E</span>X</span>'n'ANSI + </td> + </tr> + <tr> + <td valign="top" align="left"><span style="font-weight:bold; "><code class="literal">c</code></span></td> + <td valign="top" align="left">[small]caps</td> + <td valign="top" align="left">(this is a literal + ‘c’ character, used only + if needed) + </td> + </tr> + </table> + </div> + <p>The <code>texmf/fontname</code> directory in + your installation of <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> has files for several + foundries giving fully-formed names like these for + common fonts (e.g. <code class="literal">ptmr8a</code> is [Adobe] + <u><b>P</b></u>ost­Script + <u><b>T</b></u>i<u><b>m</b></u>es + <u><b>R</b></u>oman in an + <u><b>8</b></u>–bit <u><b>A</b></u>NSI + encoding; + <code class="literal">bgslly</code> is <u><b>B</b></u>itstream + <u><b>G</b></u>ill <u><b>S</b></u>ans + <u><b>L</b></u>ight in Y&Y's + <span class="TEX">T<span class="E">E</span>X</span>'n'ANSI encoding + [<u><b>LY</b></u>1]).<sup><a href="#F47">5</a></sup> Read the documentation in <cite><a href="http://www.ctan.org/tex-archive/info/fontname/" name="C40">Fontname: Filenames for <span class="TEX">T<span class="E">E</span>X</span> fonts</a></cite> to find out how to make up + your own short names if the foundry and font you want is + not shown in the <code>fontname</code> + directory. + </p> + <p>In this example we'll call our mythical example + typeface ‘zork’ (standing for + <u><b>Z</b></u>fonts <u><b>Or</b></u>dinary + Boo<u><b>k</b></u>face, because + <code>k</code> is the letter used for Book + fonts, <code>b</code> being already the code + for bold) and we'll assume the font comes in the two + files <code>foo.afm</code> and + <code>foo.pfb</code> that I mentioned + above. + </p> + <p>While the <i><a name="p213">fontname</a></i> + directories have ready-made lists of these names for + popular collections of typefaces, making them up + requires some knowledge of typographic terms and a + careful reading of the + <i><a name="p214">fontname</a></i> + documentation. + </p> + </li> + <li><b>Decide on your encoding</b><br><p>This is what tripped me up the first few times until + someone pointed me at Y&Y's<sup><a href="#F48">6</a></sup><span class="TEX">T<span class="E">E</span>X</span>'n'ANSI encoding which (to me) seems to + be the only one that includes the glyphs I want where I + want them.<sup><a href="#F49">7</a></sup><a name="I157"></a> Your mileage may vary. This encoding is + referred to as <code class="literal">LY1</code> within <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> and + the encoding file is in + <code>texmf/dvips/base/texnansi.enc</code>. + Encoding is needed because Adobe fonts store their + characters in different places to the <span class="TEX">T<span class="E">E</span>X</span> + standard. + </p> + <p>Copy this encoding file to the temporary directory + where you're doing all this stuff. If you're + using the 8a or 8r encoding (or some other encoding), + then copy that file instead + (<code>8a.enc</code>, + <code>8r.enc</code>). + </p> + </li> + <li><b><a name="idfile">Convert <code>.afm</code> files to + <code>.tfm</code></a></b><br><p>The <i><a name="p215">afm2tfm</a></i> program is a + standard utility in the <code>bin</code> + directory of your <span class="TEX">T<span class="E">E</span>X</span> installation. If it's not, + update your installation. + </p> + <p>In a command window, type:</p> + <blockquote><pre class="footnotesize"> +afm2tfm foo.afm -v zorkly.vpl -p texnansi.enc \ +rzorkly.tfm >zork.id + </pre></blockquote> + <p>(Here and elsewhere I have sometimes had to break + the line to fit it on the printed page. It's actually + all typed as one long line if you omit the + backslash.) + </p> + <p>This creates a special ‘raw’<span class="TEX">T<span class="E">E</span>X</span> Font Metric file (hence the special + <code class="literal">r</code> prefix) that <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> can use, with + a list of all its properties encoded with LY1 (the + <code>.vpl</code> or Virtual Property List + file). Many people will tell you that virtual fonts are + dead and that this is the wrong way to do it, but no-one + has ever shown me an alternative that works, so I stick + with it. + </p> + </li> + <li><b><a name="sc">Small caps (optional)</a></b><br><p>If you want a small caps variant faked up (perhaps + because the typeface family doesn't have a special + small-caps font), repeat the medicine like this: + </p> + <blockquote><pre class="footnotesize"> +afm2tfm foo.afm -V zorklyc.vpl -p texnansi.enc \ +rzorkly.tfm >>zork.id + </pre></blockquote> + <p>Note the capital <code class="literal">V</code> option here. + Yes, it <em>does</em> overwrite the + <code>rzorkly.tfm</code> created in the first + command. Let it. And those are <em>two</em> + of the ‘greater-than’ signs + before the <code>zork.id</code> filename because + we want to append to it, not overwrite it. + </p> + </li> + <li><b>Create the virtual font</b><br><p>Turn the <code>.vpl</code> files into + <code>.vf</code> and <code>.tfm</code> + pairs. <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> uses these to convert from Adobe's + encoding to its own. + </p> + <blockquote><pre> +vptovf zorkly.vpl zorkly.vf zorkly.tfm +vptovf zorklyc.vpl zorklyc.vf zorklyc.tfm + </pre></blockquote> + <p>Again, the <code>vptovf</code> program is a + standard part of your <span class="TEX">T<span class="E">E</span>X</span> distribution. + </p> + </li> + <li><b>Make directories to hold the files</b><br><div class="figure" align="center"> + <hr> + <caption><i>Figure 8.1</i>: <a name="mksubdir">Making subdirectories to hold the files</a></caption> + <div align="center" style="margin:12px"><img src="fonts.png" width="75%"></div> + <hr> + </div> + <p>Under your <code>texmf-local</code> + directory there should be a <code>fonts</code> + directory, and in there there should be + <code>afm</code>, <code>tfm</code>, + <code>type1</code>, and <code>vf</code> + directories. Create them if they do not already + exist. + </p> + <p>In each of these four, create a directory for the + foundry, and within them create a directory for the + typeface (using a human-readable typeface name, not the + short <a name="N19">Karl Berry</a> fontname). In our example, this + means: + </p> + <blockquote><pre> +cd /usr/TeX/texmf-local/fonts +mkdir -p afm/zfonts/ordinary +mkdir -p tfm/zfonts/ordinary +mkdir -p type1/zfonts/ordinary +mkdir -p vf/zfonts/ordinary +cd /tmp + </pre></blockquote> + <p>Or if you're lazy like me:</p> + <blockquote><pre> +(cd /usr/TeX/texmf-local/fonts;\ +for d in afm tfm type1 vf;\ +do mkdir -p $d/zfonts/ordinary;done) + </pre></blockquote> + <p>For Microsoft Windows users, the path before + <code>texmf-local</code> may look something like + <code class="literal">C:\Program Files\TeXLive\</code>, depending + on how and where you have installed your <span class="TEX">T<span class="E">E</span>X</span> + system. + </p> + <p>The <code class="literal">-p</code> is a Unix feature: it + automatically creates any missing intervening + subdirectories. If your directory-making command + doesn't do this, you'll have to make the + intervening directories by hand first. + </p> + </li> + <li><b>Copy the files to their rightful places</b><br><p>Copy the four groups of files to the four new + directories: + </p> + <blockquote><pre> +cp *.afm /usr/TeX/texmf/fonts/afm/zfonts/ordinary/ +cp *.tfm /usr/TeX/texmf/fonts/tfm/zfonts/ordinary/ +cp *.pfb /usr/TeX/texmf/fonts/type1/zfonts/ordinary/ +cp *.vf /usr/TeX/texmf/fonts/vf/zfonts/ordinary/ + </pre></blockquote> + <p>You can of course do all this with a directory + window and mouse if you find it easier. + </p> + </li> + <li><b>Create a font map</b><br><p>The font map is what tells + <i><a name="p216">dvips</a></i> which <small><a href="chapter8.html#PFB" class="acroref" name="A209" title="PostScript Font Binary">PFB</a></small> file to use for which font. The + configuration file for <i><a name="p217">dvips</a></i> + is <code>texmf/dvips/config/config.ps</code> and + it gets its entries from the program + <i><a name="p218">updmap</a></i> which reads map files + for each typeface. The configuration file for + <i><a name="p219">updmap</a></i> is + <code>texmf-var/web2c/updmap.cfg</code><sup><a href="#F50">8</a></sup>, so it needs an entry for our new font, + using the three-letter font family abbreviation (the + first three letters of the Berry fontname (here + ‘<code class="literal">zor</code>’): + </p> + <blockquote><pre> +Map zor.map + </pre></blockquote> + <p>We also have to create this map file + (<code>zor.map</code>) in a subdirectory of + <code>texmf-local/dvips/config/</code> named + after the foundry, so we need to create + <code>texmf-local/dvips/config/zfonts</code> as + well. + </p> + <ol> + <li> + <p>Open + <code>/usr/TeX/texmf-var/web2c/updmap.cfg</code> + in your editor. + </p> + </li> + <li> + <p>At the bottom, add the line: + <code class="literal">Map zor.map</code></p> + </li> + <li> + <p>Save and close the file.</p> + </li> + </ol> + <p>The font entries in our + <code class="literal">zor.map</code> will be on a + <em>single</em> line each, with no + line-wrapping. Each entry gives the short name of the + font, the long (Adobe) name, the + <a name="t39">PostScript</a> encoding parameters + (in quotes), and then two filenames prefixed by input + redirects (less-than signs): the encoding file and the + <a name="t40">PostScript</a> outline file. + </p> + <ol> + <li> + <p>First create the directory if it doesn't already + exist: + </p> + <blockquote><pre> +mkdir -p /usr/TeX/texmf-local/dvips/config/zfonts + </pre></blockquote> + </li> + <li> + <p>Use your editor to open (create) the file + <code>/usr/TeX/texmf-local/dvips/config/zfonts/zor.map</code>. + </p> + </li> + <li> + <p>Insert the line:</p> + <blockquote><pre class="scriptsize"> +rzorkly Ordinary-Blackface "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <foo.pfb + </pre></blockquote> + </li> + <li> + <p>Save and close the file.</p> + </li> + </ol> + <p>You get the full font name (here, + ‘Ordinary-Blackface’) from the + <code class="literal">zork.id</code> which was created back in + <a href="chapter8.html#idfile">step 4</a> when we ran + <i><a name="p220">afm2tfm</a></i>. You must get this + exactly right, because it's the + ‘official’ full name of the font, + and <a name="t41">PostScript</a> files using this + font need to match it. + </p> + </li> + <li><b>Create a style file</b><br><p><span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> needs a style file to implement the + interface to the font. Call it after the typeface or + something related; in this example we'll call it + <code>foozork.sty</code>. In it go some details + of the name and date we did this, what version of + <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> it needs, and any other command necessary to + operate the font, like the font encoding and whether it + is to supersede the current default Roman font. + </p> + <ol> + <li> + <p>Use your editor to open (create) + <code>foozork.sty</code> in your + <code>texmf-local/tex/latex/psnfss</code> + directory. + </p> + </li> + <li> + <p>Insert the following lines:</p> + <blockquote><pre> +% foozork - created from foo for Zork +\def\fileversion{1.0} +\def\filedate{2002/12/03} +\def\docdate{2002/12/03} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{foozork} + [\filedate\space\fileversion\space + Zfonts Ordinary PSNFSS2e package] +\RequirePackage[LY1]{fontenc} +\renewcommand{\rmdefault}{zor} +\endinput + </pre></blockquote> + <p>Note the following:</p> + <ul> + <li> + <p>The first argument to + <code class="command"><a name="c257">\ProvidesPackage</a></code> + <em>must</em> be the same as this + style file name; and that the font family is + referred to as <code class="literal">zor</code>, being the + foundry letter plus the fontname abbreviation. + This acts as a prefix for any/all font variants + (bold, italic, etc.). + </p> + </li> + <li> + <p>If you are not using Y&Y encoding, + omit the line referring to LY1 font + encoding. + </p> + </li> + <li> + <p>If this is a typewriter font, make the + renewed command <code class="command"><a name="c258">\rmdefault</a></code> + into <code class="command"><a name="c259">\ttdefault</a></code>. + </p> + </li> + <li> + <p>If it's a sans-serif font, make it + <code class="command"><a name="c260">\sfdefault</a></code> instead. + </p> + </li> + <li> + <p>Omit the command completely if you + don't want the style file to supersede the + current defaults but simply to make the font + available. If you do this, you probably want to + write a new command or two to use it, typically + one for grouped use and one for argument + use: + </p> + </li> + </ul> + <blockquote><pre class="footnotesize"> +\newcommand{\zorkfamily}{\fontencoding{LY1}% + \fontfamily{zor}\selectfont} +\newcommand{\textzork}[1]{{\zorkfamily#1}} + </pre></blockquote> + </li> + <li> + <p>Save and close the file.</p> + </li> + </ol> + </li> + <li><b><a name="fdfiles">Create the Font Definition file</a></b><br><p>The last file to create is the <b><i><a name="fontdef">font definition</a></i></b> + (<code>.fd</code>) file. This is named + following the pattern <code class="literal">eeefnn.fd</code>, + using the same conventions as before, by prepending the + (lowercase) encoding abbreviation to the foundry letter + and fontname abbreviation, so our example would be + <code class="literal">ly1zor.fd</code> for the LY1 encoding and + the <code class="literal">zor</code> short font name. + </p> + <ol> + <li> + <p>Use your editor to open (create) + <code>texmf-local/tex/latex/psnfss/ly1zor.fd</code></p> + </li> + <li> + <p>Enter the following lines:</p> + <blockquote><pre> +\ProvidesFile{ly1zor.fd}[2002/03/03 v0.1 manual + font definitions for LY1/zor.] + +\DeclareFontFamily{LY1}{zor}{} + +\DeclareFontShape{LY1}{zor}{k}{n}{<-> zorkly}{} +\DeclareFontShape{LY1}{zor}{k}{sc}{<-> zorklyc}{} + </pre></blockquote> + </li> + <li> + <p>Save and close the file.</p> + </li> + </ol> + <p>FD files typically use one + <code class="command"><a name="c261">\DeclareFontFamily</a></code> command which + specifies the encoding and the short font name. Then as + many pairs of <code class="command"><a name="c262">\DeclareFontShape</a></code> + commands as you converted fonts (assuming you did both + normal and small caps for each font: see + <a href="chapter8.html#sc">step 5</a>; if you didn't, then only one + such command per font is needed here). The arguments to + the <code class="command"><a name="c263">\DeclareFontShape</a></code> command to watch + are the 3rd (weight/width), 4th (shape), and 5th (font + outline name): the rest are static for each + <code>.fd</code> file and simply identify the + encoding and the font family. + </p> + <p>The codes to use are given on + pages 414–15 of the <cite><a href="bibliography.html#companion" name="C41">The <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> Companion</a></cite> and should also be in + your copies of + <code>texmf/fontnames/weight.map</code> and + <code>texmf/fontnames/width.map</code>. The + rules for combining weight and width need care: <small><a href="chapter1.html#RTFM" class="acroref" name="A210" title="Read The Fine Manual">RTFM</a></small> for + <span class="package"><a name="m86">fontname</a></span>. There is no + <code>shape.map</code> in + <span class="package"><a name="m87">fontname</a></span> because it's not + part of font file names, it's purely a <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> + creation, so here's what the same book says: + </p> + <div align="center"> + <table> + <tr class="headfoot"> + <th valign="bottom" align="left">Character</th> + <th valign="bottom" align="left">Meaning</th> + </tr> + <tr> + <td valign="top" align="left"><code class="literal">n</code></td> + <td valign="top" align="left">normal (upright)</td> + </tr> + <tr> + <td valign="top" align="left"><code class="literal">it</code></td> + <td valign="top" align="left">italic</td> + </tr> + <tr> + <td valign="top" align="left"><code class="literal">sl</code></td> + <td valign="top" align="left">slanted</td> + </tr> + <tr> + <td valign="top" align="left"><code class="literal">sc</code></td> + <td valign="top" align="left">small caps</td> + </tr> + <tr> + <td valign="top" align="left"><code class="literal">ui</code></td> + <td valign="top" align="left">upright italic</td> + </tr> + <tr> + <td valign="top" align="left"><code class="literal">ol</code></td> + <td valign="top" align="left">outline</td> + </tr> + </table> + </div> + <p>Add your own for other oddities, but be consistent: + I use <code class="literal">cu</code> for cursive (scripts), for + example, and <code class="literal">k</code> for blackletter faces + (not to be confused with <code class="literal">k</code> as a + <em>width</em> for + ‘book’). + </p> + <p>The default fontspec + <code class="literal"><-></code> in the 5th argument + in the <code class="command"><a name="c264">\DeclareFontShape</a></code> command means + that all sizes are to come from the same font outline + (remember if this was a METAFONT font with different + design sizes like <small><a href="chapter8.html#CM" class="acroref" name="A211" title="Computer Modern">CM</a></small> it would + be much more complex). + </p> + <p>If the face has only a few variants, you can create + any other entries for bold, italic, slanted, etc. with + the relevant weight and width and shape values pointing + at the relevant outline file. + </p> + <p>If you want one font to substitute for a missing one + (for example italics to substitute for slanted in a + typeface which has no slanted variant of its own) give + the + <code class="literal">ssub</code> (‘silent + substitution’) command in the fontspec: + for example to make all references to + <code class="literal">sl</code> (slanted) type use an existing + italic font, make the 5th argument like this: + </p> + <blockquote><pre> +{<-> ssub * zor/m/it} + </pre></blockquote> + <p>If you find the x-height of a font too big or too + small to sort well with another font you are using, you + can specify an <code class="literal">s</code> + (‘scale’) factor in this argument + instead: this example will shrink the result to + 80% of normal: + </p> + <blockquote><pre> +{<-> s * [0.8] zorkly} + </pre></blockquote> + </li> + <li><b>Update the index and the map files</b><br><p>Run your <span class="TEX">T<span class="E">E</span>X</span> indexer program (see <a href="chapter5.html#texindex">step 4 in the procedure in section 5.2.2</a>) so that + <i><a name="p221">updmap</a></i> can find the files it + needs. + </p> + <p>Then run <i><a name="p222">updmap</a></i> (just + type <code>updmap</code>). This updates the + maps and runs the <span class="TEX">T<span class="E">E</span>X</span> indexer program again + automatically. + </p> + </li> + </ol> + <p>Now you can <code class="literal">\usepackage{foozork}</code> in + your <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> file to make it the default font. To use the + font incidentally instead of as the default, you can + say: + </p> + <blockquote><pre> +This is {\zorkfamily ZORK} or \textzork{ZORK} + </pre></blockquote> + <ol class="footnotes" start="4"> + <li><a name="F46">Yes, as in rubber.</a></li> + <li><a name="F47">Confusingly, Bitstream fonts (and others from + similar sources) mostly have different names from + the original fonts, so what they call Humanist 521 + is actually Gill Sans. Until recently, US law only + allowed the <em>names</em> of typefaces + to be copyrighted, not the font designs themselves, + leading to widespread piracy.</a></li> + <li><a name="F48">Sadly, Y&Y, Inc has ceased trading and + their <span class="TEX">T<span class="E">E</span>X</span> distribution is not longer available, + although there is email support at <a href="http://lists.ucc.ie/lists/archives/yandytex.html"><tt>http://lists.ucc.ie/lists/archives/yandytex.html</tt></a>, + and their encoding files continue to be used.</a></li> + <li><a name="F49">The only one I still have problems with is + ‘ø’, which for some weird + reason isn't catered for in this encoding.</a></li> + <li><a name="F50">There is another one of these at + <code>texmf/web2c/updmap.cfg</code>, but + that contains the map references for the fonts which + came with your distribution of <span class="TEX">T<span class="E">E</span>X</span>, so you should + not interfere with it.</a></li> + </ol> + </div> + <div class="sect2"> + <h3><a href="#doctoc"><img src="up.png" title="Chapter Contents" width="32" alt="ToC" align="right" border="0"></a>8.3.3 <a name="type1cm">Installing the Type 1 Computer Modern + fonts</a></h3> + <p>Most new distributions of <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> use the + <a name="t42">PostScript</a> Type 1 versions of + the Computer Modern fonts. If your <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span> installation + uses the METAFONT (bitmap) versions of <small><a href="chapter8.html#CM" class="acroref" name="A212" title="Computer Modern">CM</a></small>, you may want to switch to the + Type 1 version, especially if you are going to be using + <i><a name="p223">pdf<span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span></a></i> instead of standard + <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span class="E">E</span>X</span></span>, because Acrobat Reader makes such a hames of + displaying Type3 fonts. <i><a name="p224">GSview</a></i> + and <i><a name="p225">pdfview</a></i> handle them + correctly. + </p> + <p>To do this, install one of the sets of <small><a href="chapter8.html#CM" class="acroref" name="A213" title="Computer Modern">CM</a></small> PostScript fonts. There are several + available: + </p> + <ul> + <li> + <p>The fonts from BlueSky Research at <a href="http://www.ctan.org/tex-archive/fonts/cm/ps-type1/bluesky/"><tt>http://www.ctan.org/tex-archive/fonts/cm/ps-type1/bluesky/</tt></a></p> + </li> + <li> + <p><a name="bkm">Basil K. Malyshev</a>'s ‘BaKoMa’ + fonts at <a href="http://www.ctan.org/tex-archive/fonts/cm/ps-type1/bakoma/"><tt>http://www.ctan.org/tex-archive/fonts/cm/ps-type1/bakoma/</tt></a></p> + </li> + <li> + <p><a name="vv">Vladimir Volovich</a>'s CM-Super at <a href="http://www.ctan.org/tex-archive/fonts/ps-type1/cm-super/"><tt>http://www.ctan.org/tex-archive/fonts/ps-type1/cm-super/</tt></a></p> + </li> + <li> + <p><a name="bj">Bogusław Jackowski</a>'s Latin Modern at <a href="ftp://cam.ctan.org/tex-archive/fonts/ps-type1/lm.tar.gz"><tt>ftp://cam.ctan.org/tex-archive/fonts/ps-type1/lm.tar.gz</tt></a></p> + </li> + </ul> + <p>The BaKoMa fonts include the <a name="AMS" class="acroref">American + Mathematical Society</a> (<small>AMS</small>) fonts for extended + mathematics, but are more complex to install because they + come with a special set of TFM files. + </p> + <p>The BlueSky fonts are just <small><a href="chapter8.html#PFB" class="acroref" name="A215" title="PostScript Font Binary">PFB</a></small> + and AFM files, and are a drop-in replacement requiring no + further changes, as they use the same TFM files as the + METAFONT version. Follow the <code>README</code> + file in the downloadable archive for installation + instructions. + </p> + <p>The Latin Modern and CM-Super fonts are new and I + haven't tested them but they are well spoken of. + Feedback on this is very welcome. + </p> + <p>The <span class="TEX">T<span class="E">E</span>X</span> Live and <span class="TEX">T<span class="E">E</span>X</span> Collection distributions use + Type 1 versions of Computer Modern by default. There + are more details in the FAQ at <a href="http://www.tex.ac.uk/cgi-bin/texfaq2html?label=uselmfonts"><tt>http://www.tex.ac.uk/cgi-bin/texfaq2html?label=uselmfonts</tt></a> . + </p> + </div> + </div> + </div> + <hr> + <table width="100%"> + <tr> + <td align="left"><a href="chapter7.html"><img src="previous.png" alt="Previous" border="0"></a></td> + <td align="center"><a href="#doctoc"><img src="top.png" alt="Top" border="0"></a></td> + <td align="right"><a href="chapter9.html"><img src="next.png" alt="Next" border="0"></a></td> + </tr> + </table> + </body> +</html>
\ No newline at end of file |