1 % \iffalse meta-comment
4 % The LaTeX3 Project and any individual authors listed elsewhere
7 % This file is part of the LaTeX base system.
8 % -------------------------------------------
10 % It may be distributed and/or modified under the
11 % conditions of the LaTeX Project Public License, either version 1.3c
12 % of this license or (at your option) any later version.
13 % The latest version of this license is in
14 % http://www.latex-project.org/lppl.txt
15 % and version 1.3c or later is part of all distributions of LaTeX
16 % version 2005/12/01 or later.
18 % This file has the LPPL maintenance status "maintained".
20 % The list of all files belonging to the LaTeX base distribution is
21 % given in the file `manifest.txt'. See also `legal.txt' for additional
24 % The list of derived (unpacked) files belonging to the distribution
25 % and covered by LPPL is defined by the unpacking scripts (with
26 % extension .ins) which are part of the distribution.
29 % Filename: usrguide.tex
31 \NeedsTeXFormat{LaTeX2e
}[1995/
12/
01]
33 \documentclass{ltxguide
}[2001/
05/
28]
35 \title{\LaTeXe~for authors
}
37 \author{\copyright~Copyright
1995--
2015,
\LaTeX3 Project Team.\\
49 \section{Introduction
}
51 Welcome to
\LaTeXe, the new standard version of the
\LaTeX{} Document
54 This
document describes how to take advantage of the new features of
55 \LaTeX, and how to process your old
\LaTeX{} documents with
56 \LaTeXe. However, this
document is only a brief introduction to the
57 new facilities and is intended for authors who are already familiar
58 with the old version of
\LaTeX{}. It is
\emph{not
} a reference manual
59 for
\LaTeXe{} nor is it a complete introduction to
\LaTeX.
61 It is somewhat of an historical
document now, since
\LaTeXe{} came into
64 \subsection[\LaTeXe---The new
\LaTeX~release
]
65 {\LaTeXe---The new
\LaTeX~release\\ (well, for more than
10 years now)
}
67 The previous version of
\LaTeX{} was known as
\LaTeX~
2.09. Over the
68 years many extensions have been developed for
\LaTeX. This is, of
69 course, a sure sign of its continuing popularity but it has had one
70 unfortunate result: incompatible
\LaTeX{} formats came into use at
71 different sites. This included `standard
\LaTeX~
2.09',
\LaTeX{} built
72 with the
\emph{New Font Selection Scheme
}~(
\NFSS),
\SLiTeX,
\AmSLaTeX,
73 and so on. Thus, to process documents from various places, a site
74 maintainer was forced to keep multiple versions of the
\LaTeX{}
75 program. In addition, when looking at a source file it was not always
76 clear for which format the
document was written.
78 To put an end to this unsatisfactory situation,
\LaTeXe{} has been
79 produced; it brings all such extensions back under a single format and
80 thus prevents the proliferation of mutually incompatible dialects of
81 \LaTeX~
2.09. With
\LaTeXe{} the `new font selection scheme' is
82 standard and, for example,
\textsf{amsmath
} (formerly the
\AmSLaTeX{}
83 format) or
\textsf{slides
} (formerly the
\SLiTeX{} format) are simply
84 extensions, which may be loaded by documents using the same base format.
86 The introduction of a new release also made it possible to add a small
87 number of often-requested features and to make the task of writing
88 packages and classes simpler.
90 \subsection{\LaTeX3---The long-term future of
\LaTeX}
93 \LaTeXe{} is the consolidation step in a comprehensive
94 reimplementation of the
\LaTeX{} system. The next major release of
95 \LaTeX{} will be
\LaTeX3, which will include a radical overhaul of the
96 document designers' and package writers' interface to
\LaTeX.
98 \LaTeX3 is a long-term research project but, until it is completed,
99 the project team are committed to the active maintenance of
\LaTeXe{}.
100 Thus the experience gained from the production and maintenance of
101 \LaTeXe{} will be a major influence on the design of
\LaTeX3.
102 A brief description of the project can be found in the
document
105 If you would like to support the project then you are welcome to send
106 donations to the
\LaTeX3 Project Fund; this has been set up to help
107 the research team by financing various expenses associated with this
108 voluntary work of maintaining the current
\LaTeX{} and developing
111 The fund is administered by The
\TeX{} Users Group and by various
112 local user groups. Information about making donations and joining
113 these groups is available from:
114 \begin{quote
}\small\label{addrs
}
115 \texttt{http://www.tug.org/lugs.html
}
118 The
\LaTeX3{} project has its home page
119 on the World Wide Web at:
121 http://www.latex-project.org/
123 This page describes
\LaTeX{} and the
\LaTeX3 project, and contains
124 pointers to other
\LaTeX{} resources, such as the user guides, the
125 \TeX{} Frequently Asked Questions, and the
\LaTeX{} bugs database.
127 Older articles covering aspects of the
\LaTeX3 project are also
128 available for anonymous ftp from the Comprehensive
\TeX{} Archive, in
133 The file |ltx3pub.bib| in that directory contains an abstract of each
136 \subsection{Overview
}
138 This
document contains an overview of the new structure and features
139 of
\LaTeX. It is
\emph{not
} a self-contained
document, as it contains
140 only the features of
\LaTeX{} which have changed since version
2.09.
141 You should read this
document in conjunction with an introduction to
146 \item[Section~
\ref{Sec:class+packages
}]
147 contains an overview of the new structure of
148 \LaTeX{} documents. It describes how classes and packages work and
149 how class and package options can be used. It lists the standard
150 packages and classes which come with
\LaTeX.
152 \item[Section~
\ref{Sec:commands
}] describes the new commands available
153 to authors in
\LaTeXe.
155 \item[Section~
\ref{Sec:
209}] shows how to process old
\LaTeX{}
156 documents with
\LaTeXe.
158 \item[Section~
\ref{Sec:problems
}] contains advice on dealing with
159 problems you may encounter in running
\LaTeXe.
160 It lists some error messages which are new in
\LaTeXe{} and
161 it describes some of the more common problems and how to cure them,
162 or where to find further information.
166 \subsection{Further information
}
168 For a general introduction to
\LaTeX, including the new features of
169 \LaTeXe, you should read
\emph{\LaTeXbook}
170 by Leslie Lamport~
\cite{A-W:LLa94
}.
172 A more detailed description of the new features of
\LaTeX, including an
173 overview of more than
200 packages and nearly
1000 ready to run examples, is
174 to be found in
\emph{\LaTeXcomp second edition
} by Frank Mittelbach and
175 Michel Goossens~
\cite{A-W:MG2004
}.
177 Packages and programs for producing and manipulating graphics are
178 discussed at length in
\emph{\LaTeXGcomp} by Michel Goossens,
179 Sebastian Rahtz and Frank Mittelbach~
\cite{A-W:GRM97
}.
181 Solutions for publishing with
\LaTeX{} on the World Wide Web are given
182 in
\emph{\LaTeXWcomp} by Michel Goossens and Sebastian
183 Rahtz~
\cite{A-W:GR99
}.
185 For more information about the many new
\LaTeX{} packages you should
186 read the package documentation, which should be available from the
187 same source as your copy of
\LaTeX.
189 There are a number of documentation files which accompany every copy
190 of
\LaTeX. A copy of
\emph{\LaTeX{} News
} will come out with each
191 six-monthly release of
\LaTeX; it will be found in the files
192 |ltnews*.tex|. The class- and package-writer's guide
\emph{\clsguide}
193 describes the new
\LaTeX{} features for writers of
document classes
194 and packages; it is in |clsguide.tex|. The guide
\emph{\fntguide}
195 describes the
\LaTeX{} font selection scheme for class- and
196 package-writers; it is in |fntguide.tex|. Support for Cyrillic languages
197 in
\LaTeX{} is described in
\emph{\cyrguide}.
199 The documented source code (from the files used to produce the kernel
200 format via |latex.ltx|) is now available as
201 \emph{The
\LaTeXe\ Sources
}.
]
202 This very large
document also includes an index of
203 \LaTeX{} commands. It can be typeset from the
\LaTeX{} file
204 |source2e.tex| in the |base| directory, using the source files and
205 the class file |ltxdoc.cls| from this directory.
207 For more information about
\TeX{} and
\LaTeX{}, please contact your
208 local
\TeX{} Users Group, or the international
\TeX{} Users Group (see
209 page
\pageref{addrs
}).
212 \section{Classes and packages
}
213 \label{Sec:class+packages
}
215 This section describes the new structure of
\LaTeX{} documents and the
216 new types of file:
\emph{classes
} and
\emph{packages
}.
218 \subsection{What are classes and packages?
}
220 The main difference between
\LaTeX~
2.09 and
\LaTeXe{} is in the
221 commands before |
\begin{document}|.
223 In
\LaTeX~
2.09, documents had
\emph{styles
},
224 such as
\textsf{article
} or
\textsf{book
}, and
\emph{options
},
225 such as
\textsf{twoside
} or
\textsf{epsfig
}.
226 These were indicated by the |
\documentstyle| command:
228 |
\documentstyle|
\oarg{options
}\arg{style
}
230 For example, to specify a two-sided article with encapsulated
231 PostScript figures, you said:
233 \documentstyle[twoside,epsfig
]{article
}
235 However, there were two different types of
document style option:
236 \emph{built-in options
} such as |twoside|; and
\emph{packages
} such as
237 |epsfig.sty|. These were very different, since any
\LaTeX{} document
238 style could use the
\textsf{epsfig
} package but only
document styles
239 which declared the
\textsf{twoside
} option could use that option.
241 To avoid this confusion,
\LaTeXe{} differentiates between built-in
242 options and packages. These are given by the new |
\documentclass| and
243 |
\usepackage| commands:
245 |
\documentclass|
\oarg{options
}\arg{class
} \\
246 |
\usepackage|
\oarg{options
}\arg{packages
}
248 For example, to specify a two-sided article with encapsulated
249 PostScript figures, you now write:
251 \documentclass[twoside
]{article
}
254 You can load more than one package with a single |
\usepackage|
255 command; for example, rather than writing:
258 \usepackage{multicol
}
262 \usepackage{epsfig,multicol
}
264 Note that
\LaTeXe{} still understands the
\LaTeX~
2.09 |
\documentstyle|
265 command. This command causes
\LaTeXe{} to enter
\emph{\LaTeX~
2.09
266 compatibility mode
}, which is described in Section~
\ref{Sec:
209}.
268 You should not, however, use the |
\documentstyle| command for new
269 documents because this compatibility mode is very slow and the new
270 features of
\LaTeXe{} are not available in this mode.
272 To help differentiate between classes and packages,
document classes
273 now end with |.cls| rather than |.sty|. Packages still end with
274 |.sty|, since most
\LaTeX~
2.09 packages work well with
\LaTeXe.
276 \subsection{Class and package options
}
278 In
\LaTeX~
2.09, only
document styles could have options such as
279 |twoside| or |draft|. In
\LaTeXe{}, both classes and packages are
280 allowed to have options. For example, to specify a two-sided article
281 with graphics using the |
dvips| driver, you write:
284 \documentclass[twoside
]{article
}
285 \usepackage[dvips]{graphics
}
287 It is possible for packages to share common options. For example,
288 you could, in addition, load the
\textsf{color} package by specifying:
290 \documentclass[twoside
]{article
}
291 \usepackage[dvips]{graphics
}
292 \usepackage[dvips]{color}
294 But because |
\usepackage| allows more than one package to be listed,
295 this can be shortened to:
297 \documentclass[twoside
]{article
}
298 \usepackage[dvips]{graphics,
color}
300 In addition, packages will also use each option given to
301 the |
\documentclass| command (if they know what to do with it), so you
304 \documentclass[twoside,
dvips]{article
}
305 \usepackage{graphics,
color}
307 Class and package options are covered in more detail in
308 \emph{\LaTeXcomp} and in
\emph{\clsguide}.
310 \subsection{Standard classes
}
312 The following classes are distributed with
\LaTeX:
315 \item[article
] The |article| class described in
\emph{\LaTeXbook}.
316 \item[book
] The |book| class described in
\emph{\LaTeXbook}.
317 \item[report] The |
report| class described in
\emph{\LaTeXbook}.
318 \item[letter
] The |letter| class described in
\emph{\LaTeXbook}.
319 \item[slides
] The |slides| class described in
\emph{\LaTeXbook},
321 \item[proc
] A
document class for proceedings, based on |article|.
322 Formerly the |proc| package.
323 \item[ltxdoc
] The
document class for documenting the
\LaTeX{}
324 program, based on |article|.
325 \item[ltxguide
] The
document class for
\emph{\usrguide} and
326 \emph{\clsguide}, based on |article|. The
document you are reading
327 now uses the |ltxguide| class. The layout for this class is likely
328 to change in future releases of
\LaTeX.
329 \item[ltnews
] The
document class for the
\emph{\LaTeX{} News
}
330 information sheet, based on |article|. The layout for this class
331 is likely to change in future releases of
\LaTeX.
333 \NEWfeature{1995/
12/
01}
334 This class is the bare minimum (
3 lines) that is needed in a
335 \LaTeX\ class file. It just sets the text width and height, and
336 defines |
\normalsize|. It is principally intended for debugging
337 and testing
\LaTeX\ code in situations where you do not need to
338 load a `full' class such as |article|. If, however, you are
339 designing a completely new class that is aimed for documents with
340 structure radically different from the structure supplied by the
341 article class, then it may make sense to use this as a base and add
342 to it code implementing the required structure, rather than
343 starting from |article| and modifying the code there.
346 \subsection{Standard packages
}
349 The following packages are distributed with
\LaTeX:
352 \NEWfeature{1994/
12/
01}
353 This package provides the |
alltt| environment, which is like
354 the |verbatim| environment except that |\|, |
{|, and |
}|
355 have their usual meanings. It is described in |
alltt.dtx| and
357 \item[doc
] This is the basic package for typesetting the documentation
358 of
\LaTeX{} programs. It is described in |doc.dtx| and in
360 \item[exscale
] This provides scaled versions of the math extension
361 font. It is described in |exscale.dtx| and
\emph{\LaTeXcomp}.
362 \item[fontenc] This is used to specify which font encoding
\LaTeX{}
363 should use. It is described in |ltoutenc.dtx|.
365 \NEWfeature{1994/
12/
01}
366 This package defines the |
\graphpaper| command; this
367 can be used in a |picture| environment.
368 \item[ifthen
] Provides commands of the form `if
\dots then do
\dots
370 It is described in |ifthen.dtx| and
\emph{\LaTeXcomp}.
372 \NEWfeature{1994/
12/
01}
373 This is used to specify which input encoding
\LaTeX{} should use.
374 It is described in |
inputenc.dtx|.
375 \item[latexsym
] \LaTeXe{} no longer loads the
\LaTeX{} symbol font by
376 default. To access it, you should use the |latexsym| package. It
377 is described in |latexsym.dtx| and in
\emph{\LaTeXcomp}; see also
378 Section~
\ref{Sec:problems
}.
379 \item[makeidx
] This provides commands for producing indexes. It is
380 described in
\emph{\LaTeXbook} and in
\emph{\LaTeXcomp}.
381 \item[newlfont
] This is used to emulate the font commands of
382 \LaTeX~
2.09 with the New Font Selection Scheme. It is described in
384 \item[oldlfont
] This is used to emulate the font commands of
385 \LaTeX~
2.09. It is described in
\emph{\LaTeXcomp}.
387 This causes the argument of each |
\index| command to
388 be printed on the page where it occurs.
389 It is described in
\emph{\LaTeXbook}.
390 \item[syntonly
] This is used to process a
document without
391 typesetting it. It is described in |syntonly.dtx| and in
393 \item[tracefnt
] This allows you to control how much information about
394 \LaTeX's font loading is displayed. It is described in
398 \subsection{Related software
}
400 \NEWdescription{1998/
12/
01}
401 The following software should be available from the same distributor
402 as your copy of
\LaTeXe. You should obtain at least the
403 \textsf{graphics
} and
\textsf{tools
} collections in order to have all
404 the files described in
\emph{\LaTeXbook}. The |amsmath| package (part
405 of
\textsf{amslatex
} and formerly known as |amstex|)
406 and
\textsf{babel
} are also mentioned in the list
407 of `standard packages' in section C
.5.2 of that book.
409 \item[amslatex
] Advanced mathematical typesetting from the American
410 Mathematical Society. This includes the |amsmath| package; it
411 provides many commands for typesetting mathematical formulas of
412 higher complexity. It is produced and supported by the American
413 Mathematical Society and it is described in
\emph{\LaTeXcomp}.
414 \item[babel
] This package and related files support typesetting in
415 many languages. It is described in
\emph{\LaTeXcomp}.
417 \NEWfeature{1998/
12/
01}
418 Everything you need (except the fonts themselves) for
419 typesetting with Cyrillic fonts.
420 \item[graphics
] This includes the |graphics| package which
421 provides support for the inclusion and transformation of graphics,
422 including files produced by other software. Also included, is the
423 |
color| package which provides support for typesetting in colour.
424 Both these packages are described in
\emph{\LaTeXbook}.
425 \item[psnfss
] Everything you need (except the fonts themselves) for
426 typesetting with a large range of Type~
1 (PostScript) fonts.
427 \item[tools
] Miscellaneous packages written by the
\LaTeX3
430 These packages come with documentation and each of them is also
431 described in at least one of the books
\emph{\LaTeXcomp} and
434 \subsubsection{Tools
}
436 This collection of packages includes, at least, the following (some
437 files may have slightly different names on certain systems):
441 Extended versions of the environments |array|, |tabular|
442 and |tabular*|, with many extra features.
444 \NEWfeature{1996/
12/
01}
445 Enables the use of certain algebraic notation when specifying
446 values for lengths and counters.
448 Alignment on `decimal points' in tabular entries. Requires the
451 Adds `large delimiters' around arrays. Requires |array|.
453 Finer control over horizontal rules in tables. Requires |array|.
455 Multi-page tables. (Does not require |array|, but it uses the
456 extended features if both are loaded.)
458 Defines a |tabularx| environment that is similar to |tabular*|
459 but it modifies the column widths, rather than the inter-column
460 space, to achieve the desired table width.
462 Place text after the current page.
464 Access bold math symbols.
466 Extended version of the |enumerate| environment.
468 Package and test file for producing `font samples'.
470 Place all footnotes in the right-hand column in two-column mode.
472 Indent the first paragraph of sections, etc.
474 Show the page layout defined by the current
document class.
476 Typeset text in columns, with the length of the columns
479 Preload fonts using the old internal font names of
\LaTeX~
2.09.
480 See Section~
\ref{Sec:oldinternals
}.
482 Selective handling of package options. (Used by the rawfonts
485 Prints the `keys' used by |
\label|, |
\ref|, |
\cite| etc.; useful
488 Flexible declaration of `theorem-like' environments.
490 `Smart' handling of page references.
492 Flexible extension of the verbatim environment.
494 Cross reference other `external' documents.
496 `Smart space' command that helps you to avoid the common mistake
497 of missing spaces after command names.
504 This section describes the new commands available in
\LaTeXe.
505 They are covered in more detail in
\emph{\LaTeXbook} and in
508 \subsection{Initial commands
}
510 Initial commands can appear only before the |
\documentclass|
514 |
\begin{filecontents
}|
\arg{file-name
} \\
519 The |filecontents| environment is intended for bundling within a
520 single
document file the contents of packages, options, or other
521 files. When the
document file is run through
\LaTeXe{} the body of
522 this environment is written verbatim (preceded by a comment line) to a
523 file whose name is given as the environment's only argument. However,
524 if that file already exists then nothing happens except for an
527 Only normal ASCII text characters (
7-bit visible text) should be
528 included in a |filecontents| environment. Anything else, such as tab
529 characters, form-feeds or
8-bit characters, should not be included in a
530 |filecontents| environment.
532 Tabs and form feeds produce a warning, explaining that they are turned
533 into spaces or blank lines, respectively.
534 What happens to
8-bit characters depends on the
\TeX{} installation and
535 is in general unpredictable.
537 The |filecontents| environment is used for including
\LaTeX{} files.
538 For other plain text files (such as Encapsulated PostScript files),
539 you should use the |filecontents*| environment which does not add a
542 These environments are allowed only before |
\documentclass|. This
543 ensures that any packages that have been bundled in the
document are
546 \subsection{Preamble commands
}
549 The changes to the preamble commands are intentionally designed to make
550 \LaTeXe{} documents look clearly different from old documents. The
551 commands should be used only before |
\begin{document}|.
554 |
\documentclass|
\oarg{option-list
} \arg{class-name
}
558 This command replaces the
559 \LaTeX~
2.09 command |
\documentstyle|.
561 There must be exactly one |
\documentclass| command in a
document; and
562 it must come after the |filecontents| environments, if any, but before
565 The
\m{option-list
} is a list of options, each of which may modify the
566 formatting of elements which are defined in the
\m{class-name
} file,
567 as well as those in all following |
\usepackage| commands (see
570 The optional argument
\m{release-date
} can be used to specify the
571 earliest desired release date of the class file; it should contain a
572 date in the format
\textsc{yyyy/mm/dd
}. If a version of the class
573 older than this date is found, a warning is issued.
575 For example, to specify a two-column article, using a version of
576 |article.cls| released after June
1994, you specify:
578 \documentclass[twocolumn
]{article
}[1994/
06/
01]
582 |
\documentstyle|
\oarg{option-list
} \arg{class-name
}
585 This command is still supported for compatibility with old files. It
586 is essentially the same as |
\documentclass| except that it invokes
587 \emph{\LaTeX~
2.09 compatibility mode
}. It also causes any options in
588 the
\m{option-list
} that are not processed by the class file to be
589 loaded as packages after the class has been loaded. See
590 Section~
\ref{Sec:
209} for more details on
\LaTeX~
2.09 compatibility
594 |
\usepackage|
\oarg{option-list
} \arg{package-name
} \oarg{release-date
}
597 Any number of |
\usepackage| commands is allowed. Each package file
598 (as denoted by
\m{package-name
}) defines new elements (or modifies
599 those defined in the class file loaded by the
\m{class-name
} argument
600 of the |
\documentclass| command). A package file thus extends the
601 range of documents which can be processed.
603 The
\m{option-list
} argument can contain a list of options, each of
604 which can modify the formatting of elements which are defined in this
605 \m{package-name
} file.
607 As above,
\m{release-date
} can contain the earliest desired release
608 date of the package file in the format
\textsc{yyyy/mm/dd
}; if an
609 older version of the package is found, a warning is issued.
611 For example, to load the |graphics| package for the |
dvips| driver,
612 using a version of |graphics.sty| released after June
1994, you write:
614 \usepackage[dvips]{graphics
}[1994/
06/
01]
616 Each package is loaded only once. If the same package is requested
617 more than once, nothing happens in the second or following attempt
618 unless the package has been requested with options that were not given
619 in the original |
\usepackage|. If such extra options are specified
620 then an error message is produced. See Section~
\ref{Sec:problems
} how
621 to resolve this problem.
623 As well as processing the options given in the
\m{option-list
} of the
624 |
\usepackage| command, each package processes the
625 \m{option-list
} of the |
\documentclass| command as well. This
626 means that any option which should be processed by every package (to
627 be precise, by every package that specifies an action for it) can be
628 specified just once, in the |
\documentclass| command, rather than
629 being repeated for each package that needs it.
635 If this command is placed in the preamble then a list of the files
636 read in (as a result of processing the
document) will be displayed
637 on the terminal (and in the log file) at the end of the run. Where
638 possible, a short description will also be produced.
640 \NEWdescription{1995/
12/
01}
641 \emph{Warning
}: this command will list only files which were read
642 using
\LaTeX{} commands such as |
\input|
\arg{file
} or
643 |
\include|
\arg{file
}. If the file was read using the primitive
\TeX{}
644 syntax |
\input |
\emph{file
} (without |
{ }| braces around the file name)
645 then it will not be listed; failure to use the
\LaTeX{} form with the
646 braces can cause more severe problems, possibly leading to overwriting
647 important files, so
\textbf{always put in the braces
}.
651 |
\setcounter{errorcontextlines
}|
\arg{num
}
654 \TeX~
3 introduced a new primitive |
\errorcontextlines| which controls
655 the format of error messages.
\LaTeXe\ provides an interface to this
656 through the standard |
\setcounter| command. As most
\LaTeX\ users do
657 not want to see the internal definitions of
\LaTeX\ commands each time
658 they make an error,
\LaTeXe{} sets this to $-
1$ by default.
660 \subsection{Document structure
}
662 The |book|
document class introduces new commands to indicate
665 |
\frontmatter| \\ |
\mainmatter| \\ |
\backmatter|
667 These commands indicate the beginning of the front matter (title page,
668 table of contents and prefaces), main matter (main text) and back
669 matter (bibliography, indexes and colophon).
671 \subsection{Definitions
}
673 In
\LaTeX, commands can have both mandatory and optional arguments,
676 \documentclass[11pt
]{article
}
678 the |
11pt| argument is optional, whereas the |article| class name is
681 In
\LaTeX~
2.09 users could define commands with arguments, but these
682 had to be mandatory arguments. With
\LaTeXe, users can now define
683 commands and environments which also have one optional argument.
686 |
\newcommand|
\arg{cmd
} \oarg{num
} \oarg{default
} \arg{definition
} \\
687 |
\newcommand*|
\arg{cmd
} \oarg{num
} \oarg{default
} \arg{definition
} \\
688 |
\renewcommand|
\arg{cmd
} \oarg{num
} \oarg{default
} \arg{definition
} \\
689 |
\renewcommand*|
\arg{cmd
} \oarg{num
} \oarg{default
} \arg{definition
}
692 These commands have a new, second, optional argument; this is used for
693 defining commands which themselves take one optional argument. This
694 new argument is best introduced by means of a simple (and hence not
695 very practical) example:
697 \newcommand{\example}[2][YYY
]{Mandatory arg:
#2;
700 This defines |
\example| to be a command with two arguments, referred
701 to as |
#1| and |
#2| in the
\arg{definition
}---nothing new so far. But
702 by adding a second optional argument to this |
\newcommand| (the
703 |
[YYY
]|) the first argument (|
#1|) of the newly defined command
704 |
\example| is made optional with its default value being |YYY|.
706 Thus the usage of |
\example| is either:
725 The default value of the optional argument is
\texttt{YYY
}.
726 This value is specified as the
\oarg{default
} argument of the
727 |
\newcommand| that created |
\example|.
729 As another more useful example, the definition:
731 \newcommand{\seq}[2][n
]{\lbrace #2_
{0},
\ldots,\,
#2_
{#1} \rbrace}
733 means that the input |$
\seq{a
}$| produces
734 the formula $
\lbrace a_
{0},
\ldots,\,a_
{n
} \rbrace$,
735 whereas the input |$
\seq[k
]{x
}$| produces the formula
736 $
\lbrace x_
{0},
\ldots,\,x_
{k
} \rbrace$.
738 In summary, the command:
740 |
\newcommand|
\arg{cmd
} \oarg{num
} \oarg{default
} \arg{definition
}
742 defines
\m{cmd
} to be a command with
\m{num
} arguments, the first of
743 which is optional and has default value
\m{default
}.
745 Note that there can only be one optional argument but, as before,
746 there can be up to nine arguments in total.
750 \arg{cmd
} \oarg{num
} \oarg{default
} \arg{beg-def
} \arg{end-def
} \\
752 \arg{cmd
} \oarg{num
} \oarg{default
} \arg{beg-def
} \arg{end-def
} \\
754 \arg{cmd
} \oarg{num
} \oarg{default
} \arg{beg-def
} \arg{end-def
} \\
756 \arg{cmd
} \oarg{num
} \oarg{default
} \arg{beg-def
} \arg{end-def
}
759 \LaTeXe\ also supports the creation of environments that have one
760 optional argument. Thus the syntax of these two commands has
761 been extended in the same way as that of |
\newcommand|.
764 |
\providecommand|
\arg{cmd
} \oarg{num
} \oarg{default
} \arg{definition
} \\
765 |
\providecommand*|
\arg{cmd
} \oarg{num
} \oarg{default
} \arg{definition
}
768 This takes the same arguments as |
\newcommand|. If
\m{cmd
} is already
769 defined then the existing definition is kept; but if it is currently
770 undefined then the effect of |
\providecommand| is to define
\m{cmd
}
771 just as if |
\newcommand| had been used.
773 \NEWfeature{1994/
12/
01}
774 All the above five `defining commands' now have
\texttt{*
}-forms that
775 are usually the better form to use when defining commands with
776 arguments, unless any of these arguments is intended to contain
777 whole paragraphs of text. Moreover, if you ever do find yourself
778 needing to use the non-star form then you should ask whether
779 that argument would not better be treated as the contents of a
780 suitably defined environment.
782 \NEWfeature{1995/
12/
01}
783 The commands produced by the above five `defining commands' are
788 These next three commands for making LR-boxes all existed in
789 \LaTeX~
2.09. They have been enhanced in two ways.
792 |
\makebox|
\oarg{width
} \oarg{pos
} \arg{text
} \\
793 |
\framebox|
\oarg{width
} \oarg{pos
} \arg{text
} \\
794 |
\savebox|
\arg{cmd
} \oarg{width
} \oarg{pos
} \arg{text
}
797 One small but far-reaching change for
\LaTeXe\ is that, within the
798 \m{width
} argument only, four special lengths can be used. These are
799 all dimensions of the box that would be produced by using simply
802 \item [] |
\height|
\quad its height above the baseline;
803 \item [] |
\depth|
\quad its depth below the baseline;
804 \item [] |
\totalheight|
\quad the sum of |
\height| and |
\depth|;
805 \item [] |
\width|
\quad its width.
807 Thus, to put `hello' in the centre of a box of twice its natural
808 width, you would use:
810 \makebox[2\width]{hello
}
812 Or you could put
\textit{f
} into a square box, like
814 \framebox{\makebox[\totalheight]{\itshape f\/
}}
816 \framebox{\makebox[\totalheight]{\itshape f\/
}}
818 Note that it is the total width of the framed box, including the
819 frame, which is set to |
\totalheight|.
821 The other change is a new possibility for
\m{pos
}: |s| has been added
822 to |l| and |r|. If
\m{pos
} is |s| then the text is stretched the full
823 length of the box, making use of any `rubber lengths' (including any
824 inter-word spaces) in the contents of the box. If no such `rubber
825 length' is present, an `underfull box' will probably be produced.
828 |
\parbox|
\oarg{pos
} \oarg{height
} \oarg{inner-pos
} \arg{width
}
831 \oarg{pos
} \oarg{height
} \oarg{inner-pos
} \arg{width
}\\
836 As for the box commands above, |
\height|, |
\width|, etc.~may be used
837 in the
\oarg{height
} argument to denote the natural dimensions of the
840 The
\m{inner-pos
} argument is new in
\LaTeXe. It is the vertical
841 equivalent to the
\m{pos
} argument for |
\makebox|, etc, determining
842 the position of
\m{text
} within the box. The
\m{inner-pos
} may be any
843 one of |t|, |b|, |c|, or |s|, denoting top, bottom, centered, or
844 `stretched' alignment respectively. When the
\m{inner-pos
} argument
845 is not specified,
\LaTeX\ gives it same value as
\m{pos
} (this could be
846 the latter's default value).
850 |
\begin{lrbox
}|
\arg{cmd
}\\
855 This is an environment which does not directly print anything.
856 Its effect is to save the typeset
\m{text
} in the bin
\m{cmd
}. Thus
857 it is like |
\sbox|
\arg{cmd
} \arg{text
}, except that any white space
858 before or after the contents
\m{text
} is ignored.
860 This is very useful as it enables both the |
\verb| command and the
861 \texttt{verbatim
} environment to be used within
\m{text
}.
863 It also makes it possible to define, for example, a `framed box'
864 environment. This is done by first using this environment to save
865 some text in a bin
\m{cmd
} and then calling
866 |
\fbox{\usebox{|
\m{cmd
}|
}}|.
868 The following example defines an environment, called |fmpage|, that is
869 a framed version of |minipage|.
872 \newenvironment{fmpage
}[1]
873 {\begin{lrbox
}{\fmbox}\begin{minipage
}{#1}}
874 {\end{minipage
}\end{lrbox
}\fbox{\usebox{\fmbox}}}
878 \subsection{Measuring things
}
880 The first of these next commands was in
\LaTeX~
2.09. The two new
881 commands are the obvious analogues.
884 |
\settowidth|
\arg{length-cmd
} \arg{lr text
} \\
885 |
\settoheight|
\arg{length-cmd
} \arg{lr text
} \\
886 |
\settodepth|
\arg{length-cmd
} \arg{lr text
}
889 \subsection{Line endings
}
891 \NEWdescription{1994/
12/
01}
892 The command |\\|, which is used to indicate a line-end in various
893 places, is now a robust command when used within arguments such as
896 Also, because it is often necessary to distinguish which type of line
897 is to be ended, we have introduced the following new command; it
898 has the same argument syntax as that of |\\|.
899 \begin{decl
}[1994/
12/
01]
900 |
\tabularnewline|
\oarg{vertical-space
}
902 One example of its use is when the text in the last
903 column of a |tabular| environment is set with |
\raggedright|; then
904 |
\tabularnewline| can be used to indicate the end of a row of the
905 |tabular|, whilst |\\| will indicate the end of a line of text in a
906 paragraph within the column. This command can be used in the |array|
907 environment as well as |tabular|, and also the extended versions of
908 these environments offered by the
\textsf{array
} and
\textsf{longtable
}
909 packages in the tools collection.
911 \subsection{Controlling page breaks
}
913 Sometimes it is necessary, for a final version of a
document, to
914 `help'
\LaTeX\ break the pages in the best way.
\LaTeX~
2.09 had a
915 variety of commands for this situation: |
\clearpage|, |
\pagebreak|
916 etc.
\LaTeXe\ provides, in addition, commands which can produce
917 longer pages as well as shorter ones.
921 |
\enlargethispage|
\arg{size
} \\
922 |
\enlargethispage*|
\arg{size
}
925 These commands increase the height of a page (from its normal value of
926 |
\textheight|) by the specified amount
\m{size
}, a rigid length. This
927 change affects
\emph{only
} the current page.
929 This can be used, for example, to allow an extra line to be fitted
930 onto the page or, with a negative length, to produce a page
933 The star form also shrinks any vertical white space on the page as
934 much as possible, so as to fit the maximum amount of text on the
937 \NEWdescription{1995/
12/
01}
938 These commands do not change the position of the footer text; thus, if
939 a page is lengthened too far, the main text may overprint the footer.
943 There is a new command, |
\suppressfloats|, and a new `float
944 specifier'. These will enable people to gain better
945 control of
\LaTeX's float placement algorithm.
948 |
\suppressfloats|
\oarg{placement
}
951 This command stops any further floating environments from being placed
952 on the current page. With an optional argument, which should be either
953 |t| or |b| (not both), this restriction applies only to putting
954 further floats at the top or at the bottom. Any floats which would
955 normally be placed on this page are placed on the next page instead.
958 The extra float location specifier: \
\texttt{!
}
961 This can be used, along with at least one of
\texttt{h
},
\texttt{t
},
962 \texttt{b
} and
\texttt{p
}, in the location optional argument of a
965 If a
\texttt{!
} is present then, just for this particular float,
966 whenever it is processed by the float mechanism the following are
969 \item all restrictions on the number of floats which can appear;
970 \item all explicit restrictions on the amount of space on a text page
971 which may be occupied by floats or must be occupied by text.
973 The mechanism will, however, still attempt to ensure that pages are
974 not overfull and that floats of the same type are printed in the
977 Note that its presence has no effect on the production of float pages.
979 A
\texttt{!
} specifier overrides the effect of any |
\suppressfloats|
980 command for this particular float.
982 \subsection{Font changing: text
}
984 The font selection scheme used in
\LaTeXe{} differs a lot from that
985 used in
\LaTeX~
2.09. In this section, we give a brief description of
986 the new commands. A more detailed description with examples is given
987 in
\emph{\LaTeXcomp}, and the interface for class- and package-writers
988 is described in
\emph{\fntguide}.
1002 These are font commands whose use is the same as the commands |
\rm|,
1003 |
\bf|, etc. The difference is that each command changes just one
1004 attribute of the font (the attribute changed is part of the name).
1005 One result of this is that, for example, |
\bfseries\itshape| produces
1006 both a change of series and a change of shape, to give a bold italic
1010 |
\textrm|
\arg{text
}\\
1011 |
\textsf|
\arg{text
}\\
1012 |
\texttt|
\arg{text
}\\
1013 |
\textmd|
\arg{text
}\\
1014 |
\textbf|
\arg{text
}\\
1015 |
\textup|
\arg{text
}\\
1016 |
\textit|
\arg{text
}\\
1017 |
\textsl|
\arg{text
}\\
1018 |
\textsc|
\arg{text
}\\
1022 These are one-argument commands; they take as an argument the
1023 text which is to be typeset in the particular font. They also
1024 automatically insert italic corrections where appropriate; if you do
1025 not like the result, you can add an italic correction with |\/| or
1026 remove it with |
\nocorr|. The |
\nocorr| should always be the first or
1027 last thing within the
\arg{text
} argument.
1029 \subsection{Font changing: math
}
1031 Most of the fonts used within math mode do not need to be explicitly
1032 invoked; but to use letters from a range of fonts, the following
1033 class of commands is provided.
1036 |
\mathrm|
\arg{letters
}\\
1037 |
\mathnormal|
\arg{letters
}\\
1038 |
\mathcal|
\arg{letters
}\\
1039 |
\mathbf|
\arg{letters
}\\
1040 |
\mathsf|
\arg{letters
}\\
1041 |
\mathtt|
\arg{letters
}\\
1042 |
\mathit|
\arg{letters
}
1045 These are also one-argument commands which take as an argument the
1046 letters which are to be typeset in the particular font. The argument
1047 is processed in math mode so spaces within it will be ignored. Only
1048 letters, digits and accents have their font changed, for example
1049 |$
\mathbf{\tilde A
\times 1}$| produces $
\mathbf{\tilde A
\times 1}$.
1051 \subsection{Ensuring math mode
}
1054 |
\ensuremath|
\arg{math commands
}
1057 In
\LaTeX~
2.09, if you wanted a command to work both in math mode and
1058 in text mode, the suggested method was to define something like:
1060 \newcommand{\Gp}{\mbox{$G_p$
}}
1062 Unfortunately, the |
\mbox| stops |
\Gp| changing size correctly in (for
1063 instance) subscripts or a fraction.
1065 In
\LaTeXe{} you can define it thus:
1067 \newcommand{\Gp}{\ensuremath{G_p
}}
1069 Now |
\Gp| will work correctly in all contexts.
1071 This is because the |
\ensuremath| does nothing, producing simply
1072 |G_p|, when |
\Gp| is used within math mode; but it ensures that math
1073 mode is entered (and exited) as required when |
\Gp| is used in text
1077 \subsection{Setting text superscripts
}
1080 |
\textsuperscript|
\arg{text
}
1083 \NEWfeature{1995/
06/
01} In
\LaTeX~
2.09 textual superscripts such as
1084 footnote markers were produced by internally entering math mode and
1085 typesetting the number as a math superscript. This normally looked
1086 fine since the digits in math fonts are the same as those in text
1087 fonts when Computer Modern fonts are used. But when a different
1088 document font (such as Times) is selected, the results look rather
1089 strange. For this reason the command |
\textsuperscript| has been
1090 introduced which typesets its argument in the current text font, in a
1091 superscript position and in the correct size.
1093 \subsection{Text commands: all encodings
}
1095 \NEWdescription{1994/
12/
01}
1096 One of the main differences between
\LaTeXe{} and
\LaTeX~
2.09 is
1097 that
\LaTeXe{} can deal with fonts in arbitrary
\emph{encodings
}.
1098 (A font encoding is the sequence of characters in the font---for
1099 example a Cyrillic font would have a different encoding from a Greek
1102 The two major font encodings that are used for Latin languages such
1103 as English or German are |OT1| (Donald Knuth's
7-bit encoding, which
1104 has been used during most of
\TeX's lifetime) and |
T1| (the new
1105 8-bit `Cork' encoding).
1107 \LaTeX~
2.09 only supported the |OT1| encoding, whereas
\LaTeXe{} has
1108 support for both |OT1| and |
T1| built-in. The next section will
1109 cover the new commands which are available if you have |
T1|-encoded
1110 fonts. This section describes new commands which are available in
1113 Most of these commands provide characters which were available in
1114 \LaTeX~
2.09 already. For example |
\textemdash| gives an `em dash',
1115 which was available in
\LaTeX~
2.09 by typing |---|. However, some
1116 fonts (for example a Greek font) may not have the |---| ligature,
1117 but you will still be able to access an em dash by typing
1120 \begin{decl
}[1994/
12/
01]
1123 This command gives a `ring' accent, for example `
\r{o
}' can be typed
1126 \begin{decl
}[1994/
12/
01]
1129 This command produces a German `SS', that is a capital `
\ss'. This
1130 letter can hyphenate differently from `SS', so is needed for entering
1133 \begin{decl
}[1994/
12/
01]
1134 |
\textcircled{<text>
}|
1136 This command is used to build `circled characters' such as
1137 |
\copyright|. For example |
\textcircled{a
}| produces
1140 \begin{decl
}[1994/
12/
01]
1143 This command is used to separate letters which would normally
1144 ligature. For example `f
\textcompwordmark i' is produced with
1145 |f
\textcompwordmark i|. Note that the `f' and `i' have not
1146 ligatured to produce `fi'. This is rarely useful in English
1147 (`shelf
\textcompwordmark ful' is a rare example of where it might be
1148 used) but is used in languages such as German.
1150 \begin{decl
}[1994/
12/
01]
1153 This command produces a `visible space' character
1154 `
\textvisiblespace'. This is sometimes used in computer listings,
1155 for example `type
\textsf{hello
\textvisiblespace world
}'.
1157 \begin{decl
}[1994/
12/
01]
1161 |
\textquestiondown| \\
1163 |
\textquotedblright|
1167 These commands produce characters which would otherwise be
1168 accessed via ligatures:
1170 \begin{tabular
}{ccl
}
1171 \emph{ligature
} &
\emph{character
} &
\emph{command
} \\
1172 |---| & --- & |
\textemdash| \\
1173 |--| & -- & |
\textendash| \\
1174 |!`| & !` & |
\textexclamdown| \\
1175 |?`| & ?` & |
\textquestiondown| \\
1176 |``| & `` & |
\textquotedblleft| \\
1177 |''| & '' & |
\textquotedblright| \\
1178 |`| & ` & |
\textquoteleft| \\
1179 |'| & ' & |
\textquoteright|
1182 The reason for making these characters directly accessible is so
1183 that they will work in encodings which do not have these characters.
1185 \begin{decl
}[1994/
12/
01]
1187 |
\textperiodcentered|
1189 These commands allow access to characters which were previously only
1190 available in math mode:
1192 \begin{tabular
}{lcl
}
1193 \emph{math command
} &
\emph{character
} &
\emph{text command
} \\
1194 |
\bullet| & $
\bullet$ & |
\textbullet| \\
1195 |
\cdot| & $
\cdot$ & |
\textperiodcentered|
1199 \begin{decl
}[1995/
12/
01]
1205 These commands allow access to ASCII characters which were
1206 only available in verbatim or math mode:
1208 \begin{tabular
}{lcl
}
1209 \emph{math command
} &
\emph{character
} &
\emph{text command
} \\
1210 |
\backslash| & $
\backslash$ & |
\textbackslash| \\
1211 |
\mid| & $
\mid$ & |
\textbar| \\
1212 |<<| & $<$ & |
\textless| \\
1213 |>>| & $>$ & |
\textgreater|
1217 \begin{decl
}[1995/
12/
01]
1221 These commands allow access to ASCII characters which were
1222 previously only available in verbatim:
1225 \emph{verbatim
} &
\emph{text command
} \\
1226 |^| & |
\textasciicircum| \\
1227 |~| & |
\textasciitilde|
1231 \begin{decl
}[1995/
12/
01]
1235 These commands provide the `registered trademark' (R) and
1236 `trademark' (TM) symbols.
1238 \subsection{Text commands: the
T1 encoding
}
1240 \NEWdescription{1994/
12/
01}
1241 The |OT1| font encoding is fine for typesetting in English, but has
1242 problems when typesetting other languages. The |
T1| encoding solves
1243 some of these problems, by providing extra characters (such as `eth'
1244 and `thorn'), and it allows words containing accented letters to be
1245 hyphenated (as long as you have a package like |babel| which allows
1246 for non-American hyphenation).
1248 This section describes the commands you can use if you have the |
T1|
1249 fonts. To use them, you need to get the `ec fonts', or the
1250 |
T1|-encoded PostScript fonts, as used by
\textsf{psnfss
}.
1252 available by anonymous ftp in the Comprehensive
\TeX{} Archive, and
1253 are also available on the CD-ROMs
\emph{4all
\TeX} and
1254 \emph{\TeX{} Live
} (both available from the
\TeX{} Users Group).
1256 You can then select the |
T1| fonts by saying:
1258 \usepackage[T1]{fontenc}
1260 This will allow you to use the commands in this section.
1262 \emph{Note:
} Since this
document must be processable on any site
1263 running an up-to-date
\LaTeX, it does not contain any characters
1264 that are present only in |
T1|-encoded fonts. This means that this
1265 document cannot show you what these glyphs look like! If you want
1266 to see them then run
\LaTeX{} on the
document |fontsmpl| and
1267 respond `|cmr|' when it prompts you for a family name.
1269 \begin{decl
}[1994/
12/
01]
1272 This command produces an `ogonek' accent.
1274 \begin{decl
}[1994/
12/
01]
1284 These commands produce characters `eth', `dbar', `eng', and `thorn'.
1286 \begin{decl
}[1994/
12/
01]
1290 |
\guilsinglright| \\
1295 % A local hack (could be improved):
1296 \newcommand{\fauxguillemet}[1]{$
\vcenter{\hbox{$
\scriptscriptstyle#1$
}}$
}
1297 These commands produce various sorts of quotation mark.
1298 Rough representations of them are:
1299 \fauxguillemet\ll a
\fauxguillemet\gg{}
1300 \fauxguillemet<a
\fauxguillemet>
1301 ,
\kern -
0.1em,
\kern 0.05em a
\kern -
0.05em``
1302 ,
\kern 0.05em a
\kern -
0.05em` and |"|a|"|.
1304 \NEWdescription{2001/
06/
01}
1305 There are therefore some extra short-form ligatures available for
1306 use in documents that will only be used with |
T1|-encoded fonts.
1308 The guillemets |
\guillemotleft| and |
\guillemotright|
%
1309 \footnote{We apologise once again for maintaining Adobe's
1310 enormous solipsism~(sic) of confusing a diving bird with
1312 can be obtained by typing |<<<<| and |>>>>| and |
\quotedblbase|
1315 Also, unlike the unexpected results with
1316 |OT1|-encoded fonts, |<<| and |>>| will produce
\textless{} and
1319 Note also that the single character |"| will no longer produce ''
1320 but rather |
\textquotedbl|.
1329 |
\LaTeX| (producing `
\LaTeX') is still the `main' logo command,
1330 but if you need to refer to the new features, you can write
1331 |
\LaTeXe| (producing `
\LaTeXe').
1333 \subsection{Picture commands
}
1336 |
\qbezier[<N>
](<AX>,<AY>)(<BX>,<BY>)(<CX>,<CY>)| \\
1337 |
\bezier{<N>
}(<AX>,<AY>)(<BX>,<BY>)(<CX>,<CY>)|
1339 The |
\qbezier| command can be used in |picture| mode to draw a
1340 quadratic Bezier curve from position |(<AX>,<AY>)| to |(<CX>,<CY>)| with
1341 control point |(<BX>,<BY>)|. The optional argument
\m{N
} gives the
1342 number of points on the curve.
1344 For example, the diagram:
1346 \begin{picture
}(
50,
50)
1348 \qbezier(
0,
0)(
0,
50)(
50,
50)
1349 \qbezier[20](
0,
0)(
50,
0)(
50,
50)
1351 \put(
0,
0)
{\line(
1,
1)
{50}}
1356 \begin{picture
}(
50,
50)
1358 \qbezier(
0,
0)(
0,
50)(
50,
50)
1359 \qbezier[20](
0,
0)(
50,
0)(
50,
50)
1361 \put(
0,
0)
{\line(
1,
1)
{50}}
1364 The |
\bezier| command is the same, except that the argument
\m{N
} is not
1365 optional. It is provided for compatibility with the
\LaTeX~
2.09
1366 |bezier|
document style option.
1368 \subsection{Old commands
}
1374 The |
\samepage| command still exists but is no longer being
1376 This is because it only ever worked erratically; it does not
1377 guarantee that there will be no page-breaks within its scope; and
1378 it can cause footnotes and marginals to be wrongly placed.
1380 We recommend using |
\enlargethispage| in conjunction with page-break
1381 commands such as |
\newpage| and |
\pagebreak| to help control page
1387 Since
\SLiTeX{} no longer exists, the logo is no longer defined in the
1388 \LaTeX{} kernel. A suitable replacement is |
\textsc{Sli
\TeX}|. The
1389 \SLiTeX{} logo is defined in
\LaTeX~
2.09 compatibility mode.
1392 |
\mho| |
\Join| |
\Box| |
\Diamond| |
\leadsto| \\
1393 |
\sqsubset| |
\sqsupset| |
\lhd| |
\unlhd| |
\rhd| |
\unrhd|
1396 These symbols are contained in the
\LaTeX{} symbol font, which was
1397 automatically loaded by
\LaTeX~
2.09. However,
\TeX{} has room for
1398 only sixteen math font families; thus many users discovered that they
1399 ran out. Because of this,
\LaTeX{} does not load the
\LaTeX{} symbol
1400 font unless you use the
\textsf{latexsym
} package.
1402 These symbols are also made available, using different fonts, by the
1403 \textsf{amsfonts
} package, which also defines a large number of other
1404 symbols. It is supplied by the American Mathematical Society.
1406 The
\textsf{latexsym
} package is loaded automatically in
\LaTeX~
2.09
1409 \section{\LaTeX~
2.09 documents
}
1412 \LaTeXe{} can process (almost) any
\LaTeX~
2.09 document, by entering
1413 \emph{\LaTeX~
2.09 compatibility mode
}. Nothing has changed, you run
1414 \LaTeX{} in the same way you always did, and you will get much the
1417 The reason for the `almost' is that some
\LaTeX~
2.09 packages made use
1418 of low-level unsupported features of
\LaTeX. If you discover such a
1419 package, you should find out if it has been updated to work with
1420 \LaTeXe. Most packages will still work with
\LaTeXe---the easiest way
1421 to find out whether a package still works is to try it!
1423 \LaTeX~
2.09 compatibility mode is a comprehensive emulation of
1424 \LaTeX~
2.09, but at the cost of time. Documents can run up to
50\%
1425 slower in compatibility mode than they did under
\LaTeX~
2.09.
1426 In addition, many of the new features of
\LaTeXe{} are not available in
1427 \LaTeX~
2.09 compatibility mode.
1429 \subsection{Warning
}
1431 \NEWdescription{1995/
12/
01}
1432 This
\emph{\LaTeX~
2.09 compatibility mode
} is provided solely to allow
1433 you to process
2.09 documents, i.e.~documents that were written (we
1434 hope, a long time ago) for a very old system and therefore could be
1435 processed by using a genuine antique
\LaTeX~
2.09 system.
1437 This mode is therefore
\emph{not
} intended to provide access to the
1438 enhanced features of
\LaTeXe{}. Thus it must not be used to process
1439 new documents which masquerade as
2.09 documents (i.e.~they begin with
1440 |
\documentstyle|) but which could not be processed using that genuine
1441 antique
\LaTeX~
2.09 system because they contain some new,
1442 \LaTeXe{}-only, commands or environments.
1444 To prevent such misuse of the system, and the consequent trouble it
1445 causes when such misleadingly encoded documents are distributed, the
1446 \emph{\LaTeX~
2.09 compatibility mode
} turns off most of these new
1447 features and commands. Any attempt to use them will give you an error
1448 message and, moreover, many of them simply will not work, whilst
1449 others will produce unpredictable results.
1450 So don't bother sending us any bug reports about such occurrences since
1451 they are intentional.
1454 \subsection{Font selection problems
}
1457 When using compatibility mode, it is possible that you will find
1458 problems with font-changing commands in some old documents. These
1459 problems are of two types:
1462 \item producing error messages;
1463 \item not producing the font changes you expected.
1466 In case of error messages it is possible that the
document (or an old
1467 style file used therein) contains references to old internal commands
1468 which are no longer defined, see Section~
\ref{Sec:oldinternals
} for
1469 more information if this is the case.
1471 \NEWdescription{1995/
12/
01}
1472 One example of the unexpected is if you use one of the new style of
1473 math-mode font changing command as follows:
1477 You may well find that this behaves as if you had put:
1481 everything including the $A$ coming out bold.
1483 \LaTeX~
2.09 allowed sites to customize their
\LaTeX{} installation,
1484 which resulted in documents producing different results on different
1485 \LaTeX{} installations.
\LaTeXe{} no longer allows so much
1486 customization but, for compatibility with old documents, the local
1487 configuration file |latex209.cfg| is loaded every time
\LaTeXe{}
1488 enters
\LaTeX~
2.09 compatibility mode.
1490 For example, if your site was customized to use the New Font
1491 Selection Scheme (
\NFSS) with the |oldlfont| option, then you can
1492 make
\LaTeXe{} emulate this by creating a |latex209.cfg| file
1493 containing the commands:
1495 \ExecuteOptions{oldlfont
}\RequirePackage{oldlfont
}
1497 Similarly, to emulate
\NFSS{} with the |newlfont| option, you can
1498 create a |latex209.cfg| file containing:
1500 \ExecuteOptions{newlfont
}\RequirePackage{newlfont
}
1504 \subsection{Native mode
}
1507 To run an old
document faster, and use the new features of
1508 \LaTeXe, you should try using
\emph{\LaTeXe{} native mode
}.
1509 This is done by replacing the command:
1511 |
\documentstyle[|
\m{options
}|,|
\m{packages
}|
]|
\arg{class
}
1515 |
\documentclass|
\oarg{options
}\arg{class
} \\
1516 |
\usepackage{latexsym,|
\m{packages
}|
}|
1518 However, some documents which can be processed in
\LaTeX~
2.09
1519 compatibility mode may not work in native mode. Some
\LaTeX~
2.09
1520 packages will only work with
\LaTeXe{} in
2.09 compatibility mode.
1521 Some documents will cause errors because of
\LaTeXe's improved error
1522 detection abilities.
1524 But most
\LaTeX~
2.09 documents can be processed by
\LaTeXe{}'s native
1525 mode with the above change. Again, the easiest way to find out
1526 whether your documents can be processed in native mode is to try it!
1529 \section{Local modifications
}
1532 \NEWdescription{1995/
12/
01}
1533 There are two common types of local modifications that can be done
1534 very simply. Do not forget that documents produced using such
1535 modifications will not be usable at other places (such documents are
1536 called `non-portable').
1538 One type of modification is the use of personal commands for commonly
1539 used symbols or constructions. These should be put into a package
1540 file (for example, one called
\texttt{mymacros.sty
}) and loaded by
1541 putting |
\usepackage{mymacros
}| in the
document preamble.
1543 Another type is a local
document class that is very similar to one of
1544 the standard classes but contains some straightforward modifications
1545 such as extra environments, different values for some parameters, etc.
1546 These should be put into a class file; here we shall describe a simple
1547 method of constructing such a file using, as an example, a class
1548 called
\textsf{larticle
} that is very similar to the
\textsf{article
}
1551 \NEWfeature{1995/
12/
01}
1552 The class file called
\texttt{larticle.cls
} should (after the
1553 preliminary identification commands) start as follows:
1555 \LoadClassWithOptions{article
}
1557 This command should be followed by whatever additions and changes you
1558 wish to make to the results of reading in the file
1559 \texttt{article.sty
}.
1561 The effect of using the above |
\LoadClassWithOptions| command is to
1562 load the standard class file
\textsf{article
} with whatever options
1563 are asked for by the
document. Thus a
document using your
1564 \textsf{larticle
} class can specify any option that could be specified
1565 when using the standard
\textsf{article
} class; for example:
1567 \documentclass[a4paper,twocolumn,
dvips]{larticle
}
1572 \label{Sec:problems
}
1574 This section describes some of the things which may go wrong when
1575 using
\LaTeXe, and what you can do about it.
1577 \subsection{New error messages
}
1579 \LaTeXe{} has a number of new error messages.
1580 Please also note that many error messages now produce further helpful
1581 information if you press |h| in response to the error prompt.
1584 |Option clash for package |
\m{package
}|.|
1586 The named package has been loaded twice with different options. If
1587 you enter |h| you will be told what the options were, for example, if
1588 your
document contained:
1590 \usepackage[foo
]{fred
}
1591 \usepackage[baz
]{fred
}
1593 then you will get the error message:
1595 Option clash for package fred.
1597 and typing |h| at the |?| prompt will give you:
1599 The package fred has already been loaded with options:
1601 There has now been an attempt to load it with options:
1604 \usepackage[foo,baz
]{fred
}
1605 to your
document may fix this.
1606 Try typing <<return>> to proceed.
1608 The cure is, as suggested, to load the package with both sets of
1609 options. Note that since
\LaTeX{} packages can call other packages,
1610 it is possible to get a package option clash without explicitly
1611 requesting the same package twice.
1614 |Command |
\m{command
}| not provided in base NFSS.|
1616 The
\m{command
} is not provided by default in
\LaTeXe. This error is
1617 generated by using one of the commands:
1619 \mho \Join \Box \Diamond \leadsto
1620 \sqsubset \sqsupset \lhd \unlhd \rhd \unrhd
1622 which are now part of the
\textsf{latexsym
} package.
1625 \usepackage{latexsym
}
1627 in the preamble of your
document.
1630 |LaTeX2e command <command> in LaTeX
2.09 document.|
1632 The
\m{command
} is a
\LaTeXe{} command but this is a
\LaTeX~
2.09
1633 document. The cure is to replace the command by a
\LaTeX~
2.09
1634 command, or to run
document in native mode, as described in
1635 Section~
\ref{Sec:native
}.
1638 |NFSS release
1 command
\newmathalphabet found.|
1640 The command |
\newmathalphabet| was used by the New Font Selection
1641 Scheme Release
1 but it has now been replaced by
1642 |
\DeclareMathAlphabet|, the use of which is described in
1645 The best cure is to update the package which contained the
1646 |
\newmathalphabet| command. Find out if there is a new release of
1647 the package, or (if you wrote the package yourself) consult
1648 \emph{\fntguide} for the new syntax of font commands.
1650 If there is no updated version of the package then you can cure this
1651 error by using the
\textsf{newlfont
} or
\textsf{oldlfont
} package,
1652 which tells
\LaTeX{} which version of |
\newmathalphabet| should be
1655 You should use
\textsf{oldlfont
} if the
document selects math fonts with
1656 syntax such as this:
1660 Use
\textsf{newlfont
} if the
document's syntax is like this:
1667 |Text for
\verb command ended by end of line.|
1669 The |
\verb| command has been begun but not ended on that line. This
1670 usually means that you have forgotten to put in the end-character of
1671 the |
\verb| command.
1674 |Illegal use of
\verb command.|
1676 The |
\verb| command has been used inside the argument of another
1677 command. This has never been allowed in
\LaTeX{}---often producing
1678 incorrect output without any warning---and so
\LaTeXe{} produces
1681 \subsection{Old internal commands
}
1682 \label{Sec:oldinternals
}
1684 A number of
\LaTeX~
2.09 internal commands have been removed, since
1685 their functionality is now provided in a different way. See
1686 \emph{\clsguide} for more details of the new, supported interface for
1687 class and package writers.
1690 |
\tenrm| |
\elvrm| |
\twlrm|
\dots\\
1691 |
\tenbf| |
\elvbf| |
\twlbf|
\dots\\
1692 |
\tensf| |
\elvsf| |
\twlsf|
\dots\\
1695 These commands provided access to the seventy fonts preloaded by
1696 \LaTeX~
2.09. In contrast,
\LaTeXe{} normally preloads at most
1697 fourteen fonts, which saves a lot of font memory; but a consequence is
1698 that any
\LaTeX{} file which used the above commands to directly
1699 access fonts will no longer work.
1701 Their use will usually produce an error message such as:
1703 ! Undefined control sequence.
1706 The cure for this is to update the
document to use the new
1707 font-changing commands provided by
\LaTeXe; these are described in
1710 If this is not possible then, as a last resort, you can
1711 use the
\textsf{rawfonts
} package, which loads the
1712 seventy
\LaTeX~
2.09 fonts and provides direct access to them using the
1713 old commands. This takes both time and memory. If you do not
1714 wish to load all seventy fonts, you can select some of them by using the
1715 |only| option to
\textsf{rawfonts
}. For example, to load only |tenrm|
1716 and |tenbf| you write:
1718 \usepackage[only,tenrm,tenbf
]{rawfonts
}
1721 The
\textsf{rawfonts
} package is distributed as part of the
\LaTeX{}
1722 tools software, see Section~
\ref{Sec:st-pack
}.
1724 \subsection{Old files
}
1726 One of the more common mistakes in running
\LaTeX{} is to read in old
1727 versions of packages instead of the new versions. If you get an
1728 incomprehensible error message from a standard package, make sure you
1729 are loading the most recent version of the package. You can find out
1730 which version of the package has been loaded by looking in the log
1731 file for a line like:
1733 Package: fred
1994/
06/
01 v0.01 Fred's package.
1735 You can use the
\m{release-date
} options to |
\documentclass| and
1736 |
\usepackage| to make sure that you are getting a suitably recent copy
1737 of the
document class or package. This is useful when sending a
1738 document to another site, which may have out-of-date software.
1740 \subsection{Where to go for more help
}
1742 If you can't find the answer for your problem here, try looking in
1743 \emph{\LaTeXbook} or
\emph{\LaTeXcomp}. If you have a problem with
1744 installing
\LaTeX, look in the installation guide files which come with
1747 If this doesn't help, contact your local
\LaTeX{} guru or local
1748 \LaTeX{} mailing list.
1750 If you think you've discovered a bug then please
report it! First,
1751 you should find out if the problem is with a third-party package or
1752 class. If the problem is caused by a package or class other than
1753 those listed in Section~
\ref{Sec:class+packages
} then please
report
1754 the problem to the author of the package or class, not to the
\LaTeX3
1757 If the bug really is with core
\LaTeX{} then you should create a
1758 \emph{short
},
\emph{self-contained
} document which exhibits the
1759 problem. You should run a
\emph{recent
} (less than a year old)
1760 version of
\LaTeX{} on the file and then run
\LaTeX{} on
1761 |latexbug.tex|. This will create an error
report which you should
1762 send, together with the sample
document and log file, to the
1763 \LaTeX{} bugs address which can be found in the file
1764 |latexbug.tex| or |bugs.txt|.
1770 We certainly hope you will enjoy using the new standard
\LaTeX{} but,
1771 if this is not possible, we hope that you will enjoy success and
1772 fulfillment as a result of the documents which it will help you to
1775 If you find that the contribution of
\LaTeX{} to your life is such
1776 that you would like to support the work of the project team, then
1777 please read Section~
\ref{Sec:ltx3
} and discover practical ways to do
1780 \begin{thebibliography
}{1}
1783 Michel Goossens, Sebastian Rahtz and Frank Mittelbach.
1784 \newblock {\em The
{\LaTeX} Graphics Companion
}.
1785 \newblock Addison-Wesley, Reading, Massachusetts,
1997.
1789 Michel Goossens and Sebastian Rahtz.
1790 \newblock {\em The
{\LaTeX} Web Companion
}.
1791 \newblock Addison-Wesley, Reading, Massachusetts,
1999.
1796 \newblock {\em The
\TeX book
}.
1797 \newblock Addison-Wesley, Reading, Massachusetts,
1986.
1798 \newblock Revised to cover
\TeX3,
1991.
1803 \newblock {\em {\LaTeX:
} A Document Preparation System
}.
1804 \newblock Addison-Wesley, Reading, Massachusetts, second edition,
1994.
1806 \bibitem{A-W:MG2004
}
1807 Frank Mittelbach and Michel Goossens.
1808 \newblock {\em The
{\LaTeX} Companion second edition
}.
1809 \newblock With Johannes Braams, David Carlisle, and Chris Rowley.
1810 \newblock Addison-Wesley, Reading, Massachusetts,
2004.
1813 \end{thebibliography
}