<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE book PUBLIC 
 "+//Silmaril//DTD DocBook 4.2 Adapted for Typographic Systems//EN//XML" 
 "typebook.dtd" [ 
<!ENTITY % target "latex">
]>

<?PSGML NOFILL programlisting ?>

<!-- REMINDER of some [ab]uses of DocBook in this document type:

     <command>     is for LaTeX control sequences, typed with no backslash
     <literal>     is for the same where you don't want them indexed
     <methodname>  is used for packages
     <modespec>    is used for environments
     <example>     is used for exercises
     <releaseinfo> in biblioentries is used for URIs
      type=        in <ulink> is used for mail/news methods (with
                   colon) 
     <informaltable colsep="..."> is used for the top row strut
                   separator
     <caution>     is abused to hold text needing a \parbox in LaTeX

     <acronym id="..."> is a defining instance
     <acronym ref="..."> is a reference to it

     See the DTD modification layer for details of other changes.

     Remember, because of vagaries in the way XSLT handles character
     entity references, only use &amp; inside <literal>. In normal
     text, use the homebrew &ampers; instead.

-->

<book id="null">
  <bookinfo>
    <title>Formatting information</title>
    <subtitle>A beginner&apos;s introduction to typesetting with
      <LaTeX/></subtitle>
    <author>
      <firstname>Peter</firstname>
      <surname>Flynn</surname>
      <affiliation>
        <orgname>Silmaril Consultants</orgname>
        <orgdiv>Textual Therapy Division</orgdiv>
      </affiliation>
    </author>
    <edition>March 2005</edition>
    <legalnotice>
      <para>This document is Copyright &copy; 1999&ndash;2005 by
        Silmaril Consultants under the terms of what is now the GNU
        Free Documentation License (copyleft).</para>
      <para>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 <citetitle
          ref="gnufdl"></citetitle>.</para>
      <para>You are allowed to distribute, reproduce, and modify it
        without fee or further requirement for consent subject to the
        conditions in <xref linkend="gfdl-4"/>. 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 <xref linkend="gfdl"/>.
      </para>
    </legalnotice>
    <othercredit>
      <contrib>This edition of <citetitle ref="null">Formatting
	  Information</citetitle> was prompted by the generous help I
	have received from <TeX/> 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 <LaTeX/> 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.</contrib>
      <contrib>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&mdash;as well as other online
	documents&mdash;dealing with mathematical typesetting in
        <TeX/> and <LaTeX/> in finer and better detail than I am
	capable of.</contrib>
      <contrib>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.</contrib>
      <contrib>As I was finishing this edition, I was asked to review
	an article for <citetitle ref="practex"></citetitle>, which
	grew out of the Practical <TeX/> 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
	<emphasis>your</emphasis> knowledge, please let me know so
	that I can correct&nbsp;it.</contrib>
      <authorblurb>
        <para>Peter Flynn is author of <citetitle show="none"
            ref="htmlbook"></citetitle> and <citetitle show="none"
            ref="sgmltools"></citetitle>, and editor of <citetitle
            ref="xmlfaq" show="none"></citetitle>.</para>
      </authorblurb>
    </othercredit>
    <releaseinfo>The text is written and
      maintained in DocBook with a customization layer for
      typographics. <acronym ref="XSLT"></acronym> is used to generate
      <acronym ref="HTML"></acronym> (for the Web and plain-text
      versions) and <LaTeX/> (for <acronym ref="PDF"></acronym> and
      <trademark>PostScript</trademark>). The November 2003 edition
      was published in <citetitle ref="tugboat"
	show="title"></citetitle>. This edition contains extensive
      revisions and simplifications to the text, and many corrections
      to the way in which the packages and their capabilities are
      presented.</releaseinfo>
    <revhistory>
      <revision>
        <revnumber>3.6</revnumber>
        <date YYYY-MM-DD="2005-03-31">March 2005</date>
        <revremark>Since the publication of the November 2003 edition
          in <citetitle ref="tugboat" show="title"></citetitle>,
          several new books on <LaTeX/> have been released, and this
          edition reflects some of the new material and approaches
          contained in them. See the Bibliography for details of these
          publications. The only technical change has been to use
          empty elements for the <TeX/>, <LaTeX/>, and other logos
          instead of the more usual entities so that the HTML version
          can use CSS to produce better logos. Thanks to whoever wrote
          the CSS for <TeX/>4ht, which is where I found the
          styles.</revremark>
      </revision>
      <revision>
        <revnumber>3.5</revnumber>
        <date YYYY-MM-DD="2004-07-29">July 2004</date>
        <revremark>Modified DTD to add span element type to allow use
          of external entities for formatted <TeX/>, <LaTeX/>, and
          other logos in the HTML version. Changed entity declaration
          in the internal subset to enable this, and switched
          declarations and marked sections in the DTD. This now means
          it needs Saxon 7 or 8 to process, as Saxon 6 does not handle
          parameter entities values used as parameter entity
          declarations.</revremark>
      </revision>
      <revision>
        <revnumber>3.4</revnumber>
        <date YYYY-MM-DD="2003-11-09">November 2003</date>
        <revremark>Applied all Barbara Beeton&apos;s corrections (see
          separate emails) and rewrote a few formatting macros to
          allow the document to fit more easily into US Letter shape.
          It would be nice if it would also format for A5 so that it
          could become a paperback but that&apos;s another day&apos;s work.
          Started on writing the missing sections (Installing Type 1
          <acronym ref="CM"></acronym> Fonts and Going beyond <LaTeX/>,
          but these are not finished yet) and rewrote entirely the
          existing (non-<acronym ref="CM"></acronym>) Type 1 font
          installation procedure in line with the new (unreleased)
          Gutta-Percha script. Added hidden meanings for <acronym
            id="CD-ROM">Compact Disc Read-Only Memory</acronym>,
          <acronym id="DVD">Digital Versatile Disk</acronym>, <acronym
            id="IBM">International Business Machines</acronym>.</revremark>
      </revision>
      <revision>
        <revnumber>3.3</revnumber>
        <date YYYY-MM-DD="2003-08-20">August 2003</date>
        <revremark>Fixed <acronym ref="XSLT"></acronym> bug which
          wrongly lettered appendices. Fixed problem which called
          wrong font for examples of Times and Helvetica (thanks to
          William Adams). Updated numerous typos, added comments about
          pdftex option to color. Rewrote formatting for
          TUGboat.</revremark>
      </revision>
      <revision>
        <revnumber>3.2</revnumber>
        <date YYYY-MM-DD="2003-03-05">March 2003</date>
        <revremark>Finished rewrite. Revised and expanded almost
          everything.</revremark>
      </revision>
      <revision>
        <revnumber>3.1</revnumber>
        <date YYYY-MM-DD="2002-08-28">August 2002</date>
        <revremark>Recast in DocBook and reworded some sections.
          Started the big rewrite.</revremark>
      </revision>
    </revhistory>
  </bookinfo>
  <toc>
    <title>Contents</title>
  </toc>
  <preface id="intro">
    <title>Introduction</title>
    <para>This book originally accompanied a 2-day course on using the
      <LaTeX/> typesetting system. It has been extensively revised and
      updated and can now be used for self-study or in the classroom.
      It is aimed at users of Linux, Macintosh, or Microsoft Windows
      but it can be used with <LaTeX/> systems on any platform,
      including other Unix workstations, mainframes, and even your
      <acronym id="PDA">Personal Digital Assistant</acronym>.</para>
    <section>
      <title>Who needs this book?</title>
      <para>The audience for the original training course was assumed
        to be computer-literate and composed of professional,
        business, academic, technical, or administrative computer
        users. The readers of the book (you) are mostly assumed to be
        in a similar position, but may also come from many other
        backgrounds, including hobbyists, students, and just people
        interested in quality typesetting. You are expected to have
        one or more of the following or similar objectives:</para>
      <itemizedlist>
        <listitem>
          <para>producing typesetter-quality formatting;</para>
        </listitem>
        <listitem>
          <para>formatting long, complex, highly-structured,
            repetitive, or automatically-generated
            documents;<footnote>
              <para><LaTeX/> can easily be used for once-off or short
                and simple documents as well, but its real strengths
                lie in consistency and automation.</para>
            </footnote></para>
        </listitem>
        <listitem>
          <para>saving time and effort by automating common
            tasks;</para>
        </listitem>
        <listitem>
          <para>achieving or maintaining your independence from
            specific makes or models of proprietary hardware,
            software, or file formats (portability);</para>
        </listitem>
        <listitem>
          <para>using Open Source software (free of restrictions,
            sometimes also free of charge).</para>
        </listitem>
      </itemizedlist>
    </section>
    <section>
      <title>Skills needed</title>
      <para><LaTeX/> is a very easy system to learn, and requires no
        specialist knowledge, although literacy and some familiarity
        with the publishing process is useful. It is, however, assumed
        that you are completely fluent and familiar with using your
        computer before you start. Specifically, effective use of this
        document requires that you already know and understand the
        following very thoroughly:</para>
      <itemizedlist>
        <listitem>
          <para>how to use a good plain-text
            editor (<emphasis>not</emphasis> a wordprocessor like
            <productname>OpenOffice</productname>,
            <productname>WordPerfect</productname>, or Microsoft
            <productname>Word</productname>, and
            <emphasis>not</emphasis> a toy like Microsoft
            <productname>Notepad</productname>);<note>
              <para>2.1.3</para>
            </note></para>
        </listitem>
        <listitem>
          <para>where to find all 95 of the printable <acronym
              ref="ASCII"></acronym> characters on your keyboard and
            what they mean, and how to type accents and symbols, if
            you use them;<note>
              <para>3.2.1.2</para>
            </note></para>
        </listitem>
        <listitem>
          <para>how to create, open, save,
            close, rename, move, and delete files and folders
            (directories);<note>
              <para>2.3</para>
            </note></para>
        </listitem>
        <listitem>
          <para>how to use a Web browser and/or <acronym id="FTP">File
            Transfer Protocol</acronym> program to
            download and save files from the Internet;<note>
              <para>7.3.1.6</para>
            </note></para>
        </listitem>
        <listitem>
          <para>how to uncompress and unwrap (unzip or detar)
            downloaded files.<note>
              <para>2.3.7</para>
            </note></para>
        </listitem>
      </itemizedlist>
      <para>If you don&apos;t know how to do
        these things yet, it&apos;s important to go and learn them
        first. Trying to become familiar with the fundamentals of
        using a computer <emphasis>at the same time</emphasis> as
        learning <LaTeX/> is not likely to be as effective as doing
        them in order.</para>
      <para>These are not specialist
	skills&mdash;they are all included in the <acronym id="ECDL"
	  vendor="http://www.ecdl.com/">European Computer Driving
	  Licence</acronym> and the relevant sections of the <acronym
	  ref="ECDL"></acronym> syllabus are noted in the margin
	above, so they are well within the capability of anyone who
	uses a computer.</para>
    </section>
    <section>
      <title>Objectives of this book</title>
      <para>By the end of this book, you should be able to undertake
        the following tasks:</para>
      <itemizedlist>
        <listitem>
          <para>use a plain-text editor to create and maintain your
            documents;</para>
        </listitem>
        <listitem>
          <para>add <LaTeX/> markup to identify
            your document structure and formatting
            requirements;</para>
        </listitem>
        <listitem>
          <para>typeset <LaTeX/> documents, correct simple formatting
            errors, and display or print the results;</para>
        </listitem>
        <listitem>
          <para>identify, install, and use additional packages (using
            <acronym ref="CTAN"></acronym> for downloading where
            necessary);</para>
        </listitem>
        <listitem>
          <para>recognise the limitations of procedural markup systems
            and choose appropriate generic markup methods where
            appropriate.</para>
        </listitem>
      </itemizedlist>
    </section>
    <section>
      <title>Synopsis</title>
      <para>The original course covered the following topics as
        separate sessions, which are represented in the book as
        chapters:</para>
      <orderedlist>
        <listitem>
          <para>Where to get and how to install
            <LaTeX/> (<productname>te<TeX/></productname>,
            <productname>fp<TeX/></productname>, or
            <productname>pro<TeX/>t</productname> from the
            <TeX/> Collection disks);<indexterm>
              <primary sortas="texlive"><TeX/> Live</primary>
            </indexterm><indexterm>
              <primary sortas="texcollection"><TeX/>
                Collection</primary>
            </indexterm></para>
        </listitem>
        <listitem>
          <para>How to type <LaTeX/> documents:
            using an editor to create files
            (half a dozen editors for <LaTeX/>);</para>
