\\section{Introduction: What Is \\latex?}% \\label{sec:introduction}
\\latex is a tool that allows you to concentrate on your writing while taking advantage of the \\tex typesetting system to produce high-quality typeset documents.
\\latex's benefits include
\\begin{enumerate}
\\item Standardized document classes
\\item Structural frameworks for organizing documents
\\item Automatic numbering and cross-referencing of structural elements \\item ``Floating'' figures and tables
\\item High-level programming interface for accessing \\tex's typesetting capabilities
\\item Access to \\latex extensions through loading ``packages'' \\end{enumerate}
\\section{Structured Writing}% \\label{sec:structured-writing}
Like HTML,\\footnote{HyperText Markup Language} \\latex is a markup language rather than a \\acronym{Wysiwyg}{}\\footnote{What You See Is What You Get.} system. You write plain text files that use special \\key{commands} and \\key{environments} that govern the appearance and function of parts of your text in your final typeset document.
\\subsection{Document Classes}% \\label{sec:document-classes}
The general appearance of your document is determined by your choice of \\key{document class}. Document classes also load \\latex packages to provide additional functionality.
\\latex provides a number of basic classes, including \\class{article}, \\class{letter}, \\class{report}, and \\class{book}. There are also a large number of other document classes available, including \\class{amsart} and \\class{amsbook}, created by the American
Mathematical Society and providing some additional mathematically useful structures and commands; \\class{foils}, \\class{prosper}, and
\\class{seminar}, which allow you to create ``slides'' for
presentations; the math department's \\class{thesis} class, for formatting senior theses; and many journal- or company-specific classes that format your document to match the ``house style'' of a particular periodical or publisher.
\\subsection{Packages}% \\label{sec:packages}% \\label{sec:ctan}
\\latex packages, or \\key{style files}, define additional commands and environments, or change the way that previously defined commands and environments work. By loading packages, you can change the fonts used in your document, write your document in a non-English language with a non-\\acronym{Ascii} font encoding, include graphics, format program listings, add custom headers and footers to your document, and much more.
A typical \\tex installation includes hundreds of style files, and hundreds more are available from the Comprehensive \\tex Archive Network (CTAN), at \%url{http://www.ctan.org/}.
\\subsection{Structural Commands}% \\label{sec:structural-commands}
\\begin{table} \\centering
\\begin{tabular}{ll}
\\toprule
Command & Notes \\\\ \\midrule
\\com{part} & \\class{book} \\& \\class{report} only \\\\ \\com{chapter} &\\class{book} \\& \\class{report} only \\\\
\\com{section} \\\\ \\com{subsection} \\\\ \\com{subsubsection} \\\\ \\com{paragraph} \\\\ \\com{subparagraph} \\\\ \\bottomrule
\\end{tabular}
\\caption[Structural commands in \\latex]{Structural commands in \\latex.}% \\label{tab:structural-commands}
\\end{table}
\\latex provides a set of structural commands for defining sections of your document, as shown in Table~\\ref{tab:structural-commands}.
Note that the argument to structural commands are moving arguments (see Section~\\ref{sec:fragile-commands}) because they can be reused in the table of contents or in page headers or footers. Structural
commands can take an optional argument in which you specify nonfragile commands or a shorter version of the actual section title that fits. You'll generally know when you need to provide an optional argument by \\TeX's behavior.
\\subsection{Labels and References}% \\label{sec:labels-and-references}
Sections are numbered automatically by \\latex during typesetting. If you change your mind and decide that a subsection should be promoted to a section, or moved to the end of your document, the sections will be renumbered so that the numbers are consistent.
Sections can also be \\command{label}{}ed with a tag such as \\begin{quote} \\begin{verbatim}
\\section{Our Complicated Equations}% \\label{sec:complicated-eqs}
\\end{verbatim} \\end{quote}
and referred to with a \\command{ref} or \\command{pageref} command, as in
\\begin{quote}
\\begin{verbatim}
In Section~\\ref{sec:complicated-eqs}, we pointed out... \\end{verbatim} \\end{quote} or
\\begin{quote} \\begin{verbatim}
On page~\\pageref{fig:gordian-knot}, we illustrated... \\end{verbatim}
\\end{quote}
\\latex substitutes the correct section number when typesetting your
document.
The same commands can be used with numbered environments such as \\env{equation}, \\env{theorem}, and so forth.
Use \\emph{meaningful} labels---labeling a section as \\texttt{sec12} may seem useful, but it will be confusing if you end up moving it to a different place in the document and its number changes to Section~34. It's also easier to remember what reference you want if you use a meaningful name.
You may also want to impose some additional organization through the use of \\emph{namespaces}, as I've done in this document. Rather than give different types of objects undistinguished labels, I precede section labels with \\texttt{sec:}, equations with \\texttt{eq:}, figures with \\texttt{fig:}, tables with \\texttt{tab:}, and so on.
Emacs with Aux\\tex and Ref\\tex gives you easy access to these labels, as do many other editors with \\tex-specific features. It's much easier to find the particular label you're looking for if you have some additional information to help you. Adding the prefixes also reminds you of what text should precede the \\com{ref} command.
\\subsection{Commands}
\\latex uses commands for changes that are very limited in scope (a few words) or are unlimited in scope (the rest of a document). For example, the commands \\begin{quote} \\begin{verbatim} \\textbf{bold}
\\emph{italic (emphasized)} \\textsf{sans serif} \\end{verbatim} \\end{quote}
produce the following output in a typeset document: \\begin{quote}
\\textbf{bold} \\emph{italic (emphasized)} \\textsf{sans serif} \\end{quote}
These are ``commands with arguments''---the command itself starts with a backslash (\\bsl), and its \\key{argument} appears inside braces
{\\verb+{ }+). Some commands may also have \\key{optional arguments},
相关推荐: