rhl19.htm
来自「linux的初学电子书」· HTM 代码 · 共 2,061 行 · 第 1/4 页
HTM
2,061 行
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Does or does not start a new page after the title.</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
twocolumn
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Splits each page into two columns (useful for newsletters).</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
twoside, oneside
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Generates double- or single-sided output.</FONT>
</TABLE><P>Some of the differences between document classes are encapsulated by the defaults that they use for the options mentioned. For instance, articles and reports are single-sided by default, whereas books are not. Articles do not use the options for
title pages and starting right-sided chapters because they do not understand what a chapter is. Thus, the document classes in LaTeX are smart enough to do the kind of layout that you expect for the type of document you need.
<BR>
<BR>
<A NAME="E69E267"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Packages</B></FONT></CENTER></H4>
<BR>
<P>LaTeX also has the \usepackage command, which enables you to extend the capabilities of LaTeX even further by using an external package of features. The format is as follows:
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">\usepackage{package name}</FONT></PRE>
<P>package name can be any of several available packages. For instance, the doc package is used for the documentation of LaTeX programs, and the makeidx package provides support for the production of indexes.
<BR>
<P>You can also control what page styles LaTeX applies to your document by using the \pagestyle command. Table 19.4 describes the basic page styles available.
<BR>
<BR>
<P ALIGN=CENTER>
<CENTER>
<FONT COLOR="#000080"><B>Table 19.4. Page styles.</B></FONT></CENTER>
<BR>
<TABLE BORDERCOLOR=#000040 BORDER=1 CELLSPACING=2 WIDTH="100%" CELLPADDING=2 >
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<I>Style</I>
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<I>Description</I></FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
empty
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Sets the header and footers to be empty.</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
headings
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Prints the current chapter heading and page number on each page with an empty footer.</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
plain
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Prints the page number centered in the footer (the default page style).</FONT>
</TABLE><P>You can also vary page styles in your document using the \thispagestyle command. This applies the supplied page style to the current page only.
<BR>
<BR>
<A NAME="E69E268"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Using Special Characters</B></FONT></CENTER></H4>
<BR>
<P>LaTeX supports the use of international characters, such as umlauts (_) and circumflexes (^). These characters are generated using a command variant on the letter itself. For example, the text
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">What a na\"\i ve ma^itre d' you are!</FONT></PRE>
<P>produces the following:
<BR>
<P>What a naïve ma^itre d' you are!
<BR>
<P>International spacing can also be applied using the \frenchspacing command. This command tells LaTeX not to insert the usual extra space after a period.
<BR>
<BR>
<A NAME="E69E269"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Putting Structure into a </B><B>LaTeX</B><B> Document</B></FONT></CENTER></H4>
<BR>
<P>LaTeX has commands that make it easy to enhance your document structurally, thus making it easier for the reader to digest. For the article document class, the commands are as follows: \section, \subsection, \subsubsection, \paragraph, \subparagraph,
and \appendix. These commands, with the exception of \appendix, accept titles as arguments, and are declared before the body of text that they represent. LaTeX takes care of the rest; it sets the appropriate spacing between sections, section numbering, and
title font. The \appendix command uses alphabetic increments in order to number succeeding appendix sections.
<BR>
<P>For the report and book classes, there are two additional commands: \part and \chapter. The \part command enables you to insert a section without affecting the numbering sequence of the chapters. You can suppress the appearance of a section in the table
of contents by inserting a * character in the section command, as in the following:
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">\section*{I don't want to know about it}</FONT></PRE>
<P>You probably want to add a title to your document. This is done by specifying the arguments to the title commands and then calling the \maketitle command:
<BR>
<PRE>
<FONT COLOR="#000080">...
\title{Confessions of a LaTeX Enthusiast}
\author{Me}
\date
\begin{document}
\maketitle
...</FONT></PRE>
<P>To insert a table of contents in your document, issue the \tableofcontents command (big surprise) at the point where you want the table to appear. When you process your document with LaTeX, it needs two passes: one to make note of all the section
numbers, and the other to build the table of contents from the information it collected in the first pass.
<BR>
<BR>
<A NAME="E69E270"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Adding Other Structural Elements</B></FONT></CENTER></H4>
<BR>
<P>You can add cross-references to your document, which tie associated elements such as text, figures, and tables to text in other parts of your document. Use the \label command to set a point that you want to refer to, and give it an argument that is any
name you choose. This name can then be referred to by the \ref and \pageref commands to generate a cross-reference containing the section number and page number that the section title appears on.
<BR>
<P>You can easily add footnotes using the \footnote command, which accepts the text of the footnote as an argument.
<BR>
<P>Structure is also enhanced by controlling the presentation of the text that appears between section titles. This can be easily managed by using LaTeX environments. Environments are specified by bounding a portion of text with \begin and \end commands,
and passing an environment name to each command, as in the following:
<BR>
<PRE>
<FONT COLOR="#000080">\begin{hostileenvironment}
Looks like we're surrounded, said Custer.
\end{hostileenvironment}</FONT></PRE>
<P>LaTeX has many predefined environments for practical applications, as described in Table 19.5.
<BR>
<BR>
<P ALIGN=CENTER>
<CENTER>
<FONT COLOR="#000080"><B>Table 19.5. Predefined environments.</B></FONT></CENTER>
<BR>
<TABLE BORDERCOLOR=#000040 BORDER=1 CELLSPACING=2 WIDTH="100%" CELLPADDING=2 >
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<I>Environment</I>
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<I>Description</I></FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
center
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Centers text.</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
description
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Used to present descriptive paragraphs.</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
enumerate
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Used for numbered or bulleted lists.</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
flushleft
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Paragraphs are left-aligned.</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
flushright
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Paragraphs are right-aligned.</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
itemize
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Used for simple lists.</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
quote
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Used to quote single paragraphs.</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
quotation
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Used for longer quotes that span several paragraphs.</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
tabular
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Typesets tables with optional row and column separators.</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
verbatim
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Produces typed text. Useful for representing programming code, for example.</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
verse
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Used to control the linebreaks in poems.</FONT>
</TABLE><BR>
<A NAME="E69E271"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Working with Figures and Tables</B></FONT></CENTER></H4>
<BR>
<P>LaTeX also supports the variable placement (or "floating") of figures and tables in a document using the table and figure environments. A figure could be specified as follows:
<BR>
<PRE>
<FONT COLOR="#000080">\begin{figure}[!hbp]
\makebox[\textwidth]{\framebox[2in]{\rule{Opt}{2in}}}
\end{figure}</FONT></PRE>
<P>The options passed to the \begin{figure} command are placement specifiers that indicate your preferences for the location of the figure. LaTeX has to juggle the placement of floating figures and tables in a document by using these preferences, as well
as internal guidelines such as the maximum number of floats allowed per page. In this example, you told LaTeX to keep the figure with its adjacent text (h), at the bottom of the next applicable page , or, failing that, on a special page with other floating
figures (p). The ! character overrides LaTeX's best intentions for placing the figure, which may not necessarily jibe with what you are saying with the other placement specifiers.
<BR>
<P>Tables and figures can be labeled using the \caption command, which must be issued within the table or figure environment.
<BR>
<P>These are just some of the basics for using LaTeX, but hopefully they are sufficient to give you a place to start on the road to making your documents more visually appealing. You have probably noticed that LaTeX is somewhat easier to work with than TeX
itself, because it hides much detail from you as an author.
<BR>
<BR>
<A NAME="E68E131"></A>
<H3 ALIGN=CENTER>
<CENTER>
<FONT SIZE=5 COLOR="#FF0000"><B>VirTeX and IniTeX</B></FONT></CENTER></H3>
<BR>
<P>Two other TeX-related programs work together but perform slightly different roles. The IniTeX program is used to create a TeX format (.fmt) file containing font definitions and macros. The VirTeX program can then quickly load this precompiled format
file, much more quickly than TeX can. The command to use a format file is as follows:
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">$ virtex \&myformat sometexfile</FONT></PRE>
<P>The & character is necessary for VirTeX to recognize that it is loading a format file first; the & must be escaped using the \ character so as not to confuse the shell. The difference between VirTeX and IniTeX is that VirTeX can't be used to
create TeX format files, but it executes much faster.
<BR>
<BR>
<A NAME="E68E132"></A>
<H3 ALIGN=CENTER>
<CENTER>
<FONT SIZE=5 COLOR="#FF0000"><B>Summary</B></FONT></CENTER></H3>
<BR>
<P>TeX is a document-formatting system for Linux that enables authors to produce their own high-quality publications. It produces documents that are portable among output devices such as printers or displays. TeX supports many typographical features and is
particularly well-suited to the formatting of correct mathematical notation. It has macros that can be used to enhance the power of its basic command set. LaTeX, one of the most popular extensions to TeX, uses sophisticated macros to help you organize and
typeset your documents based on its con<A NAME="I2"></A>tents.
<P ALIGN=LEFT>
<A HREF="rhl18.htm" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/rhl18.htm" TARGET="_self"><IMG SRC="purprev.gif" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/purprev.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Previous Page"></A>
<A HREF="#I0" TARGET="_self"><IMG SRC="purtop.gif" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/purtop.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Page Top"></A>
<A HREF="index-1.htm" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/index.htm" TARGET="_self"><IMG SRC="purtoc.gif" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/purtoc.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="TOC"></A>
<A HREF="tppmsgs/msgs0.htm#21" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/rhl20.htm" TARGET="_self"><IMG SRC="purnext.gif" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/purnext.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Next Page"></A>
</BODY></HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?