<!-- more on the Mac editor! -->
        </listitem>
        <listitem>
          <para>Basic structures (the Document Class Declaration and
            its layout options; the document environment with sections
            and paragraphs);</para>
        </listitem>
        <listitem>
          <para>Typesetting, viewing, and printing;</para>
        </listitem>
        <listitem>
          <para>The use of packages and <acronym ref="CTAN"></acronym>
            to adapt formatting using standard tools;</para>
        </listitem>
        <listitem>
          <para>Other document structures (lists, tables, figures,
            images, and verbatim text);</para>
        </listitem>
        <listitem>
          <para>Textual tools (footnotes, marginal notes,
            cross-references, indexes and glossaries, and
            bibliographic citations);</para>
        </listitem>
        <listitem>
          <para>Typographic considerations (white-space and typefaces;
            inline markup and font changes; extra font installation
            and automation);</para>
        </listitem>
        <listitem>
          <para>Programmability and automation (macros and modifying
            <LaTeX/>&apos;s behaviour);</para>
        </listitem>
        <listitem>
          <para>Conversion and compatibility with other systems
            (<acronym ref="XML"></acronym>,
            <productname>Word</productname>, &etc;).</para>
        </listitem>
      </orderedlist>
      <para>A few changes have been made in the transition to printed
        and online form, but the basic structure is the same, and the
        document functions as a workbook for the course as well as a
        standalone self-teaching guide.</para>
    </section>
    <section>
      <title>Where&apos;s the math?</title>
      <para>It is important to note that
        the document <emphasis>does not cover</emphasis> mathematical
        typesetting, complex tabular material, the design of
        large-scale macros and document classes, or the finer points
        of typography or typographic design, although it does refer to
        these topics in passing on a few occasions.</para>
      <indexterm>
        <primary>mathematics</primary>
      </indexterm>
      <para>There are several other guides, introductions, and
	<wordasword>get-started</wordasword> documents on the Web and
	on <acronym ref="CTAN"></acronym> which cover these topics and
	more. Among the more popular are:</para>
      <itemizedlist>
        <listitem>
          <para><citetitle ref="begin"></citetitle>, where all
            beginners should start;</para>
        </listitem>
        <listitem>
          <para><citetitle ref="lshort"></citetitle> is a good
            beginner&apos;s tutorial;</para>
        </listitem>
        <listitem>
          <para><citetitle ref="gentle"></citetitle> is a classic
            tutorial on Plain <TeX/>;</para>
        </listitem>
        <listitem>
          <para><citetitle ref="imported"></citetitle> shows you how
            to do (almost) anything with graphics: side-by-side,
            rotated, &etc;;</para>
        </listitem>
        <listitem>
          <para><citetitle ref="mathguide"></citetitle> gets you
            started with the American Math Society&apos;s powerful
            packages;</para>
        </listitem>
        <listitem>
          <para><citetitle ref="symbol-list"></citetitle> shows over
            2,500 symbols available.</para>
        </listitem>
      </itemizedlist>
      <para>This list was taken from the
        <acronym ref="CTAN"></acronym> search page. There are also
        lots of books published about <TeX/> and <LaTeX/>: the most
        important of these for users of this document are listed in
        <xref linkend="docs"/>.</para>
    </section>
    <section id="availability">
      <title>Availability of <LaTeX/> systems</title>
      <para>Because the <TeX/> program (the
	<wordasword>engine</wordasword> which actually does the
	typesetting) is separate from whichever editor you choose,
	<TeX/>-based systems are available in a variety of different
	modes using different interfaces, depending on how you want to
	use them.</para>
      <section id="gui">
        <title>Graphical interface</title>
        <para>The normal way to run <LaTeX/> is
          to use a toolbar button (icon), a menu item, or a keystroke
          in your editor. Click on it and your document gets saved and
          typeset. All the other features of <LaTeX/> systems (the
          typeset display, spellchecker, related programs like
          <productname>makeindex</productname> and <BibTeX/>) are run
          the same way. This works both in a normal <acronym
            id="GUI">Graphical User Interface</acronym> as well as in
          text-only interfaces.</para>
        <para>In the popular <LaTeX/> editors like
          <productname>Emacs</productname>,
          <productname><TeX/>shell</productname>,
          <productname><TeX/>nicCenter</productname>,
          <productname>WinShell</productname>, or
          <productname>WinEdt</productname>, a record of the
          typesetting process is shown in an adjoining window so that
          you can see the progress of pages being typeset, and any
          errors or warnings that may occur.<footnote>
            <para>Recent versions of some editors hide this display by
              default unless errors occur in the typesetting.</para>
          </footnote></para>
      </section>
      <section id="cli">
        <title>Command-line interface</title>
        <para>However, the graphical interface
          is useless if you want to run <LaTeX/> unattended, as part of an
          automated system, perhaps in a web server or e-commerce
          environment, where there is no direct connection between
          user and program. The underlying <TeX/> engine is in fact
          a <acronym id="CLI">Command-Line Interface</acronym> program,
          that is, it is used as a
          <wordasword>console</wordasword> program which you run from
          a standard Unix or Mac terminal or shell window (or from an
          MS-DOS command window in Microsoft Windows systems). You
          type the command
          <literal>latex</literal> followed by the name of your
          document file (see <xref linkend="clidemo"/> in <xref
            linkend="cmdwin"/> for an example).</para>
	<para>Commands like these let you run <LaTeX/> in an automated
	  environment like a
	  <acronym id="CGI">Common Gateway Interface</acronym> script
	  on a web server or a batch file on a document system. All
	  the popular distributions for Unix and Windows, both free
	  and commercial, include this interface as standard
	  (te<TeX/>, fp<TeX/>, MiK<TeX/>, pro<TeX/>t,
	  PC-<TeX/>, True<TeX/>,
	  &etc;).</para>
      </section>
      <section id="displays">
        <title>Typeset displays</title>
        <para><LaTeX/> usually displays your
          typeset results in a separate window, redisplayed
          automatically every time the document is reprocessed,
          because the typesetting is done separately from the editing.
          Some systems, however, can format the typesetting while you
          type, at the expense of some flexibility.</para>
        <variablelist>
          <varlistentry id="async">
            <term>Asynchronous typographic displays</term>
            <listitem>
              <para>This method is called an <firstterm
                  id="asynchronous">asynchronous typographic
                  display</firstterm> because the typeset window only
                updates <emphasis>after</emphasis> you have typed
                something and reprocessed it, not
                <emphasis>while</emphasis> you are still typing, as it
                would with a wordprocessor.<footnote>
                  <para>Among other reasons, <TeX/> typesets whole
                    paragraphs at a time, not line-by-line as lesser
                    systems do, in order to get the hyphenation and
                    justification (H&ampers;J) right (see <xref
                      linkend="handj"/>).
                  </para>
                </footnote></para>
            </listitem>
          </varlistentry>
          <varlistentry id="sync">
            <term>Synchronous typographic displays</term>
            <listitem>
              <para id="synchro">Some distributions of <LaTeX/>
                offer a <firstterm id="synchronous">synchronous
                typographic interface</firstterm>. In these, you type
                directly into the typographic display, as with a
                wordprocessor. Three popular examples are
                <productname>Textures</productname>,
                <productname>Scientific Word</productname>, and
                <productname>V<TeX/></productname> (see table below).
                At least one free version (<LyX/>, see <xref
                linkend="lyxwin"/> in <xref linkend="editors"/>)
                offers a similar interface.</para>
              <para>With a synchronous display
                you get Instant Textual Gratification&trade;, but your
                level of control is restricted to that of the <acronym
                  ref="GUI"></acronym> you use, which cannot provide
                access to everything that <LaTeX/> can do. For
                complete control of the formatting
                you may still need access to your normal source
                (input) file in the same way as for asynchronous
                implementations.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>Near-synchronous displays</term>
            <listitem>
              <para>There are several other
                methods available free for Unix and some other systems
                for close-to-synchronous updates of the typeset
                display (including <personname id="jf">
                  <firstname>Jonathan</firstname>
                  <surname>Fine</surname>
                </personname>&apos;s <productname>Instant
                  Preview</productname> and the <TeX/> daemon), and
                for embedding typographic fragments from the typeset 
                display back into the editor window (<personname id="dk">
                  <firstname>David</firstname>
                  <surname>Kastrup</surname>
                </personname>&apos;s <methodname>preview-latex</methodname>
                package).</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section id="commercial">
        <title>Commercial distributions</title>
        <para>Whatever method you choose, the
          <TeX/> Collection CD and <acronym ref="CTAN"></acronym> are
	  not the only source of software. The vendors listed in <xref
        linkend="vendors"/> offer excellent commercial
	  implementations of <TeX/> and <LaTeX/>,
	  and if you are in a position where their enhanced support
	  and additional features are of benefit, I urge you to
	  support them. In most cases their companies, founders, and
	  staff have been good friends of the <TeX/> and <LaTeX/>
	  communities for many years.<indexterm>
	    <primary>commercial implementations</primary>
	  </indexterm></para>
        <table id="vendors">
	  <title>Popular commercial implementations of <TeX/> systems</title>
          <tgroup cols="4">
            <colspec colwidth=".65in" colsep="flush"/>
            <colspec colwidth="1in"/>
            <colspec colwidth=".9in" align="left"/>
            <colspec colsep="flush" align="left"/>
            <thead>
              <row>
                <entry>Product</entry>
                <entry>Platform</entry>
                <entry>Company</entry>
                <entry>URI</entry>
              </row>
            </thead>
            <tbody>
              <row>
                <entry>PC<TeX/></entry>
                <entry>MS-Windows</entry>
                <entry>Personal <TeX/>, Inc</entry>
                <entry><ulink url="www.pctex.com/"></ulink></entry>
              </row>
              <row>
                <entry>True<TeX/></entry>
                <entry>MS-Windows</entry>
                <entry>True <TeX/></entry>
                <entry><ulink url="truetex.com/"></ulink></entry>
              </row>
              <row>
                <entry>Textures</entry>
                <entry>Apple Mac</entry>
                <entry>Blue Sky Research</entry>
                <entry><ulink url="www.bluesky.com/"></ulink></entry>
              </row>
              <row>
                <entry>Scientific Word</entry>
                <entry>MS-Windows</entry>
                <entry>Mackichan Software</entry>
                <entry><ulink
                    url="www.mackichan.com/"></ulink></entry>
              </row>
              <row>
                <entry>V<TeX/></entry>
                <entry>MS-Windows, Linux, OS/2</entry>
                <entry>MicroPress, Inc</entry>
                <entry><ulink
                    url="www.micropress-inc.com/"></ulink></entry>
              </row>
<!--
              <row>
                <entry>Y&ampers;Y<TeX/></entry>
                <entry>MS-Windows</entry>
                <entry>Y&ampers;Y Software</entry>
                <entry><ulink url="www.yandy.com/"></ulink></entry>
              </row>
-->
            </tbody>
          </tgroup>
        </table>
      </section>
    </section>
    <section id="prodnote">
      <title>Production note</title>
      <para>This document is written and maintained in <acronym
          ref="XML"></acronym>, using a customized version of the
        <productname>DocBook</productname>&nbsp;<acronym
          ref="DTD"></acronym>. Conversions were made to <acronym
          ref="HTML"></acronym> and <LaTeX/> using <acronym
          ref="XSLT"></acronym> scripts and <personname id="mk">
          <firstname>Michael</firstname>
          <surname>Kay</surname>
        </personname>&apos;s <productname>Saxon</productname>
        processor.</para>
      <para>The complete source, with all ancillary files, is
        available online at <ulink
          url="http://www.ctan.org/tex-archive/info/beginlatex/src/"></ulink>
        but if you want to try processing it yourself you must install
        <productname>Java</productname> (from Sun, <acronym
          condition="noid" ref="IBM"></acronym>, or a number of
        others) and <productname>Saxon</productname> (from <ulink
          url="http://saxon.sourceforge.net/"></ulink>), in addition
        to <LaTeX/>.</para>
      <para>This document is published under the terms and conditions
        of the <acronym ref="GNU"></acronym> Free Documentation
        License. Details are in <xref
          linkend="gfdl"/>.</para>
    </section>
