📄 spec.tex
字号:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Contents: Specialities of the LaTeX system
% $Id: spec.tex,v 1.4 2002/06/13 15:35:49 aloft Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\chapter{Specialities}
%\begin{intro}
% When putting together a large document, \LaTeX{} will help you
% with some special features like index generation,
% bibliography management, and other things.
% A much more complete description of specialities and
% enhancements possible with \LaTeX{} can be found in the
% {\normalfont\manual{}} and {\normalfont \companion}.
%\end{intro}
\chapter{特殊功能}
\begin{intro}
当你处理一个大型文档时,~\LaTeX{}~的一些特殊功能,例如索引的自动生成、
参考文献的管理等等,会给你以很大的帮助。
详细的关于~\LaTeX{}~的特殊功能以及可能的增强功能的描述可以在
~{\normalfont\manual{}}~和~{\normalfont \companion}~找到。
\end{intro}
%\section{Including EPS Graphics}
\section{包含~EPS~图形}
%\LaTeX{} provides the basic facilities to work with floating bodies
%such as images or graphics, with the \texttt{figure} and the
%\texttt{table} environment.
\LaTeX{}~通过~\texttt{figure}~和~\texttt{table}~环境提供了
处理图像或者图形等浮动对象的基本能力。
%There are also several possibilities to generate the actual
%\wi{graphics} with basic \LaTeX{} or a \LaTeX{} extension package.
%Unfortunately, most users find them quite difficult to understand.
%Therefore this will not be explained any further in this manual.
%Please refer to \companion{} and the \manual{} for more information on
%that subject.
有几种办法可以通过使用基本~\LaTeX{}~命令或者~\LaTeX{}~扩展宏包来产生实际的
~\wi{图形}~。但是大多数用户发现这些命令相当难以理解。因此我们不打算在这个
手册里深入介绍这些内容。如果需要这方面的详细信息,请参阅~\companion{}~和~\manual{}~。
%A much easier way to get graphics into a document, is to generate them
%with a specialised software package\footnote{Such as XFig, CorelDraw!,
% Freehand, Gnuplot, \ldots} and then include the finished graphics
%into the document. Here again, \LaTeX{} packages offer many ways to do
%that. In this introduction, only the use of \wi{Encapsulated
% PostScript} (EPS) graphics will be discussed, because it is quite
%easy to do and widely used. In order to use pictures in the EPS
%format, you must have a \wi{PostScript} printer\footnote{Another
% possibility to output PostScript is the \textsc{\wi{GhostScript}}
% program available from
% \texttt{CTAN:/tex-archive/support/ghostscript}. Windows and OS/2 users might
% want to look for \textsc{GSview}.} available for output.
一个比较简单的在文档中加入图形的办法就是使用特定的软件包~\footnote{例如~XFig,
CorelDraw!, Freehand, Gnuplot, \ldots}~生成图形文件,然后将最终的图形文件包含
到文档中。~\LaTeX{}~的宏包提供了许多方法来完成这个工作。在这个手册里,我们只
讨论~\wi{Encapsulated PostScript}(EPS)~图形文件的使用。因为它比较简单而且被广
泛地使用。为了使用~EPS~格式的图片,你必须有一个~\wi{PostScript}~打印机
\footnote{另外一个可以用来输出~PostScript~的工具是~\textsc{\wi{GhostScript}}~软件,
它可以从~\texttt{CTAN:/tex-archive/support/ghostscript}得到。~Windows~和~OS/2~
用户可能更喜欢用~\textsc{GSview}~。}~来输出结果。
%A good set of commands for inclusion of graphics is provided in
%the \pai{graphicx} package by D.~P.~Carlisle. It is part of a
%whole family of packages called the ``graphics''
%bundle\footnote{\texttt{CTAN:/tex-archive/macros/latex/required/graphics}}.
由~D.\nbs P.\nbs Carlisle~制作的~\pai{graphicx}~宏包包含了一套很好的命令来
包含图形。它是一个叫作~``graphics''~的宏包集中的一部分
\footnote{\texttt{CTAN:/tex-archive/macros/latex/required/graphics}}~。
%Assuming you are working on a system with a
%PostScript printer available for output and with the \textsf{graphicx}
%package installed, you can use the following step by step guide to
%include a picture into your document:
假设你使用的系统安装了~PostScript~打印机和~\textsf{graphicx}~宏包,
那么你就可以通过下面的步骤一步步地把一幅图片加入你的文档中:
%\begin{enumerate}
%\item Export the picture from your graphics program in EPS
% format.\footnote{If your software can not export into EPS format, you
% can try to install a PostScript printer driver (some Apple
% LaserWriter for example) and then print to a file with this
% driver. With some luck this file will be in EPS format. Note that
% an EPS must not contain more than one page. Some printer drivers
% can be explicitly configured to produce EPS format.}
%\item Load the \textsf{graphicx} package in the preamble of the input
% file with
%\begin{lscommand}
%\verb|\usepackage[|\emph{driver}\verb|]{graphicx}|
%\end{lscommand}
%where \emph{driver} is the name of your ``dvi to postscript''
%converter program. The most
%widely used program is called \texttt{dvips}. The name of the driver is
%required, because there is no standard on how graphics are included in
%\TeX{}. Knowing the name of the \emph{driver}, the
%\textsf{graphicx} package can choose the correct method to insert
%information about the graphics into the \texttt{.dvi}~file, so that the
%printer understands it and can correctly include the \texttt{.eps} file.
%\item Use the command
%\begin{lscommand}
%\ci{includegraphics}\verb|[|\emph{key}=\emph{value}, \ldots\verb|]{|\emph{file}\verb|}|
%\end{lscommand}
%to include \emph{file} into your document. The optional parameter
%accepts a comma separated list of \emph{keys} and associated
%\emph{values}. The \emph{keys} can be used to alter the width,
%height and rotation of the included graphic. Table~\ref{keyvals}
%lists the most important keys.
%\end{enumerate}
\begin{enumerate}
\item 用你的图像软件输出~EPS~格式的图形文件\footnote{如果你的软件不能输出~EPS~
格式的文件,你可以尝试安装一个~PostScript~打印机驱动程序(例如~Apple
LaserWriter~),然后将你的图形通过这个驱动程序打印到文件。运气好的话,
这个文件可能会是~EPS~格式的。注意一个~EPS~文件不能包含超过一页的内容。
一些打印机驱动程序可以明确地指定为输出~EPS~文件。}。
\item 在输入文件的导言中加上下面的命令来装入~\textsf{graphicx}~宏包。
\begin{lscommand}
\verb|\usepackage[|\emph{driver}\verb|]{graphicx}|
\end{lscommand}
这里~\emph{driver}~是你使用的``dvi~到~postscript''的转换程序。最常用的
是~\texttt{dvips}。因为~\TeX{}~中没有规定包含图形的标准,所以程序的名字
是必需的。知道了~\emph{driver}~的名字,\textsf{graphicx}~宏包就可以选择
合适的方法在~\texttt{.dvi}~文件中插入关于图形的信息。这样打印机才能理解
这些信息并正确的包含这些~\texttt{.eps}~文件。
\item 使用命令
\begin{lscommand}
\ci{includegraphics}\verb|[|\emph{key}=\emph{value}, \ldots\verb|]{|\emph{file}\verb|}|
\end{lscommand}
来把文件~\emph{file}~加入你的文档。可选的参数是一系列由逗号隔开的关键词
~\emph{keys}~和相应的值~\emph{values}。关键词~\emph{keys}~可以用来改变包
含的图形的宽度、高度以及旋转角度等等。表~\ref{keyvals}~列出了最主要的几个关键词。
\end{enumerate}
%\begin{table}[htb]
%\caption{Key Names for \textsf{graphicx} Package.} \label{keyvals}
%\begin{lined}{9cm}
%\begin{tabular}{@{}ll}
%\texttt{width}& scale graphic to the specified width\\
%\texttt{height}& scale graphic to the specified height\\
%\texttt{angle}& rotate graphic counterclockwise\\
%\texttt{scale}& scale graphic \\
%\end{tabular}
%
%\bigskip
%\end{lined}
%\end{table}
\begin{table}[htb]
\caption{\textsf{graphicx}~宏包使用的关键词} \label{keyvals}
\begin{lined}{9cm}
\begin{tabular}{@{}ll}
\texttt{width}& 把图形缩放到指定的宽度\\
\texttt{height}& 把图形缩放到指定的高度\\
\texttt{angle}& 逆时针旋转图形\\
\texttt{scale}& 缩放图形\\
\end{tabular}
\bigskip
\end{lined}
\end{table}
%\pagebreak
%The following example code will hopefully make things clear:
%\begin{code}
%\begin{verbatim}
%\begin{figure}
%\begin{center}
%\includegraphics[angle=90, width=0.5\textwidth]{test}
%\end{center}
%\end{figure}
%\end{verbatim}
%\end{code}
%It includes the graphic stored in the file \texttt{test.eps}. The
%graphic is \emph{first} rotated by an angle of 90 degrees and
%\emph{then} scaled to the final width of 0.5 times the width of a
%standard paragraph. The aspect ratio is $1.0$, because no special
%height is specified. The width and height parameters can also be
%specified in absolute dimensions. Refer to Table~\ref{units} on
%page~\pageref{units} for more information. If you want to know
%more about this topic, make sure to read \cite{graphics} and
%\cite{eps}.
下面这个例子可以帮助我们理解整个过程:
\begin{code}
\begin{verbatim}
\begin{figure}
\begin{center}
\includegraphics[angle=90, width=0.5\textwidth]{test}
\end{center}
\end{figure}
\end{verbatim}
\end{code}
这段代码把存储在文件~\texttt{test.eps}~中的图形包含到文档里。\emph{首先}
图形被旋转~90~度,\emph{然后}进行缩放使得图形的宽度等于标准页面宽度的~$0.5$~倍。
因为没有指定图形的高度,图形的高宽变化的比例是~$1.0$,也就是保持原来的高宽比。
高度和宽度参数也可以用绝对长度单位来指定。详细的信息可以在第~\pageref{units}~页
的表~\ref{units}~中找到。如果你想知道更多这方面的知识,请阅读文献~\cite{graphics}~
和~\cite{eps}。
%\section{Bibliography}
\section{参考文献}
%You can produce a \wi{bibliography} with the \ei{thebibliography}
%environment. Each entry starts with
%\begin{lscommand}
%\ci{bibitem}\verb|{|\emph{marker}\verb|}|
%\end{lscommand}
%The \emph{marker} is then used to cite the book, article or paper
%within the document.
%\begin{lscommand}
%\ci{cite}\verb|{|\emph{marker}\verb|}|
%\end{lscommand}
%The numbering of the entries is generated automatically. The
%parameter after the \verb|\begin{thebibliography}| command sets the maximum
%width of these numbers. In the example below, \verb|{99}| tells
%\LaTeX{} to expect that none of the bibliography item numbers will be
%wider than the number 99.
%\enlargethispage{2cm}
%\begin{example}
%Partl~\cite{pa} has
%proposed that \ldots
%\begin{thebibliography}{99}
%\bibitem{pa} H.~Partl:
%\emph{German \TeX},
%TUGboat Volume~9, Issue~1 (1988)
%\end{thebibliography}
%\end{example}
你可以通过~\ei{thebibliography}~环境来产生一个~\wi{参考文献}~。每个参考文献的
条目以如下的命令开头
\begin{lscommand}
\ci{bibitem}\verb|{|\emph{marker}\verb|}|
\end{lscommand}
然后使用~\emph{marker}~在正文中引用这本书、这篇文章或者论文。
\begin{lscommand}
\ci{cite}\verb|{|\emph{marker}\verb|}|
\end{lscommand}
参考文献条目的编号是自动生成的。~\verb|\begin{thebibliography}|~
命令后的参数设置了最大的编号宽度。在下面的例子中,~\verb|{99}|~告诉
~\LaTeX{}~参考文献条目的编号不会比数字~$99$~更宽。
%\enlargethispage{2cm}
\begin{example}
Partl~\cite{pa} has
proposed that \ldots
\begin{thebibliography}{99}
\bibitem{pa} H.~Partl:
\emph{German \TeX},
TUGboat Volume~9, Issue~1 (1988)
\end{thebibliography}
\end{example}
%\chaptermark{Specialities} % w need to fix the damage done by the
% %bibliography example.
\chaptermark{特殊功能} % w need to fix the damage done by the
%bibliography example.
\thispagestyle{fancyplain}
%\newpage
%For larger projects, you might want to check out the Bib\TeX{}
%program. Bib\TeX{} is included with most \TeX{} distributions. It
%allows you to maintain a bibliographic database and then extract
%the references relevant to things you cited in your paper. The
%visual presentation of Bib\TeX{} generated bibliographies is based
%on a style sheets concept which allows you to create
%bibliographies following a wide range of established designs.
对于大型的项目,你也许需要使用~Bib\TeX{}~程序。~Bib\TeX{}~包含在大多数
的~\TeX{}~发行版本中。它能够让你维护一个参考文献数据库,并从中生成你的
论文引用到的文献条目。~Bib\TeX{}~对参考文献的描述是基于一种样式表的概念,
它可以让你按照大量预先设计好的格式来创建你的参考文献。
%\section{Indexing}
\section{索引}\label{sec:indexing}
%A very useful feature of many books is their \wi{index}. With \LaTeX{}
%and the support program \texttt{makeindex}\footnote{On systems not
% necessarily supporting
% filenames longer than 8~characters, the program may be called
% \texttt{makeidx}.}, an index can be generated quite easily. In this
%introduction, only the basic index generation commands will be explained.
%For a more in-depth view, please refer to \companion. \index{makeindex
% program} \index{makeidx package}
许多书籍最有用的部分莫过于它们的~\wi{索引}~了。使用~\LaTeX{}~和辅助工具
~\texttt{makeindex}\footnote{在文件名不允许超过~8~个字符的操作系统上,
这个程序被命名为~\texttt{makeidx}。},我们能够很容易的生成索引。在这个手册里,
只介绍了最基本的索引生成命令。更进一步的了解请参考~\companion。
\index{makeindex program} \index{makeidx package}
%To enable the indexing feature of \LaTeX{}, the \pai{makeidx} package
%must be loaded in the preamble with:
%\begin{lscommand}
%\verb|\usepackage{makeidx}|
%\end{lscommand}
%\noindent and the special indexing commands must be enabled by putting
%the
%\begin{lscommand}
% \ci{makeindex}
%\end{lscommand}
%\noindent command into the input file preamble.
为了使用~\LaTeX{}~的索引功能,宏包~\pai{makeidx}~必须在导言部分被引入:
\begin{lscommand}
\verb|\usepackage{makeidx}|
\end{lscommand}
\noindent 然后在导言中使用
\begin{lscommand}
\ci{makeindex}
\end{lscommand}
\noindent 激活索引命令。
%The content of the index is specified with
%\begin{lscommand}
% \ci{index}\verb|{|\emph{key}\verb|}|
%\end{lscommand}
%\noindent commands, where \emph{key} is the index entry. You enter the
%index commands at the points in the text where you want the final index
%entries to point to. Table~\ref{index} explains the syntax of the
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -