-
Notifications
You must be signed in to change notification settings - Fork 37
/
spec.tex
1776 lines (1528 loc) · 78.3 KB
/
spec.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Contents: Specialities of the LaTeX system
% $Id: spec.tex,v 1.2 2003/03/19 20:57:47 oetiker Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 中文 4.20 翻译:[email protected]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\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 \EPSi{}}\label{eps}
\section{插入 EPS 图形}\label{eps}
%\LaTeX{} provides the basic facilities to work with floating bodies,
%such as images or graphics, with the \texttt{figure} and
%\texttt{table} environments.
\LaTeX{} 通过 \texttt{figure} 和 \texttt{table} 环境提供了
处理图像图形等浮动体的基本工具。
%There are several ways to generate the actual \wi{graphics} with
%basic \LaTeX{} or a \LaTeX{} extension package, a few of them are
%described in chapter \ref{chap:graphics}. Please refer to
%\companion{} and the \manual{} for more information on that subject.
有几种办法可以通过使用基本 \LaTeX{} 命令或者 \LaTeX{} 扩展宏包来产生实际的
图形 (\wi{graphics}),第 \ref{chap:graphics} 章中将会介绍其中的几种方法。
如果需要这方面的详细信息,请参阅 \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
%this, but this introduction will only discuss the use of \EPSi{}
%(EPS) graphics, because it is quite
%easy to do and widely used. In order to use pictures in the EPS
%format, you must have a \PSi{} printer\footnote{Another
% possibility to output \PSi{} is the \textsc{\wi{GhostScript}}
% program available from
% \CTANref|support/ghostscript|. Windows and OS/2 users might
% want to look for \textsc{GSview}.} available for output.
在文档中使用图形,一个相对容易的办法就是使用专门的软件包\footnote{例如 XFig、
CorelDraw!、 Freehand、
Gnuplot……}生成图形文件,然后将最终的图形文件插入
到文档中。\LaTeX{} 的宏包提供了许多方法来完成这个工作。在这个手册里,我们只
讨论 \EPSi{} (EPS) 图形文件的使用,因为它比较简单而且被广
泛地使用。为了使用 EPS 格式的图片,你必须有一个 \PSi 打印机
\footnote{另外一个可以用来输出 \PSi{} 的工具是 \textsc{\wi{GhostScript}} 程序,
它可以从 \CTANref|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{\CTANref|macros/latex/required/graphics|}
由 D. P. Carlisle 制作的 \pai{graphicx} 宏包提供了一套很好的插图命令。
它是一个叫作 ``graphics'' 的宏包集中的一部分
\footnote{\CTANref|macros/latex/required/graphics|}。
%Assuming you are working on a system with a \PSi{} 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:
假设你使用的系统安装了 \PSi{} 打印机和 \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 \PSi{} printer driver (such as an 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}
%\noindent 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 \eei{.dvi} file, so that the
%printer understands it and can correctly include the \eei{.eps}
%file.
%\item Use the command
%\begin{lscommand}
%\ci{includegraphics}\verb|[|\emph{key}=\emph{value}, \ldots\verb|]{|\emph{file}\verb|}|
%\end{lscommand}
%\noindent 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
格式的文件,你可以尝试安装一个 \PSi{} 打印机驱动程序(例如 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} 的名字
是必需的。知道了 \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 may help to clarify things:
%\begin{code}
%\begin{verbatim}
%\begin{figure}
%\centering
%\includegraphics[angle=90,
% width=0.5\textwidth]{test}
%\caption{This is a test.}
%\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}
\centering
\includegraphics[angle=90,
width=0.5\textwidth]{test}
\caption{This is a test.}
\end{figure}
\end{verbatim}
\end{code}
这段代码把文件 \texttt{test.eps} 中的图形插入到文档里。{\textbf
首先}图形被旋转 90 度,{\textbf
然后}进行缩放使得图形的宽度等于标准段落宽度的 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{label}\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}
%If you do not use the \emph{label} option, the entries will get
%enumerated automatically. The parameter after the
%\verb|\begin{thebibliography}| command defines how much space to
%reserve for the number of labels. 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{bibliography})。每个参考文献的
条目以如下的命令开头
\begin{lscommand}
\ci{bibitem}\verb|[|\emph{label}\verb|]{|\emph{marker}\verb|}|
\end{lscommand}
然后使用 \emph{marker} 在正文中引用这本书、这篇文章或者论文。
\begin{lscommand}
\ci{cite}\verb|{|\emph{marker}\verb|}|
\end{lscommand}
如果你不使用参数 \emph{label},参考文献条目的编号是自动生成的。 \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{专业功能}
\thispagestyle{fancyplain}
%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 that allows you to create bibliographies
%following a wide range of established designs.
对于大型项目,你也许需要使用 Bib\TeX{} 程序。 Bib\TeX{} 包含在大多数
的 \TeX{} 发行版本中。它能够让你维护一个参考文献数据库,并从中生成你的
论文引用到的文献条目。 Bib\TeX{} 产生的参考文献的外观是基于样式表,
它可以让你按照大量预先设计好的格式来创建你的参考文献。
%\newpage
%\section{Indexing} \label{sec: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. This
%introduction will only explain the basic index generation commands.
%For a more in-depth view, please refer to \companion.
%\index{makeindex program} \index{makeidx package}
许多书籍的一个非常有用的部分就是它们的索引 (\wi{index}) 了。使用 \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 that you want the final index
%entries to point to. Table \ref{index} explains the syntax of the
%\emph{key} argument with several examples.
索引的内容通过命令
\begin{lscommand}
\ci{index}\verb|{|\emph{key}\verb|}|
\end{lscommand}
\noindent
指定,这里 \emph{key} 是索引项的关键词。你可以在需要被索引的地方
加入这条命令。表 \ref{index} 举例解释了参量 \emph{key} 语法。
%\begin{table}[!tp]
%\caption{Index Key Syntax Examples.}
%\label{index}
%\begin{center}
%\begin{tabular}{@{}lll@{}}
% \textbf{Example} &\textbf{Index Entry} &\textbf{Comment}\\\hline
% \rule{0pt}{1.05em}\verb|\index{hello}| &hello, 1 &Plain entry\\
%\verb|\index{hello!Peter}| &\hspace*{2ex}Peter, 3 &Subentry under `hello'\\
%\verb|\index{Sam@\textsl{Sam}}| &\textsl{Sam}, 2& Formatted entry\\
%\verb|\index{Lin@\textbf{Lin}}| &\textbf{Lin}, 7& Same as above\\
%\verb.\index{Jenny|textbf}. &Jenny, \textbf{3}& Formatted page number\\
%\verb.\index{Joe|textit}. &Joe, \textit{5}& Same as above\\
%\verb.\index{ecole@\'ecole}. &\'ecole, 4& Handling of accents
%\end{tabular}
%\end{center}
%\end{table}
\begin{table}[!tp]
\caption{索引关键词语法示例。} \label{index}
\begin{center}
\begin{tabular}{@{}lll@{}}
\textbf{示例} &\textbf{索引项} &\textbf{注释}\\\hline
\rule{0pt}{1.05em}\verb|\index{hello}| &hello, 1 & 普通格式的索引项\\
\verb|\index{hello!Peter}| &\hspace*{2ex}Peter, 3 & `hello' 下的子项\\
\verb|\index{Sam@\textsl{Sam}}| &\textsl{Sam}, 2& 格式化的索引项\\
\verb|\index{Lin@\textbf{Lin}}| &\textbf{Lin}, 7& 同上\\
\verb.\index{Jenny|textbf}. &Jenny, \textbf{3}& 格式化的页码\\
\verb.\index{Joe|textit}. &Joe, \textit{5}& 同上\\
\verb.\index{ecole@\'ecole}. &\'ecole, 4& 重音标记
\end{tabular}
\end{center}
\end{table}
%When the input file is processed with \LaTeX{}, each \verb|\index|
%command writes an appropriate index entry, together with the current
%page number, to a special file. The file has the same name as the
%\LaTeX{} input file, but a different extension (\verb|.idx|). This
%\eei{.idx} file can then be processed with the \texttt{makeindex}
%program.
当 \LaTeX{} 处理源文档时,每个 \verb|\index| 命令都会将适当的索引项
和当前页码写入一个专门的文件中。这个文件的名字和 \LaTeX{} 源文档相同,
但具有不同的扩展名后缀 (\verb|.idx|)。这个 \texttt{.idx} 文件需要用
\texttt{makeindex} 程序来处理。
%\begin{lscommand}
% \texttt{makeindex} \emph{filename}
%\end{lscommand}
%The \texttt{makeindex} program generates a sorted index with the same base
%file name, but this time with the extension \eei{.ind}. If now the
%\LaTeX{} input file is processed again, this sorted index gets
%included into the document at the point where \LaTeX{} finds
%\begin{lscommand}
% \ci{printindex}
%\end{lscommand}
\begin{lscommand}
\texttt{makeindex} \emph{filename}
\end{lscommand}
\texttt{makeindex} 程序生成一个与源文件同名的序列化索引文件,
这个文件使用 \texttt{.ind} 为扩展名。当再次用 \LaTeX{} 处理源文件时,
这个序列化索引文件将被包含到源文件中
\begin{lscommand}
\ci{printindex}
\end{lscommand}
\noindent 命令出现的位置。
%The \pai{showidx} package that comes with \LaTeXe{} prints out all
%index entries in the left margin of the text. This is quite useful for
%proofreading a document and verifying the index.
\LaTeXe{} 附带的宏包 \pai{showidx} 可以在正文的左边打印出索引项。
这个功能在校对文档和索引项时十分有用。
% Note that the \ci{index}
%command can affect your layout if not used carefully.
%\begin{example}
%My Word \index{Word}. As opposed
%to Word\index{Word}. Note the
%position of the full stop.
%\end{example}
请注意不谨慎地使用 \ci{index} 命令,将会影响文档页版面布局。
\begin{example}
My Word \index{Word}. As opposed
to Word\index{Word}. Note the
position of the full stop.
\end{example}
%\section{Fancy Headers}
%\label{sec:fancy}
\section{定制页眉和页脚}
\label{sec:fancy}
%The \pai{fancyhdr} package,\footnote{Available from
% \CTANref|macros/latex/contrib/supported/fancyhdr|.} written by
%Piet van Oostrum, provides a few simple commands that allow you to
%customize the header and footer lines of your document. If you look
%at the top of this page, you can see a possible application of this
%package.
Piet van
Oostrum 编写的 \pai{fancyhdr} 宏包\footnote{可以在 \CTANref|macros/latex/contrib/supported/fancyhdr| 得到。},
提供了一些简单的命令使得我们可以定制文档的页眉和页脚。看一眼本页的顶部,
你就能发现这个宏包的用处。
%\begin{figure}[!htbp]
%\begin{lined}{\textwidth}
%\begin{verbatim}
%\documentclass{book}
%\usepackage{fancyhdr}
%\pagestyle{fancy}
% with this we ensure that the chapter and section
% headings are in lowercase.
%\renewcommand{\chaptermark}[1]{%
% \markboth{#1}{}}
%\renewcommand{\sectionmark}[1]{%
% \markright{\thesection\ #1}}
%\fancyhf{} % delete current header and footer
%\fancyhead[LE,RO]{\bfseries\thepage}
%\fancyhead[LO]{\bfseries\rightmark}
%\fancyhead[RE]{\bfseries\leftmark}
%\renewcommand{\headrulewidth}{0.5pt}
%\renewcommand{\footrulewidth}{0pt}
%\addtolength{\headheight}{0.5pt} % space for the rule
%\fancypagestyle{plain}{%
% \fancyhead{} % get rid of headers on plain pages
% \renewcommand{\headrulewidth}{0pt} % and the line
%}
%\end{verbatim}
%\end{lined}
%\caption{Example \pai{fancyhdr} Setup.} \label{fancyhdr}
%\end{figure}
\begin{figure}[!htbp]
\begin{lined}{\textwidth}
\begin{verbatim}
\documentclass{book}
\usepackage{fancyhdr}
\pagestyle{fancy}
with this we ensure that the chapter and section
headings are in lowercase.
\renewcommand{\chaptermark}[1]{%
\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{%
\markright{\thesection\ #1}}
\fancyhf{} % delete current header and footer
\fancyhead[LE,RO]{\bfseries\thepage}
\fancyhead[LO]{\bfseries\rightmark}
\fancyhead[RE]{\bfseries\leftmark}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0pt}
\addtolength{\headheight}{0.5pt} % space for the rule
\fancypagestyle{plain}{%
\fancyhead{} % get rid of headers on plain pages
\renewcommand{\headrulewidth}{0pt} % and the line
}
\end{verbatim}
\end{lined}
\caption{\pai{fancyhdr} 设置实例。} \label{fancyhdr}
\end{figure}
%The tricky problem when customising headers and footers is to get
%things like running section and chapter names in there. \LaTeX{}
%accomplishes this with a two-stage approach. In the header and footer
%definition, you use the commands \ci{rightmark} and \ci{leftmark} to
%represent the current section and chapter heading, respectively.
%The values of these two commands are overwritten whenever a chapter or
%section command is processed.
定制页眉和页脚时一件棘手的事情就是得到每个页面所属的章节名称。
\LaTeX{} 通过两个步骤来完成这个任务。在定义页眉和页脚时,你可以使用
\ci{rightmark} 命令来代表当前的 section 名,使用 \ci{leftmark} 来代表当前的 chapter 名。
这两个命令的值将在处理 chapter 或者 section 命令时被重新赋值。
%For ultimate flexibility, the \verb|\chapter| command and its friends
%do not redefine \ci{rightmark} and \ci{leftmark} themselves. They call
%yet another command (\ci{chaptermark}, \ci{sectionmark}, or
%\ci{subsectionmark}) that is responsible for redefining \ci{rightmark}
%and \ci{leftmark}.
为了获得最大的灵活性, \verb|\chapter| 等命令并不对 \ci{rightmark} 和
\ci{leftmark} 直接进行重定义,而是间接地通过调用 \ci{chaptermark}、
\ci{sectionmark} 或者 \ci{subsectionmark} 来重新定义 \ci{rightmark} 和
\ci{leftmark}。
%If you want to change the look of the chapter
%name in the header line, you need only ``renew'' the \ci{chaptermark}
%command. \cih{sectionmark}\cih{subsectionmark}
因此,只需要重新定义 \ci{chaptermark} 命令,\cih{sectionmark}\cih{subsectionmark}
就能修改页眉上显示的章名。
%Figure \ref{fancyhdr} shows a possible setup for the \pai{fancyhdr}
%package that makes the headers look about the same as they look in
%this booklet. In any case, I suggest you fetch the documentation for
%the package at the address mentioned in the footnote.
图 \ref{fancyhdr} 显示了如何配置 \pai{fancyhdr} 来得到和本文相似的页眉。
无论如何我还是建议你先阅读一下 \pai{fancyhdr} 宏包所带的文档。
%\section{The Verbatim Package}
\section{Verbatim 宏包}
%Earlier in this book, you got to know the \ei{verbatim}
%\emph{environment}. In this section, you are going to learn about the
%\pai{verbatim} \emph{package}. The \pai{verbatim} package is basically
%a re-implementation of the \ei{verbatim} environment that works around
%some of the limitations of the original \ei{verbatim} environment.
%This by itself is not spectacular, but the implementation of the
%\pai{verbatim} package added new functionality, which is
%why I am mentioning the package here. The \pai{verbatim}
%package provides the
在本文的前面部分你已经知道了 \ei{verbatim} {\textbf
环境}。在这一节中, 你将学会使用 \pai{verbatim} {\textbf
宏包}。 \pai{verbatim} 宏包重新
实现了 \ei{verbatim} 环境,并解决了原来的 \ei{verbatim} 环境的一些限制。
这本身并没有什么特别的,但 \pai{verbatim} 宏包还实现了一些新增的功能,
这才是我在这里提到这个宏包的原因。 \pai{verbatim} 宏包提供了
\begin{lscommand}
\ci{verbatiminput}\verb|{|\emph{filename}\verb|}|
\end{lscommand}
%\noindent command, which allows you to include raw ASCII text into your
%document as if it were inside a \ei{verbatim} environment.
\noindent
命令,这个命令允许你把一个 ASCII 码的文本文件包含到你的文档中来,
就好像它们是在 \ei{verbatim} 环境中一样。
%As the \pai{verbatim} package is part of the `tools' bundle, you
%should find it pre-installed on most systems. If you want to know more
%about this package, make sure to read \cite{verbatim}.
\pai{verbatim} 宏包是 `tools' 宏包集的一部分,大多数的系统中都预装了这个宏包集。
如果你想更多地了解这个宏包,可以阅读 \cite{verbatim}。
%\section{Installing Extra Packages}\label{sec:Packages}
\section{安装额外的宏包}\label{sec:Packages}
%Most \LaTeX{} installations come with a large set of pre-installed
%style packages, but many more are available on the net. The main
%place to look for style packages on the Internet is CTAN
%(\url{http://www.ctan.org/}).
大多数的 \LaTeX{} 安装都带有大量预装的样式宏包,但更多的宏包可以在网上得到。
在互联网寻找样式宏包的一个主要的地方就是 CTAN
(\url{http://www.ctan.org/})。
%Packages such as \pai{geometry}, \pai{hyphenat}, and many
%others are typically made up of two files: a file with the extension
%\texttt{.ins} and another with the extension \texttt{.dtx}. There
%will often be a \texttt{readme.txt} with a brief description of the
%package. You should of course read this file first.
各种宏包的源文件,例如 \pai{geometry}, \pai{hyphenat} 等等,一般来说都包含
两个文件:一个扩展名为 \texttt{.ins},另一个扩展名为 \texttt{.dtx}。
此外,通常会有一个 \texttt{readme.txt} 对宏包进行简要的说明。你应该先阅读这个文件。
%In any event, once you have copied the package files onto your
%machine, you still have to process them in a way that (a) tells your
%\TeX\ distribution about the new style package and (b) gives you
%the documentation. Here's how you do the first part:
无论如何,一旦你得到了宏包的源文件,你还要对它们进行处理使得 (a) 你的 \TeX{} 系统知道这个新的宏包, (b) 生成说明文档。下面是第一部分的步骤:
%\begin{enumerate}
%\item Run \LaTeX{} on the \texttt{.ins} file. This will
% extract a \eei{.sty} file.
%\item Move the \eei{.sty} file to a place where your distribution
% can find it. Usually this is in your \texttt{\ldots/\emph{localtexmf}/tex/latex}
% subdirectory (Windows or OS/2 users should feel free to change the
% direction of the slashes).
%\item Refresh your distribution's file-name database. The command
% depends on the \LaTeX distribution you use:
% teTeX, fpTeX -- \texttt{texhash}; web2c -- \texttt{maktexlsr};
% MikTeX -- \texttt{initexmf -update-fndb} or use the GUI.
%\end{enumerate}
\begin{enumerate}
\item 对 \texttt{.ins} 文件运行 \LaTeX{} 命令。这将会产生一个 \texttt{.sty} 文件。
\item 把 \texttt{.sty} 文件移到 \LaTeX{} 系统能找到的地方。一般是在
\texttt{\ldots/\emph{localtexmf}/tex/latex} 子目录下(Windows 或者 OS/2 用户应该改变斜线为反斜线)。
\item 刷新系统的文件名数据库。具体的命令取决于你使用的 \LaTeX{} 系统:
teTeX, fpTeX -- \texttt{texhash}; web2c -- \texttt{maktexlsr};
MikTeX -- \texttt{initexmf -update-fndb} 或者使用图形界面。
\end{enumerate}
%\noindent Now you can extract the documentation from the
%\texttt{.dtx} file:
\noindent 现在你可以从 \texttt{.dtx} 文件生成说明文档:
%\begin{enumerate}
%\item Run \LaTeX\ on the \texttt{.dtx} file. This will generate a
% \texttt{.dvi} file. Note that you may have to run \LaTeX\
% several times before it gets the cross-references right.
%\item Check to see if \LaTeX\ has produced a \texttt{.idx} file
% among the various files you now have.
% If you do not see this file, then you may proceed to
% step \ref{step:final}.
%\item In order to generate the index, type the following:\\
% \fbox{\texttt{makeindex -s gind.ist \textit{name}}}\\
% (where \textit{name} stands for the main-file name without any
% extension).
% \item Run \LaTeX\ on the \texttt{.dtx} file once again. \label{step:next}
%
%\item Last but not least, make a \texttt{.ps} or \texttt{.pdf}
% file to increase your reading pleasure.\label{step:final}
%
%\end{enumerate}
\begin{enumerate}
\item 对 \texttt{.dtx} 文件运行 \LaTeX{} 命令。这会生成一个 \texttt{.dvi} 文件。
注意你可能需要多次运行 \LaTeX{} 命令来正确处理交叉引用。
\item 检查一下 \LaTeX{} 命令是否产生了 \texttt{.idx} 文件。如果没发现这个文件,
你就可以执行第 \ref{step:final} 步了。
\item 为了生成索引,敲入命令:\\
\fbox{\texttt{makeindex -s gind.ist \textit{name}}}\\
(这里 \textit{name} 表示不带扩展名的主文件名)。
\item 再次对 \texttt{.dtx} 文件运行 \LaTeX{} 命令。\label{step:next}
\item 最后一步但不是必需的,生成 \texttt{.ps} 文件或者 \texttt{.pdf} 文件以方便阅读。\label{step:final}
\end{enumerate}
%Sometimes you will see that a \texttt{.glo}
%(glossary) file has been produced. Run the following
%command between
%step \ref{step:next} and \ref{step:final}:
有时你会看见生成了一个 \texttt{.glo}
(glossary) 文件。在第 \ref{step:next} 步和第 \ref{step:final} 步之间
运行下面的命令:
\noindent\texttt{makeindex -s gglo.ist -o \textit{name}.gls \textit{name}.glo}
%\noindent Be sure to run \LaTeX\ on the \texttt{.dtx} one last
%time before moving on to step \ref{step:final}.
\noindent
确认在执行第 \ref{step:final} 步前最后对 \texttt{.dtx} 文件运行一遍 \LaTeX{} 命令。
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Contents: Chapter on pdfLaTeX
% French original by Daniel Flipo 14/07/2004
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\section{Working with pdf\LaTeX}
\section{使用 pdf\LaTeX} \label{sec:pdftex}\index{PDF}
\secby{Daniel Flipo}{[email protected]}
%\footnote{翻译: Li Jian. [email protected]}}
%
%\begin{tiny}
%by Daniel Flipo $<[email protected]$>$
%\end{tiny}%
%PDF is a \wi{hypertext} document format. Much like in a web page,
%some words in the document are marked as hyperlinks. They link to
%other places in the document or even to other documents. If you
%click on such a hyperlink you get transported to the destination of
%the link. In the context of \LaTeX{}, this means that all
%occurrences of \ci{ref} and \ci{pageref} become hyperlinks.
%Additionally, the table of contents, the index and all the other
%similar structures become collections of hyperlinks.
PDF 是一种超文本文档 (\wi{hypertext}) 格式。类似于网页,
文档中的某些词可以被超链接标记。它们链接到这个文档的另一个地方,
甚至是另外一个文档。如果你点击这样一个超链接,
你将转调到链接的目的地。
这意味着在 \LaTeX{} 格式的文档中所有 \ci{ref} 和 \ci{pageref} 出现的位置都变成超链接。此外,目录、
索引和其它类似的结构变成超链接的集合。
%Most web pages you find today are written in HTML \emph{(HyperText
% Markup Language)}. This format has two significant disadvantages
%when writing scientific documents:
%\begin{enumerate}
%\item Including mathematical formulae into HTML documents is not
% generally supported. While there is a standard for it, most browsers
% used today do not support it, or lack the required fonts.
%\item Printing HTML documents is possible, but the results vary widely
% between platforms and browsers. The results are miles removed from
% the quality we have come to expect in the \LaTeX{} world.
%\end{enumerate}
现在大多数的网页都是用 HTML \textbf{超文本标记语言}编写。
在写科技文档的时候,这种格式有两个严重的缺陷:
\begin{enumerate}
\item 数学公式在 HTML 文档中通常都不被支持。尽管对此有一个标准,
但是大多是现在使用的浏览器都不支持,或者缺少需要的字体。
\item 打印 HTML 文档是比较容易的,但打印的结果会因系统平台和浏览器的不同
而出现差异。
这结果与我们在 \LaTeX{} 世界中期待的高质量相差十万八千里。
\end{enumerate}
% There have been many attempts to create translators
%from \LaTeX{} to HTML. Some were even quite successful in the sense
%that they are able to produce legible web pages from a standard
%\LaTeX{} input file. But all of them cut corners left and right to
%get the job done. As soon as you start using more complex \LaTeX{}
%features and external packages things tend to fall apart. Authors
%wishing to preserve the unique typographic quality of their
%documents even when publishing on the web turn to PDF
%\emph{(Portable Document Format)}, which preserves the layout of the
%document and permits hypertext navigation. Most modern browsers come
%with plugins that allow the direct display of PDF documents.
有许多将 \LaTeX{} 转为 HTML 的尝试。其中一些可以说是相当成功的,
它们能将一个标准的 \LaTeX{} 源文件生成一个合格的网页。
但是为了达到目的,需要去掉一些支持。
当你开始使用 \LaTeX{} 的复杂功能和扩展宏包时,那些尝试就行不通了。
若希望即使是发不到网上也保留文档的高质量,
作者们就要使用 PDF \textbf{(便携式文档格式)},
它保留了文档的版式和允许超链接导航。
现在大多数浏览器只要带上相应的插件都可以直接显示 PDF 文档。
%Even though there are DVI and PS viewers for almost every platform, you will find that
%\wi{Acrobat Reader} and \wi{Xpdf} for viewing PDF documents
%are more widely deployed. So providing PDF versions of your documents will
%make them much more accessible to your potential readers.
尽管几乎所有的操作系统都有 DVI 和 PS 格式的阅读器,
但你会发现人们更多地使用 \wi{Acrobat
Reader} 和 \wi{Xpdf} 来阅读 PDF 文档。
因而提供 PDF 格式的文档将使得潜在的读者更容易阅读。
%\subsection{PDF Documents for the Web}
\subsection{发布到网上的 PDF 文档}
% The creation of a PDF file from \LaTeX{} source is very simple,
%thanks to the pdf\TeX{} program developed by
%H\`an Th\'{\^e} Th\`anh. pdf\TeX{} produces PDF output where normal
%\TeX{} produces DVI. There is also a pdf\LaTeX{}, which produces
% PDF output from \LaTeX{} sources. \index{pdftex@pdf\TeX}\index{pdftex@pdf\LaTeX}
有了 H\`an Th\'{\^e} Th\`anh 开发的 pdf\TeX{} 程序,使用 \LaTeX 源文件来创建 PDF 文件将变得非常简单。
一般的 TeX{} 生成 DVI,
而 pdf\TeX{} 生成 PDF。还有 pdf\LaTeX{} 程序将 LaTeX{} 源文件生成 PDF。
\index{pdftex@pdf\TeX}\index{pdftex@pdf\LaTeX}
%Both pdf\TeX{} and pdf\LaTeX{} are installed automatically by most
%modern \TeX{} distributions, such as te\TeX{}, fp\TeX{}, Mik\TeX,
%\TeX{}Live and CMac\TeX{}.
现在大多数的 \TeX{} 发行版本都自动集成安装了 pdf\TeX{} 和 pdf\LaTeX{},
例如: te\TeX{}, fp\TeX{}, Mik\TeX{}, \TeX{}Live 和 CMac\TeX{}。
%To produce a PDF instead of DVI, it is sufficient to replace the
%command \texttt{latex file.tex} by
%\texttt{pdflatex file.tex}. On systems where \LaTeX{} is not called from the
%command line, you may find a special button in the \TeX{}ControlCenter.
为了生成 PDF 而不是 DVI,只需要将命令 \texttt{latex
file.tex} 改成 \texttt{pdflatex
file.tex}。在不是使用命令行的 \LaTeX{} 系统中,你可以在 \TeX{} 控制中心找到一个专门的按钮。
%In \LaTeX{} you can define the paper size with an
%optional documentclass argument such as \texttt{a4paper} or
%\texttt{letterpaper}. This works in pdf\LaTeX{} too, but on top of this
%pdf\TeX{} also needs to know the physical size of the paper to determine the physical
%size of the pages in the pdf file.
%\index{paper size}
%If you use the
%\pai{hyperref} package (see page \pageref{ssec:pdfhyperref}), the
%papersize will be adjusted automatically. Otherwise you have to do this
%manually by putting the following lines into the preamble of the document:
%\begin{code}
%\begin{verbatim}
%\pdfpagewidth=\paperwidth
%\pdfpageheight=\paperheight
%\end{verbatim}
%\end{code}
在 \LaTeX{} 中,
你可以通过 documentclass 的参数选项来定义页面的大小,
例如:\texttt{a4paper} 或 \texttt{letterpaper}。这些也
对 pdf\LaTeX{} 有效,但是首先要让 pdf\TeX{} 知道这种页
面的实际大小来控制 PDF 文件的页面大小。若你使用 \pai{hyperref} 宏
包(参见第 \pageref{ssec:pdfhyperref} 页),页面的大小将自动调整。
否则,你需要手动的将下面两行加入到文档的导言区:
\begin{code}
\begin{verbatim}
\pdfpagewidth=\paperwidth
\pdfpageheight=\paperheight
\end{verbatim}
\end{code}
%The following section will go into more detail regarding the
%differences between normal \LaTeX{} and pdf\LaTeX{}. The main
%differences concern three areas: the fonts to use, the format of
%images to include, and the manual configuration of hyperlinks.
接下来的一节将深入介绍 \LaTeX{} 和 pdf\LaTeX{} 之间的不同。主要的不同
有三个方面:采用的字体,包含图像的格式和超链接的手动配置。
%\subsection{The Fonts}
\subsection{字体}
%\wi{pdf\LaTeX} can deal with all sorts of fonts (PK bitmaps,
%TrueType,
%%\PSi{} type 1\dots) but the normal \LaTeX{} font format, the bitmap PK
%PostScript type 1\dots) but the normal \LaTeX{} font format, the
%bitmap PK fonts produce very ugly results when the document is
%%displayed with Acrobat Reader. It is best to use \PSi{} Type 1 fonts
%displayed with Acrobat Reader. It is best to use PostScript Type 1
%fonts exclusively to produce documents that display well.
%\emph{Modern TeX installations will be setup so that this happens
%automatically. Best is to try. If it works for you, just skip this
%whole section.}
\wi{pdf\LaTeX} 能处理所有的字体 (PK 点阵、TrueType、 \PSi{}
type 1……),但是作为 \LaTeX{} 通常的字体格式, PK 点阵字体在 Acrobat
Reader 下的显示效果非常差。为了获得文档更高的显示效果,最好使用 \PSi{}
Type 1 字体。{\textbf
高级的 \TeX{} 安装程序会自动设置好,你最好试一下,如果它正常运作,你就可以跳过这一节。}
%The \PSi{} Type 1 implementation of the Computer Modern and AMSFonts
%was produced by Blue Sky Research and Y\&Y, Inc., who then
%transferred copyright to the American Mathematical Society. The
%fonts were made publicly available in early 1997 and currently come
%with most of \TeX{} distributions.
\PSi{} Type 1 的 Computer Modern 和 AMSFonts 字体由 Blue Sky
Research 和 Y\&Y,
Inc. 制作,后来版权属于美国数学学会 (AMS)。这些字体在 1997 年被开放,并且出现在大多数 \TeX{} 发行版中。
%However, if you are using \LaTeX{} to create documents in languages
%other than English, you might want to use EC, LH, or CB fonts (see the
%discussion about \texttt{OT1} fonts on the page \pageref{OT1}).
%Vladimir Volovich has created the cm-super font bundle which covers the
%entire EC/TC, EC Concrete, EC Bright and LH font sets. It is available from
%\texttt{CTAN:/fonts/ps-type1/cm-super} and is included with \TeX{}Live7
%and Mik\TeX. Similar type 1 CB Greek fonts created by Apostolos
%Syropoulos are available at
%\texttt{CTAN:/tex-archive/fonts/greek/cb}. Unfortunately, both of
%these font sets are not of the same typographic quality as the Type1
%CM fonts by Blue Sky/Y\&Y. They were automatically hinted, and the
%document might look not as neat on the screen as the ones using Blue
%Sky/Y\&Y type 1 CM fonts, on high resolution output devices they
%produce results identical to the original bitmap EC/LH/CB fonts.
然而,如果你使用 \LaTeX{} 来创建非英文的文档,你可能用到 EC, LH 或 CB 字体(关于
\texttt{OT1} 字体的讨论可参见第 \pageref{OT1} 页)。Vladimir
Volovich 创建了 cm-super 字体包,包含全部 EC/TC、EC Concrete、EC
Bright 和 LH 字体集。在 \texttt{CTAN:/fonts/ps-type1/cm-super} 可以获得,也被集成进了
\TeX{}Live7 和 Mik\TeX\/。由 Apostolos Syropoulos 创建类似 type 1
CB 的希腊字体可在 \texttt{CTAN:/tex-archive/fonts/greek/cb} 获得。不幸的是,这些字体集跟 Blue
Sky/Y\&Y 的 Type 1
CM 字体的印刷质量不一样。\LaTeX{} 会自动提示,而且文档在屏幕的显示效果也不如 Blue
Sky/Y\&Y type 1
CM 字体那么整洁。在高分辨率的输出设备下,它们生成的效果跟原来的 EC/LH/CB 点阵字体一样。
% If you are creating document in one of Latin-based
%languages, you have several other options.
%\begin{itemize}
%\item You might want to use \pai{aeguill} package, aka
% \emph{Almost European Computer Modern with Guillemets}. Just put the
% line
% \newline
% \verb+\usepackage{aeguill}+\ into the preamble of
% your document, to enable AE virtual fonts instead of EC fonts.
%\item Alternatively, you can use \pai{mltex} package, but this only works when
% your pdf\TeX{} has been compiled with the \wi{mltex} option.
%\end{itemize}
如果你使用一种拉丁语系的语文来创建文档,你有其它一些选择。
\begin{itemize}
\item 使用 \pai{aeguill} 宏包,也叫 \emph{Almost European Computer Modern with
Guillemets}。只需在导言区添加一行 \verb+\usepackage{aeguill}+,来启用 AE 虚拟字体替代 EC 字体。
\item 或者使用 \pai{mltex} 宏包,但是它只在 pdf\TeX{} 设置了 \wi{mltex} 选项时有效。
\end{itemize}
%The AE virtual fontset, like the {Ml\TeX} system, makes \TeX{} believe
%it has a full 256 character fontset at its disposal by creating most of
%the missing letters from characters of the CM font and rearranging them
%in the EC order, this allows to use the excellent type 1 format CM
%fonts available on most systems. As the font is now in T1 encoding,
%hyphenation will work well in Latin-based European languages. The only
%disadvantage of this approach is that the artificial AE characters do
%not work with Acrobat Reader's \texttt{Find} function, so you cannot
%search for words with accented characters in your final PDF file.
AE 虚拟字体集,像 {Ml\TeX} 系统,在 CM 字体的字符基础上创建
全部缺失的字母并按 EC 顺序重新排列,就使得 \TeX{} 处理它的时候
认为它有一个全部 256 个字符的字体集。这样就可使用大部分系统中优质的 type
1 格式的 cm 字体。这套字体现在为 T1 编码,在拉丁语系的欧洲语文中能很好的运作。
唯一的不足就是创建的 AE 字符不支持 Acrobat
Reader 的查找功能,因此你不能在 PDF 文档中搜索那些带重音符号的单词。
%For the Russian language a similar solution is to use C1 virtual fonts
%available at \texttt{ftp://ftp.vsu.ru/pub/tex/font-packs/c1fonts}.
%These fonts combine the standard CM type 1
%fonts from Bluesky collection and CMCYR type 1 fonts from Paradissa and
%BaKoMa collection, all available on CTAN. Because Paradissa fonts
%contain only Russian letters, C1 fonts are
%missing other Cyrillic glyphs.
对于俄文,一个类似的解决办法是使用 C1 虚拟字体,这可以在 \texttt{ftp://ftp.vsu.ru/pub/tex/font-packs/c1fonts}
上获得。这套字体集成了标准的 Bluesky CM type 1 字体和 Paradissa
与 BaKoMa 的 CMCYR
type 1 字体,这些都可以在 CTAN 上找到。由于 Paradissa 字体只包含俄文字母,C1 字体里就没有
其他西里尔字符了。
%Another solution is to switch to other \PSi{} type 1 fonts.
%Actually, some of them are even included with every copy of Acrobat
%Reader. Because these fonts have different character sizes, the text
%layout on your pages will change. Generally these other fonts will
%use more space than the CM fonts, which are very space-efficient.
%Also, the overall visual coherence of your document will suffer
%because Times, Helvetica and Courier (the primary candidates for
%such a replacement job) have not been designed to work in harmony in
%a single document.
另一种解决办法是使用其它 \PSi{}
type 1 字体。事实上,其中一些字体被包含在 Acrobat
Reader 的相应语言版本中。由于这些字体有不同的字符大小,页面上的文本格式将会
改变。一般地,这类字体占得空间要比 CM 字体大,因为 CM 字体是一种
非常节省空间的字体。而且文档可视的一致性也被破坏了,因为 Times、
Helvetica 和 Courier 字体(这些是 Acrobat 里基本的可替换字体)没有
被设计来在单个文档中和平共处。
%Two ready-made font sets are available for this purpose:
%\pai{pxfonts}, which is based on \emph{Palatino} as its main text body font,
%and the \pai{txfonts} package, which is based on \emph{Times}. To use them it is
%sufficient to put the following lines into the preamble of your
%document:
%\begin{code}
%\begin{verbatim}
%\usepackage[T1]{fontenc}
%\usepackage{pxfonts}
%\end{verbatim}
%\end{code}
为了达到上述目的,有两套字体已经做好:\pai{pxfonts},它基于作为正文
字体的 \emph{Palatino};另外就是基于 \emph{Times} 的 \pai{txfonts} 宏包。只需要在文档的导言区加入下列几行就可以使用这些字体:
\begin{code}
\begin{verbatim}
\usepackage[T1]{fontenc}
\usepackage{pxfonts}
\end{verbatim}
\end{code}
%Note: you may find lines like
%\begin{verbatim}
%Warning: pdftex (file eurmo10): Font eur... not found
%\end{verbatim}
%in the \texttt{.log} file after compiling your input file. They mean
%that some font used in the document has not been found. You really have
%to fix these problems, as the resulting PDF document may