<?LaTeX \clearpage?>
    <section id="symbols">
      <title>Symbols and conventions</title>
      <para>The following typographic notations are used:</para>
      <informaltable id="symboltable">
        <tgroup cols="2">
          <colspec colsep="flush" align="left"/>
          <colspec colsep="flush" align="justify" colwidth="3.5in"/>
          <thead>
            <row>
              <entry>Notation</entry>
              <entry>Meaning</entry>
            </row>
          </thead>
          <tbody>
            <row>
              <entry><command>command</command></entry>
                <entry>Control sequences which perform an
                  action, &eg; <command>newpage</command></entry>
            </row>
            <row>
              <entry><varname
                  role="dimension">length</varname></entry>
              <entry>Control sequences which store a dimension
                (measurement in units), &eg; <varname
                  role="dimension">parskip</varname></entry>
            </row>
            <row>
              <entry><varname role="counter">counter</varname></entry>
              <entry>Values used for counting (whole numbers, as
                opposed to measuring in units), &eg; <varname
                  role="counter">secnumdepth</varname></entry>
            </row>
            <row>
              <entry><firstterm id="term">term</firstterm></entry>
                <entry>Defining instance of a
                  new term</entry>
            </row>
            <row>
              <entry><modespec>environment</modespec></entry>
                <entry>A <LaTeX/> formatting environment</entry>
            </row>
            <row>
              <entry><methodname>package</methodname></entry>
                <entry>A <LaTeX/> package (available from <acronym
                    ref="CTAN"></acronym>)</entry>
            </row>
            <row>
              <entry><productname>product</productname></entry>
                <entry>Program or product name</entry>
            </row>
            <row>
              <entry><literal>typewriter type</literal></entry>
                <entry>Examples of source code (stuff you
                  type)</entry>
            </row>
            <row>
              <entry><format fontdefault="tt"
                  lining="under">mybook</format> or <format
                  fontshape="sl"
                  fontdefault="tt">value</format></entry>
              <entry>Mnemonic examples of
                things you have to supply real-life values for</entry>
            </row>
            <row>
              <entry><keycap>x</keycap></entry>
                <entry>A key on your keyboard</entry>
            </row>
            <row>
              <entry><keycombo>
                  <keycap>Ctrl</keycap>
                  <keycap>x</keycap>
                </keycombo></entry>
              <entry>Two keys pressed together</entry>
            </row>
            <row>
              <entry>
                <keycap>Esc</keycap>&thinsp;<keycap>q</keycap>
              </entry>
              <entry>Two keys pressed one after another</entry>
            </row>
            <row>
              <entry><guiicon>Submit</guiicon></entry>
                <entry>On-screen button to click</entry>
            </row>
            <row>
              <entry><guimenu>Menu</guimenu><guimenuitem>Item</guimenuitem></entry>
                <entry>Drop-down menu with items</entry>
            </row>
          </tbody>
        </tgroup>
      </informaltable>
      <para>Examples of longer fragments of input are shown with a
        border round them. Where necessary, the formatted output is
        shown immediately beneath. Warnings are shown with a shaded
        background. Exercises are shown with a double border.</para>
    </section>
  </preface>
  <preface id="foreword">
    <title>Foreword</title>
    <para>As noted in <xref linkend="intro"/>,
      this document accompanies a two-day introductory training course.
      It became obvious from repeated questions in class and
      afterwards, as well as from general queries on <ulink
        url="comp.text.tex" type="news:"></ulink> that many people do
      not read the <acronym ref="FAQ"></acronym>s, do not use the
      <acronym ref="TUG"></acronym> web site, do not buy the books and
      manuals, do not use the newsgroups and mailing lists, and do not
      download the free documentation. Instead, they try to get by
      using the training technique known as <wordasword>sitting by
        Nelly</wordasword>, which involves looking over a
      colleague&apos;s shoulder in the office, lab, library, pub, or
      classroom, and absorbing all his or her bad habits.</para>
    <para>In the summer of 2001 I presented a short proposal on the
      marketing of <LaTeX/> to the annual conference of the <TeX/> Users
      Group held at the University of Delaware, and showed an example
      of a <ulink
        url="http://www.silmaril.ie/documents/latex-brochure/leaflet.pdf">draft 
        brochure</ulink> designed to persuade newcomers to try <LaTeX/>
      for their typesetting requirements. As a result of questions and
      suggestions, it was obvious that it needed to include a pointer
      to some documentation, and I agreed to make available a revised
      form of this document, expanded to be used outside the
      classroom, and to include those topics on which I have had most
      questions from users over the years.</para>
    <para>It turned out to mean a significant
      reworking of a lot of the material. Some of it appears in almost
      every other manual and book on <LaTeX/> but it is essential to
      the beginner and therefore bears repetition. Some of it appears
      other forms elsewhere, and is included here because it needs
      explaining better. And some of it appears nowhere else but this
      document. I took the opportunity to revise the structure of the
      training course in parallel with the book (expanding it from its
      original one day to two days), and to include a more
      comprehensive index. It is by no means perfect (in both senses),
      and I would be grateful for comments and corrections to be sent
      to me at the address given under the credits.</para>
    <para>I had originally hoped that the <LaTeX/> version of the
      document would be processable by any freshly-installed default
      <LaTeX/> system, but the need to include font samples which go
      well beyond the default installation, and to use some packages
      which the new user is unlikely to have installed, means that
      this document itself is not really a simple piece of <LaTeX/>,
      however simply it may describe the process itself.</para>
    <para>However, as the careful reader will have already noticed,
      the master source of the document is not maintained in <LaTeX/>
      but in <acronym ref="XML"></acronym>. A future task is therefore
      to compare the packages required with those installed by
      default, and flag portions of the document requiring additional
      features so that an abbreviated version can be generated which
      can be guaranteed to process even with a basic <LaTeX/>
      installation.</para>
    <para id="docs">If you are just starting with <LaTeX/>, at an early
      opportunity you should buy or borrow a copy of <citetitle
        ref="latexbook"></citetitle> which is the original
      author&apos;s manual. More advanced users should get the
      <citetitle ref="companion"></citetitle> or one of its
      successors. In the same series there are also the <citetitle
        ref="graphicscomp"></citetitle> and the <citetitle
        ref="webcomp"></citetitle>. Mathematical users might want to
      read <citetitle ref="mathguide"></citetitle>.</para>
  </preface>
  <preface id="preface">
    <title>Preface</title>
    <para>Many people discover <LaTeX/> after
      years of struggling with wordprocessors and desktop publishing
      systems, and are amazed to find that <TeX/> has been around for
      over 25 years and they hadn&apos;t heard of it. It&apos;s not a
      conspiracy, just <quote>a well-kept secret known only to a few
        million people</quote>, as one anonymous user has put
      it.</para>
    <para>Perhaps a key to why it has remained
      so popular is that it removes the need to fiddle with the
      formatting while you write. Although playing around with fonts
      and formatting is attractive to the newcomer, it is completely
      counter-productive for the serious author or editor who wants to
      concentrate on <emphasis>writing</emphasis>&mdash;ask any
      journalist or professional writer.</para>
    <para>A few years ago a new <LaTeX/> user expressed concern on
      the <ulink url="comp.text.tex"></ulink> newsgroup about
      <quote>learning to write in <LaTeX/></quote>. <ulink
        url="news:comp.text.tex/MPG.18d82140d65ddc5898968c@news.earthlink.net">Some 
        excellent advice</ulink> was posted in response to this query,
      which I reproduce with permission below [the bold text is my
      emphasis]:</para>
    <blockquote condition="news" citedoc="heller">
      <para>No, the harder part might be <emphasis>writing</emphasis>,
        period.  <TeX/>/<LaTeX/> is actually easy, once you relax and
        stop worrying about appearance as a be-all-and-end-all. Many
        people have become <wordasword>Word Processing
          Junkies</wordasword> and <emphasis role="high">no longer
          <wordasword>write</wordasword> documents, they
          <wordasword>draw</wordasword> them</emphasis>, almost at the
        same level as a pre-literate 3-year old child might pretend to
        <wordasword>write</wordasword> a story, but is just creating a
        sequence of pictures with a pad of paper and box of
        <productname>Crayola</productname>s&mdash;this is perfectly
        normal and healthy in a 3-year old child who is being
        creative, but is of questionable usefulness for, say, a grad
        student writing a Master&apos;s or PhD thesis or a business
        person writing a white paper, &etc;  For this reason,
        <emphasis>I</emphasis> strongly recommend
        <emphasis>not</emphasis> using any sort of fancy <acronym
          ref="GUI"></acronym>&nbsp;<wordasword>crutch</wordasword>.
        Use a plain vanilla text editor and treat it like an
        old-fashioned typewriter.  Don&apos;t waste time playing with
        your mouse.</para>
      <para>Note: I am <emphasis>not</emphasis> saying that you should
        have no concerns about the appearance of your document, just
        that you should <emphasis>write</emphasis> the document
        (completely) first and tweak the appearance
        later&hellip;<emphasis>not</emphasis> [spend time on] lots of
        random editing in the bulk of the document itself.</para>
    </blockquote>
    <para>Learning to write well can be hard, but authors shouldn&apos;t
      have to make things even harder for themselves by using
      manually-driven systems which break their concentration every
      few seconds for some footling adjustment to the appearance,
      simply because the software is incapable of doing it right by
      itself.</para>
    <para id="mathtex"><personname id="knuth">
        <firstname>Don</firstname>
        <surname>Knuth</surname>
      </personname> originally wrote <TeX/> to typeset mathematics for
      the second edition of his master-work <citetitle
	ref="aocs"></citetitle>, and it remains pretty much the only
      typesetting program to include fully-automated mathematical
      formatting done the way mathematicians want it. But he also
      published a booklet called <citetitle
	ref="mathwrite"></citetitle> which shows how
      important it is to think about what you write, and how the
      computer should be able to help, not hinder.</para>
    <para>And <TeX/> is much more than math:
      it&apos;s a programmable typesetting system which can be used
      for almost any formatting task, and <LaTeX/> has made it usable by
      almost anyone. Professor Knuth generously placed the entire system in the
      public domain, so for many years there was no publicity of the
      commercial kind which would have got <TeX/> noticed outside the
      technical field.</para>
    <para>Nowadays, however, there are many companies
      selling <TeX/> software or services,<footnote>
        <para>See, for example, the list of <TeX/> vendors on <xref
        linkend="vendors" role="page"/>, and the list of consultants
          published by <acronym ref="TUG"></acronym>.</para>
      </footnote> dozens
      of publishers accepting <LaTeX/> documents for
      publication, and hundreds of thousands of users using <LaTeX/>
      for millions of documents.<footnote>
        <para>A guesstimate. With free software it&apos;s impossible
          to tell how many people are using it, but it&apos;s a
          <emphasis>lot</emphasis>.</para>
      </footnote></para>
    <para>To count yourself as a <TeX/> or <LaTeX/> user, visit the
      <TeX/> Users Group&apos;s
      <wordasword><TeX/> Counter</wordasword> web site 
      (and get a nice certificate!).</para>
    <para>There is occasionally some confusion among newcomers between
      the two main programs, <TeX/> and <LaTeX/>:</para>
    <itemizedlist>
      <listitem>
        <para><TeX/> is a typesetting program, originally written by
          Prof Knuth at Stanford around 1978. It implements a
          macro-driven typesetters&apos; programming language of some
          300 basic operations and it has formed the core of many
          other <acronym id="DTP">desktop publishing</acronym>
          systems. Although it is still possible to write in the raw
          <TeX/> language, you need to study it in depth, and you need
          to be able to write macros (subprograms) to perform even the
          simplest of repetitive tasks.</para>
      </listitem>
      <listitem>
        <para><LaTeX/> is a user interface for <TeX/>, designed by
          <personname id="lamport">
            <firstname>Leslie</firstname>
            <surname> Lamport</surname>
          </personname> at <acronym id="DEC">Digital Equipment
            Corporation</acronym> in 1985 to automate all the common
          tasks of document preparation.  It provides a simple way for
          authors and typesetters to use the power of <TeX/> without
          having to learn the underlying language. <LaTeX/> is the
          recommended system for all users except professional
          typographic programmers and computer scientists who want to
          study the internals of <TeX/>.</para>
      </listitem>
    </itemizedlist>
    <para>Both <TeX/> and <LaTeX/> have been
      constantly updated since their inception.  Knuth has now frozen
      development of the <TeX/> engine so that users and developers
      can have a virtually bug-free, rock-stable platform to work
      with.<footnote>
        <para>Knuth still fixes bugs, although the chances of finding
          a bug in <TeX/> these days approaches zero.</para>
      </footnote> Typographic programming development continues with
      the <acronym id="NTS">New Typesetting System</acronym>, planned
      as a successor to <TeX/>. The <LaTeX/>3 project has taken over
      development of <LaTeX/>, and the current version is
      <LaTeXe/>, which is what we are concentrating on here. Details
      of all developments can be had from the <acronym
        ref="TUG"></acronym> at <ulink
        url="http://www.tug.org"></ulink></para>
    <sidebar id="myths">
      <title>Debunking the mythology</title>
      <para>Naturally, over all the years, a few myths have grown up
        around <LaTeX/>, often propagated by people who should know
        better. So, just to clear up any potential
        misunderstandings&hellip;</para>
      <variablelist>
        <varlistentry>
          <term>MYTH: <quote><LaTeX/> has only got one
              font</quote></term>
          <listitem>
            <para>Most <LaTeX/> systems can use any OpenType,
              TrueType, Adobe (<trademark>PostScript</trademark>)
              Type1 or Type3, or &metafont; font. This is more than
              most other known typesetting system.
              <LaTeX/>&apos;s default font is Computer Modern (based
              on Monotype Series&nbsp;8: see
              <xref linkend="fontable-mf"/>), not Times Roman, and some
              people get upset because it <quote>looks
                different</quote> to Times. Typefaces differ:
              that&apos;s what they&apos;re for&mdash;get used to it.</para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>MYTH: <quote><LaTeX/> isn&apos;t <acronym
                ref="WYSIWYG"></acronym></quote></term>
          <listitem>
            <para>Simply not true. <acronym ref="DVI"></acronym>
              and <acronym ref="PDF"></acronym> preview is better
              <acronym ref="WYSIWYG"></acronym> than any wordprocessor
              and most <acronym ref="DTP"></acronym> systems. What
              people mean is that <LaTeX/>&apos;s typographic display
              is asynchronous with the edit window. This is only true
              for the default <acronym ref="CLI"></acronym>
              implementations. See <xref
                linkend="synchro"/> for details of synchronous
              versions.</para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>MYTH: <quote><LaTeX/> is obsolete</quote></term>
          <listitem>
            <para>Quite the opposite: it&apos;s under constant
              development, with new features being added almost
              weekly. Check the <ulink url="comp.text.tex"
                type="news:"></ulink> for messages about recent
              uploads to <acronym ref="CTAN"></acronym>. It&apos;s
              arguably more up-to-date than most other systems:
              <LaTeX/> had the Euro (&EUR;) before anyone else, it had
              Inuktitut typesetting before the Inuit got their own
              province in Canada, and it still produces better
              mathematics than anything else.</para>
          </listitem>
        </varlistentry>
      </variablelist>
    </sidebar>
    <sidebar id="myths2">
      <title>More mythology</title>
      <variablelist>
        <varlistentry>
          <term>MYTH: <quote><LaTeX/> is a Unix system</quote></term>
          <listitem>
            <para>People are also heard saying:
              <quote><LaTeX/> is a Windows system</quote>,
              <quote><LaTeX/> is a Mac system</quote>, &etc;,
              &etc;&nbsp;<foreignphrase>ad nauseam</foreignphrase>.
              <TeX/> systems run on almost every computer in use, from
              some of the biggest supercomputers down to handhelds
              (<acronym ref="PDA"></acronym>s like the Sharp
              <productname>Zaurus</productname>). That includes
              Windows and Linux PCs, Macs, and all other Unix systems.
              If you&apos;re using something <TeX/> doesn&apos;t run
              on, it must be either incredibly new, incredibly old, or
              unbelievably obscure.</para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>MYTH: <quote><LaTeX/> is <wordasword>too
                difficult</wordasword></quote></term>
          <listitem>
            <para>This has been heard from
              physicists who can split atoms; from mathematicians who
              can explain why <inlineequation>
                <m:csymbol>&pi;</m:csymbol>
              </inlineequation> exists; from business people who can
              read a balance sheet; from historians who can grasp
              Byzantine politics; from librarians who can understand
              LoC and MARC; and from linguists who can decode Linear
              <quote>B</quote>. It&apos;s nonsense: most people grasp
              <LaTeX/> in 20 minutes or so. It&apos;s not rocket
              science (or if it is, I know any number of unemployed
              rocket scientists who will teach it to you).</para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>MYTH: <quote><LaTeX/> is <wordasword>only for
                scientists and
                mathematicians</wordasword></quote></term>
          <listitem>
            <para>Untrue. Although it grew up
              in the mathematical and computer science fields, two of
              its biggest growth areas are in the humanities and
              business, especially since the rise of <acronym
                ref="XML"></acronym> brought new demands for automated
              web-based typesetting.</para>
          </listitem>
        </varlistentry>
      </variablelist>
    </sidebar>
  </preface>
  <chapter id="get">
    <title>Installing <TeX/> and <LaTeX/></title>
    <indexterm>
      <primary sortas="tetex">te<TeX/></primary>
    </indexterm>
    <indexterm>
      <primary sortas="fptex">fp<TeX/></primary>
    </indexterm>
    <indexterm>
      <primary sortas="texniccenter"><TeX/>nicCenter</primary>
    </indexterm>
    <indexterm>
      <primary sortas="miktex">MiK<TeX/></primary>
    </indexterm>
    <indexterm>
      <primary>Linux</primary>
    </indexterm>
    <indexterm>
      <primary>Unix</primary>
    </indexterm>
    <indexterm>
      <primary>Microsoft Windows</primary>
    </indexterm>
    <indexterm>
      <primary>Mac OS X</primary>
    </indexterm>
    <indexterm>
      <primary>Apple Mac</primary>
    </indexterm>
    <indexterm>
      <primary>OS X</primary>
    </indexterm>
    <para>This course is based on using one of
      the following distributions of <TeX/> on the 2004 <TeX/>
      Collection DVD or the 2003 <TeX/> Live CD:</para>
    <variablelist>
      <varlistentry>
        <term>te<TeX/></term>
        <listitem>
          <para>for Linux and other Unix-like systems, including Mac
            OS&thinsp;X (<personname id="esser">
              <firstname>Thomas</firstname>
              <surname>Esser</surname>
            </personname>);</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>pro<TeX/>t</term>
        <listitem>
          <para>for Microsoft Windows (<personname id="tf">
              <firstname>Thomas</firstname>
              <surname>Feuerstack</surname>
      </personname>), based on <personname id="cs">
              <firstname>Christian</firstname>
              <surname>Schenk</surname></personname>&apos;s
            Mik<TeX/>;</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>fp<TeX/></term>
        <listitem>
          <para>for Microsoft Windows (<personname id="popineau">
              <firstname>Fabrice</firstname>
              <surname> Popineau</surname>
            </personname>) from the 2003 <TeX/> Live CD.</para>
        </listitem>
      </varlistentry>
    </variablelist>
    <para>Many other implementations of <TeX/>,
        such as <personname id="tk">
        <firstname>Tom</firstname>
        <surname>Kiffe</surname>
      </personname>&apos;s CMac<TeX/> for the Apple Macintosh, can be
      downloaded from <acronym ref="CTAN"></acronym>. <LaTeX/> is
      included with all modern distributions of <TeX/>.</para>
    <para>The <TeX/> Collection CD is issued
      annually on behalf of most of the local <TeX/> user groups
      around the world (see <ulink
        url="http://www.tug.org/lugs.html"></ulink> for addresses),
      and edited by <personname id="sr">
        <firstname>Sebastian</firstname>
        <surname>Rahtz</surname>
      </personname>, <personname id="kb">
        <firstname>Karl</firstname>
        <surname>Berry</surname>
      </personname>, <personname id="ml">
        <firstname>Manfred</firstname>
        <surname>Lotz</surname>
      </personname>, and the authors of the software mentioned above.
      These people give an enormous amount of their personal time and
      energy to building and distributing these systems, and they
      deserve the thanks and support of the user community for all
      they do.</para>
    <para>There are many other distributions of <LaTeX/> both free and
      commercial, as described in <xref
        linkend="intro"/>: they all process <LaTeX/> identically, but
      there are some differences in size, speed, packaging, and (in
      the case of commercial distributions) price, support, and extra
      software provided.</para>
    <para>One final thing before we start: publicly-maintained
      software like <TeX/> is updated faster than commercial software,
      so <emphasis>always check to see if there is a more recent
        version of the installation</emphasis>. See <xref
        linkend="latest"/> for more details.</para>
    <sect1 id="editdis">
      <title>Editing and display</title>
      <para>When you install <LaTeX/> you will
        have the opportunity to decide <orderedlist>
          <listitem>
            <para>which plain-text editor[s] you want to use to create
              and maintain your documents</para>
          </listitem>
          <listitem>
            <para>which preview programs you want to use to see your
              typesetting</para>
          </listitem>
        </orderedlist>. This isn&apos;t much use to you if you&apos;re
        unfamiliar with editors and previewers, so have a look at the
        table below, and maybe flip ahead to <xref
          linkend="editors"/> for a moment, where there are
        descriptions and screenshots.</para>
      <para>The best bet is probably to install more than one&mdash;if
        you&apos;ve got the disk space&mdash;or maybe all of them, because
        you can always delete the ones you don&apos;t like.</para>
      <variablelist>
        <varlistentry>
          <term>Editors</term>
          <listitem>
            <para>There is a wide range of editors available: probably
              no other piece of software causes more flame-wars in
              Internet and other discussions than your choice of
              editor. It&apos;s a highly personal choice, so feel free
              to pick the one you like. My personal biases are
              probably revealed below, so feel equally free to ignore
              them.</para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>Previewers</term>
          <listitem>
            <para>For displaying your
              typesetting before printing, you will need a previewer.
              All systems come with a <acronym ref="DVI"></acronym>
              previewer for standard <LaTeX/>,
              but if you are intending to produce industry-standard
              <trademark>PostScript</trademark> or <acronym
                ref="PDF"></acronym> (Adobe Acrobat) files you will
              need a previewer for those formats.
              <productname>GSview</productname> displays both
              <trademark>PostScript</trademark> and <acronym
                ref="PDF"></acronym> files;
              <productname>xpdf</productname> and Adobe&apos;s own
              <productname>Acrobat Reader</productname> just display
              <acronym ref="PDF"></acronym> files.</para>
          </listitem>
        </varlistentry>
      </variablelist>
      <para>For brief details of some of the most popular editors used
	for <LaTeX/>, see <xref linkend="editors"/>.</para>
<!--
      <informaltable id="editchoice">
        <tgroup cols="2">
          <colspec colsep="flush" align="left"/>
          <colspec colwidth="3.75in" colsep="flush" align="justify"/>
          <thead>
            <row>
              <entry>Editor</entry>
              <entry>Comments</entry>
            </row>
          </thead>
          <tbody>
            <row>
              <entry><productname>Emacs</productname></entry>
              <entry>Large and powerful. Needs learning (a life-skill
                like <LaTeX/>) but well worth the effort.
                Multi-platform, it opens and edits anything and
                everything, with special features for <LaTeX/> &etc;,
                and good productivity tools for writers. Open
                Source.</entry>
            </row>
            <row>
              <entry><productname>WinShell</productname></entry>
              <entry>Simple but effective beginner&apos;s tool for
                MS-Windows. Runs <LaTeX/> &etc;&nbsp;with toolbar
                buttons. Very easy to use, small footprint.
                Free.</entry>
            </row>
            <row>
              <entry><productname><TeX/>nicCenter</productname></entry>
              <entry>Integrated development environment for <LaTeX/>
                with extensive toolbar and documentation support.
                Free, MS-Windows only.</entry>
            </row>
            <row>
              <entry><productname>WinEdt</productname></entry>
              <entry>Comprehensive editor aimed at heavy <LaTeX/>
                usage, with toolbar, productivity features, and good
                support. Configurable for almost any distribution of
                <TeX/> (with some effort). Free trial, licensable
                after 1&nbsp;month, MS-Windows only.</entry>
            </row>
            <row>
              <entry><productname>PFE</productname></entry>
              <entry>Popular general-purpose editor for MS-Windows: no
                special <LaTeX/> features but a very configurable
                launcher and command-line controller. Free but no
                longer developed.</entry>
            </row>
            <row>
              <entry><productname>BBedit</productname></entry>
              <entry>Plain-text editor for Apple Macs, heavily used
                for text applications. <TeX/> distributions for the
                Mac come with their own editor, but this is a popular
                and useful tool. 30-day demo.</entry>
            </row>
            <row>
              <entry><productname>vi</productname></entry>
              <entry>Standard editor on Unix systems. Dual-mode editor
                (separate text-entry and command modes), now showing
                its age. Adored by devotees, detested by others, just
                like
                <productname>Emacs</productname>&nbsp;&smiley;.&nbsp;
                Free.</entry>
            </row>
            <row>
              <entry><productname>tkcEditor</productname></entry>
              <entry>Multipurpose text editor for handheld computers
                from TheKompany.com. Good editing features and
                syntactic coloration of text. &dollar;14.95 for
                Zaurus systems.</entry>
            </row>
          </tbody>
        </tgroup>
      </informaltable>
-->
      <warning id="pdfurl">
        <title>Additional downloads</title>
        <para>For licensing reasons, the
          <productname>GSview</productname> PostScript/PDF previewer,
          the <productname>Acrobat Reader</productname> PDF previewer,
          and the <productname>WinEdt</productname> editor could not
          be distributed on the 2003 CDs. In those cases you have to
          download and install them separately.</para>
        <itemizedlist>
          <listitem>
            <para><productname>GSview</productname> is available for
              all platforms from <ulink
                url="http://www.ghostscript.com/gsview/index.htm"></ulink>
              (on Unix and VMS systems it&apos;s also available as
              <productname>GhostView</productname> and
              <productname>gv</productname>: see <ulink
                url="http://www.cs.wisc.edu/~ghost/"></ulink>)</para>
          </listitem>
          <listitem>
            <para><productname>Acrobat Reader</productname> (all
              platforms) can be downloaded from <ulink
                url="http://www.adobe.com/products/acrobat/readstep2.html"></ulink></para>
          </listitem>
          <listitem>
            <para><productname>WinEdt</productname> (Microsoft Windows
              only) comes from <ulink
                url="http://www.winedt.com"></ulink></para>
          </listitem>
        </itemizedlist>
      </warning>
    </sect1>
    <sect1 id="lininst">
      <title>Installation for Linux and Unix</title>
      <para>Make sure your system libraries and utilities are up to
        date. If you are using Red Hat Linux, use
        <productname>yum</productname> or
        <productname>up2date</productname> to download and install
        updates. For Debian and other distributions, use
        <productname>apt-get</productname> or similar. On Red Hat
        systems, remove any RPM version of te<TeX/> and associated
        utilities which may have been
        preinstalled, in order to avoid version conflicts.</para>
      <para>If you are installing <TeX/> Live to a new partition, and
        you have the opportunity to reformat the partition before use,
        use <productname>mkfs</productname> with a granularity as
        small as it will go (usually 1024 bytes). This avoids the
        partition running out of inodes because <TeX/> uses very large
        numbers of very small files.</para>
      <para>Plan the installation carefully if you are installing for
        multiple users (a shared machine): read <xref
      linkend="pkginst"/> for some comments on where to put additional
        files downloaded later, and see the FAQ on the same topic at
        <ulink
          url="http://www.tex.ac.uk/cgi-bin/texfaq2html?label=wherefiles"></ulink></para>
      <para>Above all, <acronym id="RTFM">Read The Fine
          Manual</acronym>. The documentation is in
        <filename>live.html</filename> and
        <filename>live.pdf</filename> on the disk in the directory
        <filename>texlive2004/texmf-doc/doc/english/texlive-en/</filename></para>
      <figure>
        <title><TeX/> Live installation manual</title>
        <graphic fileref="tlcdoc" format="EPS" width="75%"/>
      </figure>
      <programlisting remap="commandchars=\\\{\}">
# cd /<userinput>mnt/cdrom</userinput>/texlive2004
# sh install-tl.sh
      </programlisting>
      <para>The installer runs in a shell window, so it can be done
	even from headless systems (those with no X Window client),
	but it does need to be installed as root if you want to stick
	with the default directory locations or install it system-wide
	for multiple users. To install, just type the commands shown
	above.</para>
      <para>The options are mostly self-explanatory, and beginners
        should pick the recommended scheme and leave all other
        settings at their defaults. The character-driven interface
        lets you browse around the settings changing things and
        looking at options before you commit to installing
        anything.</para>
      <figure>
        <title>The Unix installation program</title>
        <programlisting width="scriptsize"><![CDATA[
==================> TeX Live installation procedure <=================

===> Note: Letters/digits in <angle brackets> indicate menu items <===
===>       for commands or configurable options                   <===

    Proposed platform: Intel x86 with GNU/Linux
    <P> over-ride system detection and choose platform
    <B> binary systems:         1 out of 10
    <S> Installation scheme (scheme_recommended)
    [customizing installation scheme:
       <C> standard collections   <L> language collections]
    20 out of 75, disk space required: 246857 kB
    <D> directories:
      TEXDIR      (The main TeX directory)        : /usr/TeX
      TEXMFLOCAL  (Directory for local styles etc): /usr/TeX/texmf-local
      VARTEXMF    (Directory for local config)    : /usr/TeX/texmf-var
    <O> options:
       [ ] alternate directory for generated fonts ()
       [ ] create symlinks in standard directories
       [ ] do not install macro/font doc tree
       [ ] do not install macro/font source tree
    <R> do not install files, set up to run off CD or DVD
    <I> start installation
    <H> help,  <Q> quit

Enter command:
          ]]></programlisting>
      </figure>
      <para><quote>Collections</quote> (the <varname>C</varname> and
	<varname>L</varname> options) are groups of <LaTeX/> packages
	that you can include or exclude. It&apos;s best to leave this
	alone unless you know you need something specific. The only
	options I sometimes set are under <varname>O</varname>: the
	<quote>alternate directory for generated fonts</quote> may
	need to be on a different partition for performance reasons on
	a shared system; and I always select <quote>create symlinks in
	  standard directories</quote> so that the system works
	immediately after the post-installation configuration (after
	installation, run <productname>texconfig</productname> to
	adjust your local settings.</para>
      <figure>
        <title>Running the post-installation program
          <productname>texconfig</productname></title>
        <graphic fileref="texconfig" format="EPS" width="75%"/>
      </figure>
      <para>Note that the Linux/Unix installation does not install any
        editors: it is assumed you can do this yourself from your
        distribution&apos;s standard package system (most likely
        you will already be using <productname>Emacs</productname> or
        <productname>vi</productname> anyway).</para>
    </sect1>
    <sect1 id="macinst">
      <title>Installation for Apple Mac</title>
      <para>This is exactly the same interface as for the Linux/Unix
        installation. You need the <productname>bash</productname>
      shell (see the warning in the manual for users of older systems).</para>
      <para>There is a choice of graphical editors for the Mac: two
        are included on the DVD, <productname><TeX/>Shop</productname>
        and <productname>I<TeX/>Mac</productname>, but they need to be
        installed separately, after installing <TeX/>.</para>
    </sect1>
    <sect1 id="wininst">
      <title>Installation for Microsoft Windows</title>
      <figure>
        <title><TeX/> Collection 2004 DVD</title>
        <graphic fileref="tcdvddir" width="75%"/>
      </figure>
      <para>Before you install <TeX/>, make
        sure you have enough disk space: the default installation
        takes about 350Mb on a modern filesystem. The installation
        assumes you have a fully updated version of Windows, so visit
        the Microsoft Web site first (<ulink
          url="http://www.microsoft.com/"></ulink>) and click on
        <productname>Windows Update</productname>. Select and install
        all the relevant updates for your operating system (Windows
        95, 98, ME, 2000, NT, or XP). You should be doing this
        regularly anyway, to keep your system healthy. You may want to
        run <productname>ScanDisk</productname> and give your hard
        disks a full surface check. <TeX/> consists of a very large
        number of quite small files, so it&apos;s important that your
        disk is in good order.</para>
<!--
      <para>Newcomers should note that the
        downloadable <productname>WinEdt</productname> comes
        preconfigured for MiK<TeX/>) and needs some careful
        reconfiguration to work with the 2003 <TeX/> Live
        installation. I recommend that beginners
        use <productname>WinShell</productname> to start with and
        graduate to <productname>Emacs</productname> or
        <productname><TeX/>nicCenter</productname> when they become
        more expert. Many other people will doubtless tell you
        different&hellip;</para>
-->
      <para>When you insert the distribution
        DVD or CD, it should start the setup program automatically. If
        you have auto-run turned off, open <productname>My
          Computer</productname>, double-click on the DVD or CD drive,
        and then double-click <productname>Autorun</productname> to
        start the setup program.<footnote>
          <para>Some builds of Windows seem to have a bug that stops
            <productname>Autorun</productname> starting the
            installation. In that case (for the <TeX/> Collection 2004
            DVD) double-click <filename>Setup.exe</filename> instead,
            or (for the <TeX/>
            Collection 2003 CD) go to the <filename>tpm</filename>
            folder and double-click on
            <filename>TeXSetup.exe</filename>.</para>
        </footnote></para>
      <sect2>
        <title>pro<TeX/>t (<TeX/> Collection 2004)</title>
        <para>For pro<TeX/>t from the <TeX/>
          Collection DVD, follow the instructions in the PDF
          documentation which opens automatically when you start
          the setup.</para>
        <figure>
          <title>pro<TeX/>t comes with its own installation
            guide</title>
          <graphic fileref="tcptpdf" width="50%"/>
        </figure>
        <para>The documentation contains links (in large blue type)
          that you click on in sequence to run the installation
          process. (This is actually very good: everything worked
          first time when I did it on XP.) Basically, you need to
          install <orderedlist>
            <listitem>
              <para><productname>MIK<TeX/></productname></para>
            </listitem>
            <listitem>
              <para><emphasis
                role="high">either</emphasis>&nbsp;<productname>WinEdt</productname>
                (with or without some of its add-ons) <emphasis
                role="high">or</emphasis>&nbsp;<productname><TeX/>nicCenter</productname></para> 
            </listitem>
            <listitem>
              <para><productname>GhostScript</productname> and
                <productname>GSview</productname></para>
            </listitem>
          </orderedlist>.</para>
	<warning>
	  <para>You only need to install items <xref linkend="nldi"/>
	    to <xref linkend="td"/> if you install
	    <productname>WinEdt</productname>.</para>
	</warning>
        <figure floatstyle="b" id="tcpt1">
          <title>First document in
            <productname><TeX/>nicCenter</productname></title>
          <graphic fileref="tcptfirstdoc" width="75%"/>
        </figure>
        <procedure>
          <step>
            <title>Install <productname>MIK<TeX/></productname></title>
            <para><productname>pro<TeX/>t</productname> uses the
              <productname>MIK<TeX/></productname> distribution as its
              core, a long-established and popular distribution for
              Windows.</para>
          </step>
          <step>
            <title>Install <productname>WinEdt</productname></title>
            <para>This is optional: it&apos;s a good editor,
            especially for the heavy user of a
            <productname>MIK<TeX/></productname>-based system. This is
            a free month&apos;s trial&mdash;after that it reminds you to cough
            up and register.</para>
          </step>
          <step id="nldi">
            <title>Install the <productname>WinEdt</productname> New <LaTeX/> Document Interface</title>
            <para>Optional again, and only applicable if you installed
              <productname>WinEdt</productname> anyway. It lets you
            save commonly-used document settings for use in other
            documents of the same type.</para>
          </step>
          <step>
            <title>Install the <productname>WinEdt</productname>
            Graphics Interface</title>
            <para>Another optional add-on for
            <productname>WinEdt</productname> to provide drag-and-drop
            graphics insertion.</para>
          </step>
          <step id="td">
            <title>Install the <productname>WinEdt</productname> Table
            Designer</title>
            <para>Last optional add-on for
            <productname>WinEdt</productname>, providing a new table editor.</para>
          </step>
          <step>
            <title>Install <productname><TeX/>nicCenter</productname></title>
            <para>This is a free equivalent to
            <productname>WinEdt</productname>. The interface is
              slightly different (see <xref linkend="tcpt1"/>) but it
            is becoming very popular.</para>
          </step>
          <step>
            <title>Install <productname>GhostScript</productname> and
              <productname>GSview</productname></title>
            <para>These are essential for viewing the PostScript and
              PDF output, especially if you don&apos;t have any other PDF
              viewer installed.</para>
          </step>
        </procedure>
        <para>You get a choice of editors,
          but the one which features in
          <productname>pro<TeX/>t</productname> is 
          <productname><TeX/>nicCenter</productname>. This is an
          <acronym id="IDE">Integrated Development
            Environment</acronym> which lets you manage all the files
          related to each document. In many cases, of course, you&apos;ll
          only have one (the text itself) but if you are working with
          anything beyond simple articles, you&apos;ll probably have
          illustrations (images or diagrams), and possibly separate
          chapter files for larger documents, plus indexes,
          glossaries, bibliographies, etc. I recommend that you create
          a new project for each new document, even if it&apos;s a
          single-file article, as I did for the example in <xref
          linkend="tcpt1"/>.</para>
      </sect2>
      <sect2>
        <title><TeX/> Live (<TeX/> Collection 2003)</title>
        <procedure>
          <title>Once the installation program is running:</title>
          <step>
            <title><LaTeX/></title>
            <para>Install <LaTeX/> itself from the
            <guimenu>TeXLive Software</guimenu><guimenuitem>Install on
            Hard Disk</guimenuitem> menu. If you&apos;re new to
            <LaTeX/>, pick Quick Install on the following screen. This
              gives you everything you need to get started, and
              doesn&apos;t ask any questions, it just installs it all
              straight away.</para>
            <para>If you&apos;re installing under Windows NT, 2000, or
              XP, you may want to click on the option to install for
              all users if you have other users on your system.</para>
            <para>If you want to use <productname>Emacs</productname>
              as your editor, click the option for Xem<TeX/>
              Support.<footnote>
                <para>Note this unfortunate choice of name is nothing
                  to do with <personname id="em">
                    <firstname>Eberhard</firstname>
                    <surname>Matthes</surname>
                </personname>&apos; MS-DOS implementation of <TeX/>
                  called em<TeX/>&mdash;the <quote>Xem</quote> is
                  short for <productname>Xemacs</productname>.</para>
              </footnote></para>
          </step>
          <step>
            <title>Emacs</title>
            <para>After installation, right-click and drag
              <filename>Xemacs.exe</filename> from the
              <filename>C:\Program Files\TeXLive\bin\win32</filename>
              folder out onto your desktop and let go, then pick
              <quote>Create Shortcut</quote>. This places
              <productname>Emacs</productname> on your desktop for
              easy access.</para>
          </step>
          <step>
            <title>WinShell and WinEdt</title>
            <para>If you want to install
              <productname>WinShell</productname>, run the installer
              program in the <filename>support/winshell</filename>
              directory. For <productname>WinEdt</productname> you
              must go to their Web site (<ulink
                url="http://www.winedt.com/"></ulink>) for a
              downloadable version.</para>
            <para>You don&apos;t have to install just one editor: if
              you&apos;ve got the space, install them all so you can
              try them out. You can always uninstall the ones you
              don&apos;t want afterwards.</para>
          </step>
          <step>
            <title>GSView</title>
            <para>Ghostscript is installed automatically, but for
              <productname>GSView</productname> you need to go to
              <ulink
                url="http://www.cs.wisc.edu/~ghost/gsview/"></ulink>,
              and download the most recent version.</para>
            <para>If you use <productname>GSView</productname>, please
              register your copy with Ghostgum, Pty.&nbsp;(<ulink
                url="http://www.ghostgum.com.au/"></ulink>).</para>
          </step>
        </procedure>
        <warning>
          <para>Please read the <TeX/> Live update pages at <ulink
              url="http://www.tug.org/texlive/bugs.html"></ulink> for
            details of any changes since the disks were released, and
            download and install any additional software
            required.</para>
        </warning>
      </sect2>
      <sect2>
        <title>Installation problems</title>
        <para>It&apos;s always annoying when a program that&apos;s supposed to
        install painlessly causes trouble, and none the more so when
        everyone else seems to have been able to install it without
          problems. I&apos;ve installed <TeX/> hundreds of times and very
        rarely had any difficulties, but these are a few of the
        occasions when I did.</para>
        <variablelist>
          <varlistentry>
            <term>Bad hard disks</term>
            <listitem>
              <para>As recommended in <xref linkend="wininst"/>, run a
                scan and defragmentation of your hard disk[s] before
                you start. It should take under an hour on a modern
                machine unless you have a very large disk, and it may
                need overnight on an older machine. Clean your CD or DVD
                drive if it&apos;s been in heavy use. <TeX/> uses a very
                large number of very small files, so there is a lot of
                disk activity during an installation. As also
                recommended in <xref linkend="lininst"/>, if you have
                the chance to reformat the hard disk, pick the
                smallest granularity (cluster size) possible.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>Registry errors</term>
            <listitem>
              <para>This only affects Microsoft Windows users. The
                Registry is where Microsoft want software companies
                automatically to store details of all the programs you
                install.  Unfortunately the Registry is grossly abused
                by marketing departments to try and foist undesirable
                links on you, the user.  You will see this with many
                commercial programs, where a particular type of file
                you&apos;ve been able to double-click on for years suddenly
                runs a different program.  Some programs install
                obsolete or broken copies of program libraries (DLL
                files), overwriting ones which were working perfectly.
                Worse, the viruses, trojans, and worms which typically
                infect unprotected Windows systems can leave unwanted
                links to web pages, or change some of the ways in
                which Windows operates. The overall effect can be that
                the whole machine slows down, or that files which are
                expected to do one thing do another.  The best
                solution is a thorough Registry clean-out, using one
                of the many programs available for the purpose.</para>
            </listitem>
          </varlistentry>
          <varlistentry id="latest">
            <term>Use the latest versions</term>
            <listitem>
              <para>Before installing, check the <acronym
                  ref="CTAN"></acronym> web site (<ulink
                  url="http://www.ctan.org/"></ulink> for any updated
                copy of the installation program. This is called
                <filename>install-tl.sh</filename> for Linux and Mac
                systems, and <filename>Setup.exe</filename> for
                Microsoft Windows (on the <TeX/> Collection 2003 CD it
                was called <filename>TeXSetup.exe</filename>).  Just
                occasionally a bug slips through onto the production
                CD or DVD, and although it&apos;s always fixed and notified
                on <ulink url="comp.text.tex" type="news:"></ulink>,
                that&apos;s a high-volume newsgroup and even the sharpest
                eyes may miss an announcement.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>Stick to the defaults</term>
            <listitem>
              <para>Unless you&apos;re a computer scientist or a software
                engineer, I suggest you never change or fiddle with
                the default directories for installation.  I know some
                of them look odd, but they&apos;re that way for a purpose,
                especially when it comes to avoiding directories will
                spaces in their names, like the notorious
                <literal>C:\Program Files</literal>. Although most
                modern systems cope happily with spaces in filenames
                and directory names, they are usually A Bad Design
                Idea, and should be avoided like the plague (spaces
                are forbidden in web addresses for the same reason:
                the people who designed them knew the pitfalls). It
                may look snazzier to put the installation in
                <literal>My Cute Stuff</literal>, but please
                don&apos;t: you&apos;ll just make it harder to find, harder to
                fix problems, and more embarrassing if you have to
                explain it to someone else trying to help you.</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </sect2>
    </sect1>
  </chapter>
  <chapter id="plaintext">
    <title>Using your editor <?LaTeX \newline{}?>to create documents</title>
    <para><LaTeX/> documents are all <firstterm
    id="plain-text">plain-text</firstterm> files.<footnote>
        <para><wordasword>Plain-text</wordasword>
	  originally meant just the 95 printable characters of the
	  <acronym id="ASCII">American Standard Code for Information
	    Interchange</acronym>&mdash;see <xref
	    linkend="asciicodes"/>&mdash;but now more commonly includes
	  both these <emphasis>and</emphasis> the relevant 8-bit
	  characters from <emphasis>one</emphasis> (only) character
	  set such as ISO-8859-1 (Western Latin&ndash;1) or
	  ISO-8859-15 (Western Latin plus the Euro sign). These are
	  international standards which work everywhere: you should
	  avoid using manufacturers&apos; proprietary character sets
	  like Microsoft Windows&ndash;1252 or Apple Macintosh
	  Roman&ndash;8, because they may make your documents unusable
	  on some other systems.</para>
      </footnote>  You can edit them with any editor, and transfer
      them to any other computer system running <LaTeX/> and they will
      format exactly the same. Because they are plain text they cannot
      corrupt your system, as they cannot be used for hiding or
      transporting virus infections as binary wordprocessor files can.
      Everything you can see is in the file and everything in the file
      is there for you to see: there is nothing hidden or secret and
      there are no manufacturers&apos; proprietary
      <wordasword>gotchas</wordasword> like suddenly going out of date
      with a new version.</para>
    <sect1 id="mark-up">
      <title>Markup</title>
      <para>In a <LaTeX/> document, you type your text along with
	<firstterm id="markup">markup</firstterm> which identifies the
	important parts of your document by name, for example
	<quote>title</quote>, <quote>section</quote>,
	<quote>figure</quote>, &etc; <LaTeX/> does all the formatting
	for you automatically, using the markup to guide its internal
	rules and external stylesheets for typesetting.</para>
      <sidebar>
	<title>Markup</title>
	<para>This is a term from printing, and originally meant the
	  notes on how to lay the document out, or the instructions
	  which a proofreader might add during correction. It now also
	  means instructions or descriptions added to a computer
	  document to act as guidelines for identification or
	  formatting. Markup has been around for
	  <emphasis>ages</emphasis>.</para>
	<informaltable rowsep="4pt">
	  <tgroup cols="3">
	    <colspec colsep="flush" align="left"/>
	    <colspec colname="b" colwidth=".75in" align="left"/>
	    <colspec align="right" colsep="flush"/>
	    <tbody>
	      <row>
		<entry><graphic fileref="55-1L-part"
		    width="2in"/></entry>
		<entry spanname="2"><citetitle show="title"
		    ref="tain"></citetitle></entry>
	      </row>
	      <row>
		<entry><graphic fileref="23-part"
		    width="2in"/></entry>
		<entry spanname="2"><citetitle show="title"
		    ref="varmints"></citetitle></entry>
	      </row>
	      <row>
		<entry><literal>.h1 Interest Rates</literal></entry>
              <entry>Runoff</entry>
              <entry><foreignphrase>c.</foreignphrase>1970</entry>
	      </row>
	      <row>
		<entry><literal>\section{Interest
		    Rates}</literal></entry>
		<entry><LaTeX/></entry>
              <entry>1984</entry>
	      </row>
	      <row>
		<entry><literal><![CDATA[<sec><ttl>Interest
		    Rates</ttl>...]]></literal></entry>
		<entry><acronym ref="SGML"></acronym></entry>
              <entry>1985</entry>
	      </row>
	      <row>
		<entry><literal><![CDATA[<H1>Interest
		    Rates</H1>]]></literal></entry>
		<entry><acronym ref="HTML"></acronym></entry>
              <entry>1991</entry>
	      </row>
	    </tbody>
	  </tgroup>
	</informaltable>
      </sidebar>
      <para>You do not need to format any of your text <emphasis>in
	  your editor</emphasis>, because <LaTeX/> does it
	all by itself when it typesets. You can of course regularise
	or neaten its appearance <emphasis>in your editor</emphasis>
	for ease of editing (for example, keeping each item in a list
	on a separate line), but this is not required.</para>
      <para>You will often hear <LaTeX/> markup referred to as
	<quote>commands</quote> or sometimes <quote>control
	  sequences</quote> (the proper <TeX/>nical term for them).
	For
	all practical purposes these terms all mean the same
	thing.</para>
      <para>This course assumes that users have one of
	<productname><TeX/>shell</productname>,
	<productname><TeX/>nicCenter</productname>,
	<productname>WinShell</productname>, or
	<productname>WinEdt</productname> (Windows only), or
	<productname>Emacs</productname> or <LyX/> (any platform)
	installed. These are discussed briefly in <xref
        linkend="editors"/>, and the menus and toolbars for running
      <LaTeX/> are explained in <xref
	  linkend="process"/>.</para>
    </sect1>
    <sect1 id="quickstart">
      <title>Quick start for the impatient</title>
      <para>If you already know all this stuff about editors and
        plain-text files and running programs, and you know your system
        is already correctly installed (including your editor),
        you&apos;d probably like to type something in and see <LaTeX/>
        do its job. If you don&apos;t, then skip forward to <xref
          linkend="commands"/> and read a bit more about <LaTeX/>
        first.</para>
          <figure id="sampledoc">
            <title>Sample document</title>
            <programlisting width="footnotesize">
\documentclass[12pt]{article}
\usepackage{palatino,url}
\begin{document}
\section*{My first document}

This is a short example of a \LaTeX\ document I wrote 
on \today. It shows a few simple features of automated 
typesetting, including

\begin{itemize}
\item setting the default font size to 12pt;
\item specifying `article' type for formatting;
\item using the Palatino typeface;
\item adding special formatting for URIs;
\item formatting a heading in `section' style;
\item using the \LaTeX\ logo;
\item generating today's date;
\item formatting a list of items;
\item centering and italicizing;
\item autonumbering the pages.
\end{itemize}

\subsection*{More information}

This example was taken from `Formatting Information',
which you can download from 
\url{http://www.ctan.org/tex-archive/info/beginlatex/}
and use as a teach-yourself guide.

\begin{center}
\textit{Have a nice day!}
\end{center}

\end{document}
            </programlisting>
          </figure>
      <procedure>
        <title>Up and running in a few minutes</title>
        <step>
          <title>Install the software</title>
          <para>Make sure you have a
            properly-installed <LaTeX/> system and a copy of a
            suitable editor.</para>
        </step>
        <step id="demodoc">
          <title>Create a sample document</title>
          <para>Open your editor and type in
            the text <emphasis>exactly</emphasis> as shown in <xref
          linkend="sampledoc"/>. Do <emphasis>not</emphasis> make any
            changes or miss anything out or add anything different at
            this stage.</para>
        </step>
        <step>
          <title>Save the document</title>
          <para>Save the document as
            <filename>demo.tex</filename></para>
        </step>
        <step>
          <title>Run <LaTeX/> or <productname>pdf<LaTeX/></productname></title>
          <para>Click on the <guiicon><LaTeX/></guiicon> or
	    <guiicon>pdf<LaTeX/></guiicon> toolbar icon or the
	    <guimenu><TeX/></guimenu><guimenuitem><TeX/>
	      File</guimenuitem> menu item; or type <literal>latex
	      demo</literal> or <literal>pdflatex demo</literal> in a
	    command window.</para>
        </step>
        <step>
          <title>Preview the typesetting</title>
          <para>Click on the <guiicon>DVI</guiicon> or
	    <guiicon>PDFview</guiicon> toolbar icon or the
	    <guimenu><TeX/></guimenu><guimenuitem><TeX/>
	      View</guimenuitem> menu item; or type your previewer
	    command in a terminal shell.</para>
          <para>(Note that there may be a pause the first time you use
	    your <acronym ref="DVI"></acronym> viewer, while <acronym
	      ref="WYSIWYG"></acronym> font files are
	    created.<footnote>
              <para><acronym ref="DVI"></acronym> previewers use their
		own font files specially created from the font
		outlines (TrueType, OpenType, PostScript, &metafont;,
		etc). The first time you use a font at a size not used
		before, there will be a second or two&apos;s pause
		while it gets created. The more you use <LaTeX/>, the
		less this
		happens.</para>
            </footnote>)</para>
        </step>
        <step>
          <title>Print it</title>
          <para>Click on the <guiicon>Print</guiicon> toolbar icon
            within the viewer, or use the
            <guimenu><TeX/></guimenu><guimenuitem><TeX/> Print</guimenuitem>
            menu item, or type
            <literal>dvips -f demo | lpr</literal>
            (Unix/Linux).</para>
        </step>
      </procedure>
      <para>If you encounter any errors, it means you
        <emphasis>do</emphasis> need to study this chapter after
        all!</para>
    </sect1>
    <sect1 id="editors">
      <title>Editors</title>
      <indexterm><primary>editors</primary></indexterm>
      <para>All the text of your documents can be typed into your
        <LaTeX/> document from a standard keyboard using any decent
	plain-text editor. However, it is more convenient to use an
	editor with special features to make using <LaTeX/> easier.
	Some of the most popular are
	<productname><TeX/>shell</productname>
	<productname>WinShell</productname>, <productname><TeX/>nic
	  Center</productname>, and <productname>WinEdt</productname>
	(Windows only); and <productname><LyX/></productname> and
	<productname>Emacs</productname> (all platforms).</para>
      <sect2>
	<title><LyX/></title>
	<figure id="lyxwin">
	  <title>The <LyX/> document editor</title>
	  <graphic fileref="lyx" width="75%"/>
	</figure>
	<para>The <LyX/> document editor (all platforms) is a special
	  case, as it uses the <acronym id="WYSIWYM">What You See Is
	    What You Mean</acronym> model of synchronous typographic
	  editing as opposed to <acronym id="WYSIWYG">What You See Is
	    What You Get</acronym>, and many users prefer this
	  interface (but see the reservations in <xref
	    linkend="sync"/>).</para>
	<para><LyX/> makes a strong case for using synchronous
	  typographical editing: it is possible to create even quite
	  large and complex documents without seeing a backslash very
	  often, although with math or complex macros there is
	  probably no way to avoid having to do some manual insertion
	  of
	  <LaTeX/> code.</para>
	<para>The free availability on multiple platforms makes this a
	  clear answer to the myth of <quote>having to edit like a
	    programmer</quote>, and as it is an Open Source project,
	  there is constant improvement, both to the facilities and to
	  the interface.</para>
	<para>Probably the only real reservation is that it does not
	  save native <LaTeX/> files by default. It uses its own
	  internal format, and it can export <LaTeX/> for use in other
	  editors, but the exported files are not designed for human
	  legibility, only for <LaTeX/> processing. In a co-operative
	  environment this would be a serious drawback, but for the
	  individual user this interface is an excellent tool.</para>
      </sect2>
      <sect2 id="texshell">
	<title><TeX/>shell</title>
	<figure id="texshellwin">
	  <title>The <TeX/>shell editor</title>
	  <graphic fileref="texshell" width="75%"/>
	</figure>
	<para>This is one of the simplest of all the plaintext Windows
	  editors, but it has most of the tools needed to begin with.
	  Sectioning, lists, and graphics can be inserted from the
	  menus, and there are buttons for running <LaTeX/> on the
	  open document and for previewing the typeset
	  document.</para>
	<para>The syntactic highlighting distinguishes between
	  commands and your text, and it comes with options for
	  spellchecking (you need to install
	  <productname>ispell</productname>), and for adding math,
	  Greek (math), and some symbol characters from a pickchart.
	  The typeset display is done using your installed <acronym
	    ref="DVI"></acronym> viewer (there is no provision for
	  <acronym ref="PDF"></acronym>, although as it is
	  configurable, that could probably be edited into the
	  menus).</para>
	<para>Download the <filename>.tar.gz</filename> file from <acronym
	    ref="CTAN"></acronym> in the
	  <filename>support/TeXshell/</filename> directory and unwrap
	  it into somewhere like <filename>C:\Program
	    Files\TeXshell\</filename>.<footnote>
	    <para>Yes, I know I said don't use directory names with
	      spaces in them&mdash;and so you shouldn&apos;t, for your
	<LaTeX/> documents&mdash;but Windows programs are usually safe
	      enough in them.</para>
	  </footnote> There is a <productname>tsconfig</productname>
	  program in the same directory on <acronym
	    ref="CTAN"></acronym>, which is designed to help with
	  reconfiguring <TeX/>shell.</para>
      </sect2>
      <sect2 id="winshell">
        <title>WinShell</title>
	<figure id="winshellwin">
	  <title>The WinShell editor</title>
	  <graphic fileref="winshell" width="75%"/>
	</figure>
        <para>This is another free Windows editor for beginners with
        <LaTeX/>. Despite its simplicity, it is capable of a
	  considerable amount of document management and assistance
	  with editing. As well as handling stand-alone <LaTeX/>
	  files, you can create a <quote>Project</quote> for larger
	  documents, which helps you keep track of additional files
	  like separate chapters, illustrations, diagrams, indexes,
	  &etc;</para>
	<para>You run <LaTeX/> direct from the toolbar icons or with
	  F-key shortcuts. Both standard <LaTeX/> and
	  <productname>pdf<LaTeX/></productname> are supported, as well
	  as creation and previewing of
	  <trademark>PostScript</trademark> and <acronym
	    ref="PDF"></acronym> output. There are additional toolbars
	  for math characters, and there is a <quote>Table
	    Wizard</quote> for handling tables. The syntax
	  highlighting distinguishes between commands (in blue) and
	  delimiters (in red), leaving your text in black.</para>
	<para>Download the
	  <filename>WinShell<userinput>nn</userinput>.exe</filename>
	  program (self-contained setup: the
	  <userinput>nn</userinput> changes with the version) from
	  <acronym ref="CTAN"></acronym> in the
	  <filename>systems/win32/winshell/</filename> directory and
	  double-click it to start the setup.</para>
      </sect2>
      <sect2 id="texniccenter">
        <title><TeX/>nicCenter</title>
	<figure id="texniccenterwin">
	  <title>The <TeX/>nicCenter editor</title>
	  <graphic fileref="texniccenter" width="75%"/>
	</figure>
        <para><productname><TeX/>nicCenter</productname> is a powerful
	  Windows editor suitable both for the beginner and the more advanced
	  user. Its <quote>Project</quote> environment keeps track of
	  multiple files, and the processing function (the bit which
	  actually runs <LaTeX/>, here called
	  <quote>Build</quote>) tries to ensure that all the files you
	  need for a large or complex document are in place before you
	  start typesetting, to avoid errors like missing
	  illustrations.</para>
	<para>It&apos;s a much more wordprocessor-like control
	  interface, with configurable toolbars and button-controls
	  for lists, math, tables, and previewing options.</para>
	<para>Download the
	  <filename>TXCSetup<userinput>xxx</userinput>.exe</filename>
	  program (self-contained setup: the
	  <userinput>xxx</userinput> bit changes with the version)
	  from <acronym ref="CTAN"></acronym> in the
	  <filename>systems/win32/TeXnicCenter/</filename> directory
	  and double-click it to start the setup.</para>
      </sect2>
      <sect2 id="winedt">
        <title>WinEdt</title>
        <figure id="winedtpic">
          <title>The <productname>WinEdt</productname> editor</title>
          <graphic fileref="winedt" width="75%"/>
        </figure>
        <para><productname>WinEdt</productname> is a highly
	  configurable plain-text editor for Windows. It comes with a
	  host of special functions and shortcuts for
        <TeX/> and <LaTeX/>, based on the Mik<TeX/> distribution. It
	  is supplied on the <TeX/> Collection 2004 DVD and the
	  <productname>pro<TeX/>t</productname> CD. You can also
	  download it from <ulink
	    url="http://www.winedt.com"></ulink>&mdash;in either case
	  there&apos;s a 1-month free trial, then it reminds you to
	  buy it.</para>
        <para><productname>WinEdt</productname> uses a built-in
	  toolbar of configurable buttons, preset for use with
	  <LaTeX/>, and it provides syntactic coloring of
          <LaTeX/> commands. Both the positioning and effect of the
	  buttons can be changed, using an editable file of icons and
	  a configuration panel. This flexibility lets you bind a
	  program and arguments (equivalent to a typed command) to a
	  particular icon.</para>
        <para>There are default buttons on the toolbar for one-click
	  typesetting, previewing, and
	  <trademark>PostScript</trademark> or <acronym
	    ref="PDF"></acronym> generation from <LaTeX/> documents,
	  and it manages multi-file document projects like most of the
	  other editors. <productname>Winedt</productname> is also
	  used by many people for normal plaintext file-editing tasks,
	  in preference to more limited programs like
	  <productname>Notepad</productname>. If you're using the
	  fp<TeX/> which came with the 2003 <TeX/>
	  Collection, some editing of the menus is required (explained
	  in the local installation document) because the default
	  setup is for
	  Mik<TeX/>/pro<TeX/>t.</para>
      </sect2>
      <sect2>
        <title>GNU Emacs</title>
        <figure>
          <title>Emacs editing <LaTeX/></title>
          <graphic fileref="emacs" width="75%"/>
        </figure>
        <para><productname>Emacs</productname> is a product of the
	  <acronym ref="GNU"></acronym> Project.<footnote>
            <para><quote><acronym id="GNU">GNU&apos;s Not
		  Unix</acronym></quote> is a project to make a
	      computing environment completely free of
	      restrictions.</para>
          </footnote>  Versions are available for all makes and models
	  of computer, and it has a <LaTeX/>-mode which provides
	  syntactic colouring (<wordasword>fontification</wordasword>
	  in <productname>Emacs</productname>-speak) and mouseclick
	  processing from a menu or toolbar.</para>
        <para><productname>Emacs</productname>
	  is a very large and powerful editor, with
	  <wordasword>modes</wordasword> (plug-ins) to handle almost
	  everything you do on a computer. Many users run
	  <productname>Emacs</productname> once on logging in, and
	  never leave it for the rest of the day&mdash;or month. As
	  well as edit, you can use it to read your mail, browse the
	  Web, read Usenet news, do wordprocessing and spreadsheets,
	  compile programs, help you write in any computer
	  language&mdash;including <acronym ref="XML"></acronym> and
          <LaTeX/>&mdash;and it provides a few games as well.</para>
        <para><productname>Emacs</productname>
	  knows about <LaTeX/> and how to process it, so it comes with
	  a menu full of <LaTeX/> operations to click on. If you are
	  editing complex documents with mathematics, there is a mode
	  (<productname>AUC<TeX/></productname>) which has even more
	  functionality. <LaTeX/> support is well-developed, and there
	  is a hierarchy of newsgroups for
	  <productname>Emacs</productname> support.</para>
        <para>Because <productname>Emacs</productname> runs on
	  Microsoft Windows, Macs, Linux, and most other platforms,
	  many <LaTeX/> users who have multiple machines (and those
	  who have multiple users to support) prefer it to other
	  editors because it provides the same environment regardless
	  of which platform they are using.</para>
	<para>It&apos;s sometimes criticised for a steep learning
	  curve, but in fact it&apos;s no worse in this respect than
	  any other editor, given the power that it provides, and it
	  is significantly better than most which lack many of the
	  authorial tools available in Emacs.</para>
      </sect2>
      <sect2>
	<title>Mac editors</title>
	<para>Mac users will be disappointed that I haven't included
	any of the Mac interfaces here. It's simple: I don't have a
	Mac right now to try them out on. I hope to remedy this for a
	future edition.</para>
      </sect2>
    </sect1>
    <sect1 id="commands">
      <title><LaTeX/> commands</title>
      <para id="bsol"><LaTeX/> commands all begin with a
        <firstterm id="backslash">backslash</firstterm>
        (<literal>\</literal>)<footnote>
          <para>Do not confuse the backslash 
            with the forward slash (<literal>/</literal>). They are
            two different characters. The forward slash is used on the
            Web and on Unix systems to separate directory names and
            filenames. The backslash is used in Microsoft Windows
            (only) for the same purpose, and in <LaTeX/> to begin a
            command.</para>
        </footnote> and are usually made up of lowercase
        letters only, for example:</para>
      <programlisting>
\tableofcontents
      </programlisting>
      <para>The
	<command>tableofcontents</command> command is an instruction
	to <LaTeX/> to insert the Table of Contents at this point. You
	would usually use this in a book or report (or perhaps a very
	long article) somewhere close to the beginning. You don&apos;t have
	to do anything else. Provided that you have used the
	sectioning commands described in <xref linkend="sections"/>,
	all the formatting and numbering for the Table of Contents is
	completely automated.</para>
      <sect2 id="simplecmd">
        <title>Simple commands</title>
        <para id="swallow">Simple one-word commands like
	  <command>tableofcontents</command> must be separated from
	  any following text with <firstterm
	    id="wsp">white-space</firstterm>. This means a
	  normal space, or a newline [linebreak] or a TAB character.
	  For example either of these two forms will work:</para>
        <programlisting>
\tableofcontents Thanks to Aunt Mabel for all her help 
with this book.
        </programlisting>
        <programlisting>
\tableofcontents
Thanks to Aunt Mabel for all her help with this book.
        </programlisting>
        <para>If you forget the white-space, as in the following
	  example, <LaTeX/> will try to read it as a command
	  called <literal>\tableofcontentsThanks</literal>. There&apos;s no
	  such command, of course, so <LaTeX/> will complain at you by
	  displaying an error message (see <xref linkend="undefcs"/>).</para>
        <programlisting>
\tableofcontentsThanks to Aunt Mabel for all her help 
with this book.
        </programlisting>
        <para><LaTeX/> swallows any white-space which follows a command
          ending in a letter. It does this automatically, so you
          don&apos;t get unwanted extra space in your typeset output,
          but it does mean that any simple command which ends in a
          letter and has no arguments (see below) must be followed by
          white-space before normal text starts again, simply to keep
          it separate from the text.</para>
      </sect2>
      <sect2 id="cmdargs">
        <title>Commands with arguments</title>
        <para>Many <LaTeX/> commands are followed by one or more
          <firstterm id="arguments">arguments</firstterm>, a term from
          the field of Computer Science, meaning information to be acted
          upon. Here are two examples:</para>
        <programlisting>
\chapter{Poetic Form}
\label{pform}
        </programlisting>
        <para>Such arguments always go in
        <literal>{</literal><firstterm id="curly">curly
            braces</firstterm><literal>}</literal> like
          those<indexterm>
            <primary>braces</primary>
            <see>curly braces</see>
          </indexterm> shown above. Be careful not to confuse the
          curly braces on your keyboard with round parentheses
          <literal>(&nbsp;)</literal>, square brackets
        <literal>[&nbsp;]</literal>, or angle brackets 
              <literal><![CDATA[<]]>&nbsp;></literal>. They are all
          different and they do different things.</para>
        <para>With commands that take arguments you do
          <emphasis>not</emphasis> need to use extra white-space after
          the command, because there is an argument following it
          which will keep it separate from any normal text with
          follows after that. The following is therefore perfectly
        correct (although unusual because it&apos;s harder to edit:
        normally you&apos;d leave a blank line between the chapter title or
        label and the start of the first paragraph).</para>
	<programlisting>
\chapter{Poetic Form}\label{pform}The shape of poetry 
when written or printed distinguishes it from prose.
	</programlisting>
      </sect2>
      <sect2 id="white-space">
        <title>White-space in <LaTeX/></title>
        <indexterm>
          <primary>white-space</primary>
        </indexterm>
        <para>In <LaTeX/> documents, all <emphasis>multiple</emphasis>
          spaces, newlines (linebreaks), and TAB characters are
          treated as if they were a <emphasis>single</emphasis> space
          or newline during typesetting. <LaTeX/> does its own spacing
          and alignment using the instructions you give it, so you
          have extremely precise control. You are therefore free to
          use extra white-space in your editor for optical ease and
          convenience when editing.</para>
        <para>
          The following is therefore exactly equivalent to the example
          in the preceding section:</para>
        <programlisting>
\chapter        {Poetic 
          Form}\label
            {pform}

The shape of poetry when written or printed 
distinguishes it from prose.
        </programlisting>
        <para>That is, it will get typeset exactly the same. In
          general, just leave a blank line between paragraphs and a
          single space between words and sentences. <LaTeX/> will take
          care of the formatting.</para>
      </sect2>
    </sect1>
    <sect1 id="specials">
      <title>Special characters</title>
      <indexterm>
        <primary>special characters</primary>
      </indexterm>
      <para>There are ten keyboard characters which have special
        meaning to <LaTeX/>, and cannot be used on their own except for
        the following purposes:</para>
      <informaltable colsep="1mm">
        <tgroup cols="4">
          <colspec align="center"/>
          <colspec align="left"/>
          <colspec align="center"/>
          <colspec align="center"/>
          <thead>
            <row>
              <entry>Key</entry>
              <entry>Meaning</entry>
              <entry colwidth="1.5in"><emphasis>If you need<?html
                  <br>?> the actual character<?html <br>?> itself,
                  type:</emphasis></entry>
              <entry>Character</entry>
            </row>
          </thead>
          <tbody>
            <row>
              <entry><keycap>&bsol;</keycap></entry>
              <entry>The command character</entry>
              <entry><command>textbackslash</command></entry>
              <entry>&bsol;</entry>
            </row>
            <row>
              <entry><keycap>&dollar;</keycap></entry>
              <entry>Math typesetting delimiter</entry>
              <entry><command>&dollar;</command></entry>
              <entry>&dollar;</entry>
            </row>
            <row>
              <entry><keycap>&percnt;</keycap></entry>
              <entry>The comment character</entry>
              <entry><command>&percnt;</command></entry>
              <entry>&percnt;</entry>
            </row>
            <row>
              <entry><keycap>&caret;</keycap></entry>
              <entry>Math superscript character</entry>
              <entry><command>&caret;</command></entry>
              <entry>&caret;</entry>
            </row>
            <row>
              <entry><keycap>&ampers;</keycap></entry>
              <entry>Tabular column separator</entry>
              <entry><command>&ampers;</command></entry>
              <entry>&ampers;</entry>
            </row>
            <row>
              <entry><keycap>&uline;</keycap></entry>
              <entry>Math subscript character</entry>
              <entry><command>&uline;</command></entry>
              <entry><literallayout role="_">\texttt{\_}</literallayout></entry>
            </row>
            <row>
              <entry><keycap>&tilde;</keycap></entry>
              <entry>Non-breaking space</entry>
              <entry><command>&tilde;</command></entry>
              <entry>&tilde;</entry>
            </row>
            <row>
              <entry><keycap>&hash;</keycap></entry>
              <entry>Macro parameter symbol</entry>
              <entry><command>&hash;</command></entry>
              <entry>&hash;</entry>
            </row>
            <row>
              <entry><keycap>&lbrace;</keycap></entry>
              <entry>Argument start delimiter</entry>
              <entry><command
                  userlevel="math">&lbrace;</command></entry>
              <entry><literallayout role="{">$\{$</literallayout></entry>
            </row>
            <row>
              <entry><keycap>&rbrace;</keycap></entry>
              <entry>Argument end delimiter</entry>
              <entry><command
                  userlevel="math">&rbrace;</command></entry>
              <entry><literallayout role="}">$\}$</literallayout></entry>
            </row>
          </tbody>
        </tgroup>
      </informaltable>
      <para>These characters were deliberately chosen, either because
	they are rare in normal text, or (in the case of &dollar;,
	&hash;, &ampers;, and &percnt;) they already had an
	established special meaning on computers as <firstterm
	  id="metacharacters">metacharacters</firstterm> (characters
	standing as symbols for something else) by the time <TeX/> was
	written, and it would have been misleading to choose
	others.</para>
      <sect2>
        <title>Using the special characters</title>
        <para>We have already seen (<xref linkend="bsol"/>) how
          to use the backslash to start a command, and curly braces to
        delimit an argument. The remaining special
        characters are:</para>
        <variablelist>
          <varlistentry>
            <term><keycap>&dollar;</keycap></term>
            <listitem>
              <para>Because of the special mathematical meaning
                <LaTeX/> uses for the dollar-sign on its own, if you
                want to print &dollar;35.99 you type
                <literal>\$35.99</literal></para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term><keycap>&percnt;</keycap></term>
            <listitem>
              <para id="comment">The <firstterm
                  id="commentchar">comment character</firstterm> makes
                <LaTeX/> ignore the remainder of the line in your
                document, so you can see it in your editor, but it
                will never get typeset. For example <literal 
role="line">Today's price per kilo is £22.70   % get Mike to update this</literal>
                <?LaTeX \\?>If you want to print 45&percnt; you need
                  to type <literal>45\%</literal></para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term><keycap>&caret;</keycap></term>
            <listitem>
              <para>The caret sign lets you type
                <literal>\(E=mc^2\)</literal> to get <inlineequation>
          <m:mtext>E=mc</m:mtext>
          <m:msup>
            <m:mtext>2</m:mtext>
          </m:msup>
                </inlineequation>. If you need the circumflex accent
                on a letter like ê, just type the letter or use the
                symbolic notation <literal>\^e</literal>.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term><keycap>&ampers;</keycap></term>
            <listitem>
              <para>The ampersand is used in tables to separate
		columns (see <xref linkend="tables"/>). If you want to
		print AT&ampers;T you need to type
		<literal>AT\&amp;T</literal>.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term><keycap>&uline;</keycap></term>
            <listitem>
              <para>The underscore lets you type
                <literal>\(r_2\)</literal> for <inlineequation>
                  <m:mtext>r</m:mtext>
                  <m:msub>
                    <m:mtext>2</m:mtext>
                  </m:msub>
                </inlineequation>. If you want to underline text
                (extremely rare in typesetting) see <xref
                linkend="uline"/>.</para>
            </listitem>
          </varlistentry>
          <varlistentry id="tilde">
            <term><keycap>&tilde;</keycap></term>
            <listitem>
              <para>The tilde prints as a space, but prevents a
		linebreak ever occurring at that point. It&apos;s often
		used between a person&apos;s initials and their surname, eg
		<literal>Prof D.E.~Knuth</literal></para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term><keycap>&hash;</keycap></term>
            <listitem>
              <para>If you want a
          <firstterm id="hash">hash mark</firstterm> (the
          <firstterm id="octothorpe">octothorpe</firstterm> or
                American number or <quote>pound</quote> [weight] sign)
                you type <literal>\#</literal>. For a pound
                (sterling)<indexterm><primary
                                 sortas="pound">£</primary></indexterm>
                sign &pound;, now nearly obsolete except in the UK and
                some of its former dependencies, use your
                <keycap>£</keycap> key or type
                <command>textsterling</command>.</para>
            </listitem>
          </varlistentry>
        </variablelist>
        <para>While we&apos;re on the subject of money, an unusual but
	  interesting serif-font Euro<indexterm>
            <primary sortas="euro">&euro;</primary>
          </indexterm> sign <format fontdefault="rm">&euro;</format>
	  is got with the <command>texteuro</command> command from the
	  <methodname>textcomp</methodname> package. The standard
	  sans-serif <format fontdefault="sf">&EUR;</format> needs the
	  <methodname>marvosym</methodname> package and is done with
	  the <command>EUR</command> command.<footnote>
            <para>The European Commission has specified that everyone
	      use the sans-serif design, even in serif text, but this
	      is amazingly ugly and most designers rightly ignore
	      it.</para>
          </footnote></para>
      </sect2>
    </sect1>
    <sect1 id="quotes">
      <title>Quotation marks</title>
      <indexterm>
        <primary>quotation marks</primary>
      </indexterm>
      <para>Do <emphasis>not</emphasis> use the unidirectional
        typewriter keyboard <keycap remap="tt">&quot;</keycap> key for quotation
        marks. Correct typographic quotes are got with the <keycap
          remap="tt">&grave;</keycap> key and the <keycap
          remap="tt">'</keycap> key, doubled if you want double
        quotes:</para>
      <informalexample>
        <programlisting condition="pcr">
He said, ``I'm just going out.''
        </programlisting>
        <para><format fontencoding="OT1" fontfamily="cmr">He said,
            &ldquo;I&apos;m just going out.&rdquo;</format></para>
      </informalexample>
      <para>This ensures you get real left-hand
	and right-hand (opening and closing) quotes (usually shaped
	like tiny
	<superscript>66</superscript>&nbsp;and&nbsp;<superscript>99</superscript> 
	or as symmetrically-balanced strokes). If you are using
	<productname>Emacs</productname> as your editor, the
	<keycap>&quot;</keycap> key is specially programmed in
	<LaTeX/>-mode to think for itself and produce correct <format
	  fontdefault="tt">&grave;&grave;</format> and
	<literal>''</literal> characters (so this is one occasion when
	you <emphasis>can</emphasis> use the <keycap>&quot;</keycap>
	key).</para>
      <warning>
        <para>If you are reading this in a
          browser, or if you have reprocessed the file using different
          fonts, it may not show you real quotes (some old browser
          fonts are defective) and the <command>thinspace</command>
          below may be too wide. Download the typeset (<acronym
            ref="PDF"></acronym>) version of this document to see the
          real effect.</para>
      </warning>
      <para id="thinspace">When typing one quotation inside another,
        there is a special command <command>thinspace</command> which
        provides just enough separation between double and single
        quotes (a normal space is too much and could allow an unwanted
        linebreak):</para>
      <informalexample>
        <programlisting condition="pcr">
He said, `Her answer was ``never''\thinspace'.
        </programlisting>
        <para>He said, &lsquo;Her answer was
          &ldquo;never&rdquo;&thinsp;&rsquo;.</para>
      </informalexample>
    </sect1>
    <sect1 id="accents">
      <title>Accents</title>
      <indexterm>
        <primary>accents</primary>
      </indexterm>
      <para>For accented letters in western
	European languages<footnote>
	  <para>ISO 8859-1 (Latin&ndash;1, Western European) to
	    8859-15 (includes the Euro).</para>
	</footnote>  or other Latin-alphabet character sets just use
	the accented keys on your keyboard&mdash;if you have the right
	ones. You must also tell <LaTeX/> what character repertoire
	(<wordasword>input encoding</wordasword>) you are using. You
	specify this by using the <methodname>inputenc</methodname>
	package<footnote><para>We haven&apos;t covered the use of
	    packages yet. Don&apos;t worry, see <xref linkend="packages"/>
	    if you&apos;re curious.</para></footnote> in your preamble
	with the relevant option. For example, to tell <LaTeX/> you
	will be typing ISO Latin&ndash;1 accented characters,
	use:</para>
      <programlisting>
\usepackage[latin1]{inputenc}
      </programlisting>
      <para>If you have a real Unicode editor, which lets you insert
	any letter or symbol from any language on the planet (for
	example, mixed European, Asian, and other languages), use
	<literal>utf8</literal> instead of <literal>latin1</literal>.
	The encoding definitions that are available on your system are
	in <filename>/texmf/tex/latex/base</filename> (all files
	ending in <filename>.def</filename>).</para>
      <sidebar id="keystrokes">
        <title>If you don&apos;t have accented letters</title>
        <para>This is for users whose keyboards do not have native
	  accent characters on them. See your Operating System manual
	  for full details. Here are two common examples:</para>
        <itemizedlist>
          <listitem>
            <para>Under Linux systems the letter
	      é is usually got with
              <keycombo>
                <keycap>AltGr</keycap>
                <keycap>;</keycap>
          </keycombo><keycap>e</keycap>. Refer to the
	      <productname>xkeycaps</productname> utility for a table
	      of key codes and combinations (get it from <ulink
		url="http://www.jwz.org/xkeycaps/"></ulink>).</para>
          </listitem>
          <listitem>
            <para>Under Microsoft Windows the letter é is got with
              <keycombo>
                <keycap>Ctrl</keycap>
                <keycap remap="tt">'</keycap>
          </keycombo><keycap>e</keycap> or by holding down the
	      <keycap>Alt</keycap> key and typing
	      <keycap>0</keycap><keycap>1</keycap><keycap>3</keycap><keycap>0</keycap> 
	      on the numeric keypad (<emphasis>not</emphasis> the top
	      row of shifted numerals). Refer to the
	      <productname>charmap</productname> utility for a table
	      of key codes and combinations (find it in the
	      <filename>C:\Windows</filename> folder).</para>
          </listitem>
        </itemizedlist>
      </sidebar>
      <para>If you don&apos;t have accented letter keys on your
	keyboard, you&apos;ll need to use your operating system&apos;s
	standard keyboard <keycap>Ctrl</keycap> or
	<keycap>Alt</keycap> key combinations to generate the
	characters (see <xref linkend="keystrokes"/>).</para>
      <para>If you cannot generate accented characters from your
	keyboard at all, or if you need additional accents or symbols
	which are not in any of the keyboard tables, you can use the
	symbolic notation in <xref linkend="accentcodes"/>. In fact,
	this can be used to put any accent over any letter: if you
	particularly want a &gtilde; you can have one with the command 
	<command>&tilde;</command><literal>g</literal> (and Welsh
	users can get &wcirc; with
	<command>&caret;</command><literal>w</literal>).</para>
      <para>If you use this symbolic method only, you do not need to
	use the <methodname>inputenc</methodname> package. Before the
	days of keyboards and screens with their own real accented
	characters, the symbolic notation was the
	<emphasis>only</emphasis> way to get accents, so you may come
	across a lot of older documents (and users!) using this method
	all the time: it does have the advantage in portability that
	the <LaTeX/> file remains plain <acronym
	  ref="ASCII"></acronym>, which will work on all machines
	everywhere, regardless of their internal encoding, and even
	with very old <TeX/> installations.<footnote>
	  <para>Remember not everyone is lucky enough to be able to
	    install new software: many users on corporate and academic
	    networks still have to use old versions of <TeX/> because
	    their system administrators are too busy to
	    install new ones.</para>
	</footnote></para>
      <table id="accentcodes">
	<title>Built-in <LaTeX/> accents</title>
        <tgroup cols="3">
          <colspec align="left"/>
          <colspec align="center"/>
          <colspec align="center"/>
          <thead>
            <row>
              <entry>Accent</entry>
              <entry>Example</entry>
              <entry>Characters to type</entry>
            </row>
          </thead>
          <tbody>
            <row>
              <entry>Acute (fada)</entry>
              <entry>é</entry>
              <entry><literal>\'e</literal></entry>
            </row>
            <row>
              <entry>Grave</entry>
              <entry>è</entry>
              <entry><literal>\`e</literal></entry>
            </row>
            <row>
              <entry>Circumflex</entry>
              <entry>ê</entry>
              <entry><literal>\^e</literal></entry>
            </row>
            <row>
              <entry>Umlaut or diæresis</entry>
              <entry>ë</entry>
              <entry><literal>\"e</literal></entry>
            </row>
            <row>
              <entry>Tilde</entry>
              <entry>&ntilde;</entry>
              <entry><literal>\~n</literal></entry>
            </row>
            <row>
              <entry>Macron</entry>
              <entry>&omacr;</entry>
              <entry><literal>\=o</literal></entry>
            </row>
            <row>
              <entry>Bar-under</entry>
              <entry><format lining="under"
		  condition="HTML">&ohbar;</format><format
              condition="LaTeX">&ohbar;</format></entry>
              <en