]> git.lyx.org Git - lyx.git/blob - lib/doc/zh_CN/Tutorial.lyx
UserGuide.lyx: next revision step
[lyx.git] / lib / doc / zh_CN / Tutorial.lyx
1 #LyX 2.0 created this file. For more info see http://www.lyx.org/
2 \lyxformat 413
3 \begin_document
4 \begin_header
5 \textclass book
6 \begin_preamble
7 %\usepackage{fontspec}
8 %\setromanfont{AR PL ShanHeiSun Uni}%字体来自Adobe Reader 8.0 OpenType,可以选用任何系统已有的字体
9 %中文断行 
10 %\XeTeXlinebreaklocale "zh"
11 %\XeTeXlinebreakskip = 0pt plus 1pt 
12 \usepackage{CJK}
13 \end_preamble
14 \options cjk
15 \use_default_options true
16 \maintain_unincluded_children false
17 \language chinese-simplified
18 \language_package default
19 \inputencoding UTF8
20 \fontencoding global
21 \font_roman default
22 \font_sans default
23 \font_typewriter default
24 \font_default_family default
25 \use_non_tex_fonts false
26 \font_sc false
27 \font_osf false
28 \font_sf_scale 100
29 \font_tt_scale 100
30 \font_cjk gbsn
31
32 \graphics default
33 \default_output_format default
34 \output_sync 0
35 \bibtex_command default
36 \index_command default
37 \float_placement th
38 \paperfontsize 12
39 \spacing onehalf
40 \use_hyperref true
41 \pdf_title "The LyX Tutorial"
42 \pdf_author "LyX Team"
43 \pdf_subject "LyX-documentation Tutorial"
44 \pdf_keywords "LyX, documentation"
45 \pdf_bookmarks true
46 \pdf_bookmarksnumbered true
47 \pdf_bookmarksopen true
48 \pdf_bookmarksopenlevel 1
49 \pdf_breaklinks false
50 \pdf_pdfborder false
51 \pdf_colorlinks true
52 \pdf_backref section
53 \pdf_pdfusetitle false
54 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true,pdfstartview=XYZ, plainpages=false"
55 \papersize a4paper
56 \use_geometry false
57 \use_amsmath 1
58 \use_esint 1
59 \use_mhchem 1
60 \use_mathdots 1
61 \cite_engine basic
62 \use_bibtopic false
63 \use_indices false
64 \paperorientation portrait
65 \suppress_date false
66 \use_refstyle 0
67 \index 索引
68 \shortcut idx
69 \color #008000
70 \end_index
71 \secnumdepth 3
72 \tocdepth 3
73 \paragraph_separation indent
74 \paragraph_indentation default
75 \quotes_language english
76 \papercolumns 1
77 \papersides 2
78 \paperpagestyle default
79 \tracking_changes false
80 \output_changes false
81 \html_math_output 0
82 \html_css_as_file 0
83 \html_be_strict false
84 \end_header
85
86 \begin_body
87
88 \begin_layout Standard
89 \begin_inset ERT
90 status collapsed
91
92 \begin_layout Plain Layout
93
94
95 \backslash
96 CJKindent
97 \end_layout
98
99 \end_inset
100
101
102 \end_layout
103
104 \begin_layout Title
105 The LyX Tutorial
106 \end_layout
107
108 \begin_layout Author
109 by the LyX Team
110 \begin_inset Foot
111 status collapsed
112
113 \begin_layout Plain Layout
114 对这个中文版有任何话想说请 Email 到 
115 \family typewriter
116 \lang english
117
118 \begin_inset CommandInset href
119 LatexCommand href
120 target "lyx-docs@lists.lyx.org"
121 type "mailto:"
122
123 \end_inset
124
125
126 \family default
127 \lang chinese-simplified
128
129 \end_layout
130
131 \end_inset
132
133
134 \end_layout
135
136 \begin_layout Standard
137 \begin_inset CommandInset toc
138 LatexCommand tableofcontents
139
140 \end_inset
141
142
143 \end_layout
144
145 \begin_layout Chapter
146 介绍
147 \end_layout
148
149 \begin_layout Section
150 欢迎来到 LyX!
151 \end_layout
152
153 \begin_layout Standard
154 这个文档是为那些不知道 LaTeX 或知之甚少的人准备的。不必担心,使用 LyX 不必学习 LaTeX。LyX 的目标就是提供一个所见即所得的
155  LaTeX 应用。为了高效的使用 LyX,还是需要学习一些东西的。
156 \end_layout
157
158 \begin_layout Standard
159 你会发现在其它字处理软件中常用的排版方式在 LyX 中都不能使用了,比如:在“.”后边输入两个空格,在段间输入三个空行。你以前使用的软件允许手动调整间距、字体等东
160 西,所以你不得不即录入又排版。LyX会做好排版的事情的,而你只需要转注于重要的东西:你正在写的内容。
161 \end_layout
162
163 \begin_layout Standard
164 继续读下去,了解更多 LyX。读完这篇教程,你会觉得物有所值的。
165 \end_layout
166
167 \begin_layout Section
168 本教程简介
169 \end_layout
170
171 \begin_layout Standard
172 在开始之前建议您先读一下 Introduction,那里解释了本文使用的注释方式。当你了解了各种字体的意义之后,我们先来说说本篇教程是干什么的。
173 \end_layout
174
175 \begin_layout Subsection
176 学习方式
177 \end_layout
178
179 \begin_layout Standard
180 本教程包含了例子和练习。学习中您应该试着输入我们让你输入的东西,完成所有练习,看看您是不是得到了正确的东西。为了方便,将本文档打印出来会是一个好选择。
181 \end_layout
182
183 \begin_layout Standard
184 如果对 LaTeX 比较熟悉的话,你将能够较快的阅读本教程,因为 LyX 的思想就是 LaTeX 思想的一种包装。LyX 自身也有很多特性是你想了解的。就算不想
185 继续读下去,你也应该看看 
186 \begin_inset CommandInset ref
187 LatexCommand ref
188 reference "sec:LaTeX-用户必读"
189
190 \end_inset
191
192 ,它是专门写给熟练的 LaTeX 用户的。
193 \end_layout
194
195 \begin_layout Subsection
196 本教程没有的
197 \end_layout
198
199 \begin_layout Itemize
200 LyX 全部特性的详细解释。
201 \end_layout
202
203 \begin_deeper
204 \begin_layout Standard
205 需要的话,请阅读 the 
206 \emph on
207 User's Guide。
208 \end_layout
209
210 \end_deeper
211 \begin_layout Itemize
212 LaTeX 的详细解释。
213 \end_layout
214
215 \begin_deeper
216 \begin_layout Standard
217 没必要这样做。要想知道用 LaTeX 在 LyX 中能做些什么,可以看看 the 
218 \emph on
219 Embedded
220 \begin_inset space ~
221 \end_inset
222
223 Objects
224 \emph default
225  manual。
226 \end_layout
227
228 \end_deeper
229 \begin_layout Standard
230 现在是开始你的第一个文档的时候了。
231 \end_layout
232
233 \begin_layout Chapter
234 初识 LyX
235 \end_layout
236
237 \begin_layout Section
238 第一个 LyX 文档
239 \end_layout
240
241 \begin_layout Standard
242 开始之前说几件事情,这会使本教程发挥更大的作用。
243 \end_layout
244
245 \begin_layout Standard
246 由于本教程不会提供所有信息,所以你需要找到其它的帮助文件。这很简单:启动 LyX,在帮助菜单中就有 the 
247 \emph on
248 User's Guide。
249 \shape italic
250 在写自己的文件时就可以读到它们了(它们本身就是很好的例子)。注意,当打开多个文件时,可以通过 View 菜单或文档标签进行切换。
251 \end_layout
252
253 \begin_layout Standard
254 我们假设你已经有了全功能的 LyX 和 LaTeX,包括 DVI、PDF 文件浏览器。一般来说,在各种操作系统上,在安装 LyX 的时候就已经做好了。
255 \end_layout
256
257 \begin_layout Standard
258 最后,我们提供了一个文件 
259 \family typewriter
260 example_raw.lyx,
261 \family default
262 给你练习使用。假想这个文件是由一个完全不知道 LyX 特性的人写的,在学习的过程中,我们会建议你修改这个文件的。example_raw.lyx 中也包含了修改的提
263 示信息。为了对比,我们还提供了一份 LyX 高手写的同样内容的文档:example_lyxified.lyx。
264 \end_layout
265
266 \begin_layout Standard
267 示例文档存在于 LyX 安装路径的 examples 目录下。打开示例文档,另存到自己的目录下,修改后输出到 DVI 文件看效果。
268 \end_layout
269
270 \begin_layout Standard
271 另外,examples 目录中还有很多其它的示例文件,它们将向您展示 LyX 的强大功能。当你忘记了某个功能怎么使用的时候,也可以回来看看这些文档。
272 \end_layout
273
274 \begin_layout Subsection
275 录入、查看、输出
276 \end_layout
277
278 \begin_layout Itemize
279 使用菜单 
280 \family sans
281 File\SpecialChar \menuseparator
282 New 打开新文件。
283 \end_layout
284
285 \begin_layout Itemize
286 输入一个句子: 
287 \family typewriter
288 This is my first LyX document!
289 \end_layout
290
291 \begin_layout Itemize
292 使用菜单 
293 \family sans
294 File\SpecialChar \menuseparator
295 Save
296 \begin_inset space ~
297 \end_inset
298
299 As 保存文件。
300 \end_layout
301
302 \begin_layout Itemize
303 运行 LaTeX 生成 DVI 文件,使用菜单 
304 \family sans
305 View\SpecialChar \menuseparator
306 DVI
307 \family default
308  或 工具栏按钮 
309 \begin_inset Graphics
310         filename ../../images/buffer-view_dvi.png
311         scale 75
312
313 \end_inset
314
315 。 LyX 将打开 DVI-viewer 程序显示文档打印时的样子。 
316 \begin_inset Foot
317 status collapsed
318
319 \begin_layout Plain Layout
320 保持 DVI-viewer在后台运行会节省时间。以后可以点击 
321 \family sans
322 View\SpecialChar \menuseparator
323 Update\SpecialChar \menuseparator
324 DVI
325 \family default
326  或工具栏按钮
327 \begin_inset Graphics
328         filename ../../images/buffer-update_dvi.png
329         scale 75
330
331 \end_inset
332
333 ,等 LyX 运算完成后切换到 DVI-viewer即可。
334 \end_layout
335
336 \end_inset
337
338
339 \end_layout
340
341 \begin_layout Itemize
342 使用菜单 
343 \family sans
344 File\SpecialChar \menuseparator
345 Export
346 \family default
347  将文档输出成希望的格式。
348 \end_layout
349
350 \begin_layout Standard
351 恭喜!你已经写出了第一个 LyX 文档。其余的细节,你会在其它手册中读到。
352 \end_layout
353
354 \begin_layout Subsection
355 简单操作
356 \end_layout
357
358 \begin_layout Standard
359 LyX 能够做到其它软件能做的绝大部分事情,如:自动换行、段落缩进……以下是几个简单操作的使用方法。
360 \end_layout
361
362 \begin_layout Description
363 撤消 LyX 有多级撤消功能,你可以使用 
364 \family sans
365 Edit\SpecialChar \menuseparator
366 Undo
367 \family default
368  (或工具拦按钮 
369 \begin_inset Graphics
370         filename ../../images/undo.png
371         scale 50
372         groupId In line
373
374 \end_inset
375
376 )来撤消本次编辑会话开始以来的所有操作。如果撤消过头了,可以选择 
377 \family sans
378 Edit\SpecialChar \menuseparator
379 Redo
380 \family default
381  (或工具栏按钮 
382 \begin_inset Graphics
383         filename ../../images/redo.png
384         scale 50
385         groupId In line
386
387 \end_inset
388
389 )恢复。 
390 \end_layout
391
392 \begin_deeper
393 \begin_layout Standard
394 目前撤消操作支持100步,而且撤消也不是能够支持所有更改的,比如对文档布局的更改就不能被撤消,这的确是一个 bug。
395 \end_layout
396
397 \end_deeper
398 \begin_layout Description
399 剪切/粘贴/复制 使用 
400 \family sans
401 Edit\SpecialChar \menuseparator
402 Cut
403 \family default
404  (工具栏按钮 
405 \begin_inset Graphics
406         filename ../../images/cut.png
407         scale 50
408         groupId In line
409
410 \end_inset
411
412 ), 
413 \family sans
414 Edit\SpecialChar \menuseparator
415 Copy
416 \family default
417  (工具栏按钮 
418 \begin_inset Graphics
419         filename ../../images/copy.png
420         scale 50
421         groupId In line
422
423 \end_inset
424
425 ),和 
426 \family sans
427 Edit\SpecialChar \menuseparator
428 Paste
429 \family default
430  (工具栏按钮 
431 \begin_inset Graphics
432         filename ../../images/paste.png
433         scale 50
434         groupId In line
435
436 \end_inset
437
438 ) 来实现剪切、复制和粘贴操作。或者也可通过鼠标中键来粘贴选中的文本(包括其它程序中选定的文本)。
439 \end_layout
440
441 \begin_layout Description
442 查找/替换 点击 
443 \family sans
444 Edit\SpecialChar \menuseparator
445 Find
446 \begin_inset space ~
447 \end_inset
448
449 &
450 \begin_inset space ~
451 \end_inset
452
453 Replace
454 \family default
455  (工具栏按钮 
456 \begin_inset Graphics
457         filename ../../images/dialog-show_findreplace.png
458         scale 50
459         groupId In line
460
461 \end_inset
462
463 ) ,在出现的对话框中点击按钮“
464 \family sans
465 Find
466 \begin_inset space ~
467 \end_inset
468
469 Next”
470 \family default
471  进行搜索,点击按钮“ 
472 \family sans
473 Replace”替换搜到的字词。
474 \family default
475
476 \begin_inset Foot
477 status open
478
479 \begin_layout Plain Layout
480 完成后关闭窗口,如果觉得方便的话也可一直开着它。LyX 中的大部分窗口都可以这样。使用时注意焦点的切换即可。
481 \end_layout
482
483 \end_inset
484
485  你还可以指定区分大小写或全字匹配,当然也可以反向搜索文档。
486 \end_layout
487
488 \begin_layout Description
489 字符格式 用 
490 \family sans
491 Edit\SpecialChar \menuseparator
492 Text
493 \begin_inset space ~
494 \end_inset
495
496 Style
497 \family default
498  对话框中的 toggle buttons ,可以
499 \shape italic
500 强调
501 \shape default
502 (默认斜体)、加粗或设置为
503 \noun on
504 无格式(
505 \noun default
506 字体一般较小,用于人名)。
507 \end_layout
508
509 \begin_layout Description
510 工具栏 菜单支边的工具栏提供了一些常用功能的按钮,例如:粘贴、打印。
511 \end_layout
512
513 \begin_layout Standard
514 当然,目前还没有输入足够多的内容以使所有这些功能可用。
515 \end_layout
516
517 \begin_layout Subsection
518 所见即所想:LyX 中的空白
519 \end_layout
520
521 \begin_layout Standard
522 对新用户来说,最难理解的是 LyX 处理空白的方式。敲多次回车只能得到一个空行;敲多次空格只能得到一个空格。在空白行上,连一个空格都无法得到。按下
523  Tab 键也不会移动一个 Tab 位;实际上就没有 Tab 位!在页面上方也没有标尺可供设置 Tab 位和边距。
524 \end_layout
525
526 \begin_layout Standard
527 很多字处理软件建立在 WYSIWYG 理念之上,也就是:看到的就是得到的(所见即所得)。LyX 不同,它建立在 WYSIWYM (所想即所得)的理念之上。你想什
528 么就输入什么,LyX 会处理排版的问题,这样保证了输出文件的美观。回车分段,空格断词,没理由在一行中输入好几次空格。Tab 根本就没有语法意义,所以
529  LyX 不支持它。使用 LyX,你将花费更多的时间去考虑文档的
530 \series bold
531 内容
532 \series default
533 ,而不是它的
534 \series bold
535 格式
536 \series default
537 。更多关于 WYSIWYM 的解释参见 
538 \emph on
539 Introduction。
540 \end_layout
541
542 \begin_layout Standard
543 LyX 的确也有不少精细调整文档格式的方法。毕竟 LyX 可能不会 100% 精确的按照你想的去排版。
544 \emph on
545 User's Guide 
546 \shape italic
547 包含了调整文档格式的详细方法,包括水平填充(HFills)和垂直距离(它们比空格、回车更加强大灵活);设置字体大小 、样式的方法;调整段落对齐方式的手段。你只需
548 要专心写你的文档,在最后细调一下文档格式就好了。使用普通的字处理软件,你会在写文档的整个过程中都被格式排版所困扰。
549 \begin_inset Foot
550 status open
551
552 \begin_layout Plain Layout
553
554 \shape italic
555 \emph on
556 译注:连 AbiWord 这样轻量级的字处理软件都有样式了,就不要说 MS Word、OOo 了。
557 \end_layout
558
559 \end_inset
560
561
562 \end_layout
563
564 \begin_layout Section
565 环境
566 \end_layout
567
568 \begin_layout Standard
569 文档的不同部分有不同的作用,我们称这些部分为“环境”(
570 \emph on
571 environments
572 \emph default
573 )。标题告诉读者新的话题(子话题)将会开始。某些文档含有特殊的环境,比如:期刊会有摘要和题目;书信就没有摘要和题目,但它有地址。
574 \end_layout
575
576 \begin_layout Standard
577 环境是 LyX 所见即所得哲学的重要部分。一个环境需要具体的定义:字体大小、样式、缩进、行间距等等。这个问题非常重要,因为一个给定环境的具体定义会随着文档类型的
578 变化而变化。比如:某期刊要求标题是黑体、18pt、居中,而另一个可能要求斜体、15pt、左对齐;不同的语言也有不同的缩进标准;参考文献的格式就变化更大了。LyX
579  会把你从这些格式中间拯救出来。
580 \end_layout
581
582 \begin_layout Standard
583 你可以使用工具栏上的环境下拉菜单
584 \begin_inset Graphics
585         filename ../clipart/ToolbarEnvBox.png
586         scale 50
587         groupId In line
588
589 \end_inset
590
591 来选择环境,它也能告诉你当前的环境是什么,其中“Standard”是文本的默认环境。现在我们将在你的新文档中添加几个环境,来看看它们是怎么工作的吧。
592 \end_layout
593
594 \begin_layout Subsection
595 节(
596 \family sans
597 Section
598 \family default
599 )与子节(Subsection)
600 \end_layout
601
602 \begin_layout Standard
603 在 LyX 文档的第一行输入“
604 \family typewriter
605 Introduction
606 \family default
607 ”,在环境下拉菜单中设为“节”(
608 \family sans
609 Section
610 \family default
611
612 \begin_inset Foot
613 status collapsed
614
615 \begin_layout Plain Layout
616 设定环境不需要选择整行(段),光标停留其中即可。若想一次改变多行的环境,则需要选定之。
617 \end_layout
618
619 \end_inset
620
621 , 确定你选择了“节”(
622 \family sans
623 Section
624 \family default
625 )而不是“节
626 \family sans
627 *
628 \family default
629 ”(
630 \family sans
631 Section*
632 \family default
633 )。LyX 将在前边加上“1”并把字体调大。现在敲回车,环境将从“节”(
634 \family sans
635 Section
636 \family default
637 )变回“标准”(Standard)。和多数环境类似,敲回车后环境将终止。输入文本:
638 \end_layout
639
640 \begin_layout LyX-Code
641 This is an introduction to my first LyX document.
642 \end_layout
643
644 \begin_layout Standard
645 再次回车,选择“节”(
646 \family sans
647 Section
648 \family default
649 )环境,LyX 将写上“2”并等待输入。现在输入“
650 \family typewriter
651 More Stuff
652 \family default
653 ”,LyX 会把它设置成节(
654 \family sans
655 Section
656 \family default
657 )标题的样式。
658 \end_layout
659
660 \begin_layout Standard
661 将光标定位到节 1 (Section
662 \begin_inset space ~
663 \end_inset
664
665 1)末尾,敲回车,再次设置为“节”(
666 \family sans
667 Section
668 \family default
669 ),LyX 会写上“2”并等待输入。输入“
670 \family typewriter
671 About This Document
672 \family default
673 ”。刚才的节 2 (Section
674 \begin_inset space ~
675 \end_inset
676
677 2),“More Stuff”,现在已经被改成了节 3 (Section
678 \begin_inset space ~
679 \end_inset
680
681 3)。你只需要确定哪些文字是节(
682 \family sans
683 Section
684 \family default
685 )标题,LyX 会处理编号和排版格式的,这就是所见即所想(WYSIWYM)的风格。
686 \end_layout
687
688 \begin_layout Standard
689 敲回车,回到“标准”(Standard)环境,输入下边 5 行文字:
690 \end_layout
691
692 \begin_layout LyX-Code
693 Sections and subsections are described below.
694 \end_layout
695
696 \begin_layout LyX-Code
697 Section Description
698 \end_layout
699
700 \begin_layout LyX-Code
701 Sections are bigger than subsections.
702 \end_layout
703
704 \begin_layout LyX-Code
705 Subsection description
706 \end_layout
707
708 \begin_layout LyX-Code
709 Subsections are smaller than sections.
710 \end_layout
711
712 \begin_layout Standard
713 点击第二行,在环境下拉菜单中设为“子节”(Subsection)。LyX 将会在前边加上“2.1”,并把字体调整的比正文大,比节(Section)标题小。接着把第
714  4 行也设置成为“子节”(Subsection),LyX 将在它前边加上“2.2”。如果在节 2 (Section 2)前边加上了别的节,节 2
715  将会自动变为节 3(Section 3),后边的子节也会跟着变成“3.1”和“3.2”。
716 \end_layout
717
718 \begin_layout Standard
719 文档的层级结构还有次子节 ( Subsubsection )、段 ( Paragraph ) 和子段 ( Subparagraph ),这些就由读者自行把玩吧。
720 段和子段的标题默认是不编号的,而且子段还有缩进,参阅 
721 \emph on
722 User's Guide
723 \emph default
724  得到更多解释以及如何改变它们。章(Chapter)是文档层级结构中最高的一级,只能在某些特定的 LyX 文档类型中才能使用它(见 
725 \begin_inset CommandInset ref
726 LatexCommand ref
727 reference "sec:文档类"
728
729 \end_inset
730
731 )。
732 \end_layout
733
734 \begin_layout Standard
735 你可能还希望一些节和子节是不编号的,LyX 有专门的环境实现这个功能。当把节的标题环境改为“节*
736 \begin_inset Quotes erd
737 \end_inset
738
739 (Section*)后,LyX 还将对它使用相同的字体,只是不再对它进行编号。相应的也有带“星”的子节和次子节环境。试着把一些节或子节的标题环境改为带星的,同时
740 看看其它的编号怎么随之改变。
741 \end_layout
742
743 \begin_layout Standard
744 练习:修改 example_raw.lyx 中的节和子节标题。
745 \end_layout
746
747 \begin_layout Subsection
748 列表(Lists)和子列表(sublists)
749 \end_layout
750
751 \begin_layout Standard
752 LyX 有好几种列表环境,在写提纲或者重新排序一个已有的列表时,这些列表环境会帮上大忙。不同的文档类型需要不同的列表环境:
753 \end_layout
754
755 \begin_layout Itemize
756 幻灯片使用带圆点的条目环境(
757 \family sans
758 Itemize
759 \family default
760 )。
761 \end_layout
762
763 \begin_layout Itemize
764 大纲使用带编号的枚举环境(
765 \family sans
766 Enumerate
767 \family default
768 )。
769 \end_layout
770
771 \begin_layout Itemize
772 名词解释常用描述环境(
773 \family sans
774 Description
775 \family default
776 )。
777 \end_layout
778
779 \begin_layout Itemize
780 列表环境(
781 \family sans
782 List
783 \family default
784 )和描述环境(
785 \family sans
786 Description
787 \family default
788 )差不多,只是对齐方式稍有不同。
789 \end_layout
790
791 \begin_layout Standard
792 现在我们写一个 LyX 有关优点的列表。在文档中输入:
793 \end_layout
794
795 \begin_layout Standard
796
797 \family typewriter
798 LyX is better than other word processors because: 
799 \end_layout
800
801 \begin_layout Standard
802 然后敲回车,并在环境下拉列表中选择条目环境(
803 \family sans
804 Itemize
805 \family default
806 )。LyX 会在行首加上圆点。继续输入:
807 \end_layout
808
809 \begin_layout LyX-Code
810 Typesetting is done for you.
811 \end_layout
812
813 \begin_layout LyX-Code
814 Math is WYSIWYG
815 \end_layout
816
817 \begin_layout LyX-Code
818 Lists are very easy to create!
819 \end_layout
820
821 \begin_layout Standard
822 和标题不同,列表环境在敲回车时不会终止,LyX 会认为你将继续写下一个条目。所以上边的输入将会产生三个列表项。重新选择标准环境(
823 \family sans
824 Standard
825 \family default
826 )或使用快捷键 
827 \family sans
828 Alt+P
829 \begin_inset space ~
830 \end_inset
831
832 S
833 \family default
834  才能退出列表环境。要在一个列表项中使用多个段落,可使用保护性中断(
835 \family sans
836 Protected
837 \begin_inset space ~
838 \end_inset
839
840 Break
841 \family default
842 ),按下 Ctrl + 回车即可。
843 \end_layout
844
845 \begin_layout Standard
846 你已经得到了一个漂亮的条目列表,你是不是已经迫不及待的想运行 LaTeX 看看它们打印出来的样子了?可如果您想给它们加上编号呢?你只需要选定整个列表
847 \begin_inset Foot
848 status collapsed
849
850 \begin_layout Plain Layout
851 如果不连前边一段也一起选上的话,你是无法选上第一个条目前边的圆点的;类似的,你也无法选定章节编号。这是有意如此的,因为随着文档类型和文字位置的不同,这些圆点和编
852 号也会发生变化。
853 \end_layout
854
855 \end_inset
856
857 ,然后选择枚举环境(
858 \family sans
859 Enumerate
860 \family default
861 )即可。如果你增删条目的话,LyX 会自动修改枚举编号的。
862 \end_layout
863
864 \begin_layout Standard
865 现在列表项还是处于被选定状态的,你可以再试试描述(
866 \family sans
867 Description
868 \family default
869 )和列表(
870 \family sans
871 List
872 \family default
873 )两种环境。这两种环境都是名词加定义的形式,描述环境前边的名词用黑体,列表环境的名词和后边的定义由“Tab”
874 \begin_inset Foot
875 status collapsed
876
877 \begin_layout Plain Layout
878 这里的Tab是排版Tab(它会自适应到最长的名词长度),而不是定长的打字机Tab。
879 \end_layout
880
881 \end_inset
882
883 分隔。前边的名词如果多于一个词的话,需要使用保护性空格(
884 \family sans
885 Protected
886 \begin_inset space ~
887 \end_inset
888
889 Blank
890 \family default
891 s)将它们分开。
892 \end_layout
893
894 \begin_layout Standard
895 练习:排版 
896 \family typewriter
897 example_raw.lyx
898 \family default
899  中的列表。
900 \end_layout
901
902 \begin_layout Standard
903 这些列表环境还可以嵌套使用,提纲就是最常见的例子。带编号或圆点的列表在子列表中会有不同的表现形式。更多详情参见 
904 \emph on
905 User's Guide
906 \emph default
907  。
908 \end_layout
909
910 \begin_layout Subsection
911 其它环境:诗、引用和更多
912 \end_layout
913
914 \begin_layout Standard
915 有两种引用环境:短一点的引用使用引用环境(
916 \family sans
917 Quote
918 \family default
919 );长一点的引用使用引文环境(
920 \family sans
921 Quotation
922 \family default
923 )。计算机代码使用代码环境(
924 \family sans
925 LyX-Code
926 \family default
927 ),该环境使用
928 \family typewriter
929 typewriter
930 \family default
931  字体,而且这里是 LyX 中唯一允许使用多个空格的地方。你还可以使用诗环境(
932 \family sans
933 Verse
934 \family default
935 )来写诗:回车分节,Ctrl + 回车断行。对所有环境的完整描述参见
936 \emph on
937  User's Guide
938 \emph default
939
940 \end_layout
941
942 \begin_layout Standard
943 练习:修改 
944 \family typewriter
945 example_raw.lyx
946 \family default
947  中的引用、代码、诗环境。
948 \end_layout
949
950 \begin_layout Chapter
951 编辑文档
952 \end_layout
953
954 \begin_layout Standard
955 前边的章节讲解了 LyX 的基本操作和环境的使用方法,使大家对 LyX 有了一个初步的了解。而大部分人使用 LyX 是为了写文档的,比如:论文、书、手册或书信。
956 本章将学习编辑完整的文档,你将学到文档类、标题、脚注、交叉引用、参考文献和目录的使用方法。
957 \end_layout
958
959 \begin_layout Section
960 文档类
961 \begin_inset CommandInset label
962 LatexCommand label
963 name "sec:文档类"
964
965 \end_inset
966
967
968 \end_layout
969
970 \begin_layout Standard
971 不同的文档有不同的排版方式,例如书籍是双面打印,文章是单面打印。文档还可能有特殊的环境,书信有发信人地址和签名两个环境,这两种环境在书籍和文章中就不起作用。Ly
972 X 的文档类
973 \begin_inset Foot
974 status collapsed
975
976 \begin_layout Plain Layout
977 for LaTeX users: this is equivalent to the LaTeX document class
978 \end_layout
979
980 \end_inset
981
982 会处理不同文档种类中不同的排版方式。本教程使用的就是书籍文档类。文档类是所见即所想哲学的一个重要部分,它告诉 LyX 怎样排版,所以你不需要知道太多。
983 \end_layout
984
985 \begin_layout Standard
986 你的文档可能是用文章(
987 \family sans
988 Article
989 \family default
990 )文档类
991 \begin_inset Foot
992 status collapsed
993
994 \begin_layout Plain Layout
995 That's usually the default document class
996 \end_layout
997
998 \end_inset
999
1000 的,换到其它的文档类(使用 
1001 \family sans
1002 Document\SpecialChar \menuseparator
1003 Settings
1004 \family default
1005  对话框)看看有什么不同。切换到书籍类时,你会发现在环境下拉框中大部分的选项差异不大,只是现在可以使用“章”环境(Chapter)了。如果不能确定应该使用哪种文
1006 档类,你可以看看环境下拉框里边的东西。
1007 \end_layout
1008
1009 \begin_layout Standard
1010 各种杂志期刊排版区别主要在于字体大小、单双栏、页眉等地方。随着计算机时代的到来,期刊开始接受电子投稿,只要建立相应的 LaTeX 样式文件(style
1011  files),作者们就可以提交正确排版的文章了。LyX 就可以通过 
1012 \family sans
1013 Article
1014 \begin_inset space ~
1015 \end_inset
1016
1017 (AMS) 文档类支持美国数学学会会刊。
1018 \begin_inset Foot
1019 status collapsed
1020
1021 \begin_layout Plain Layout
1022
1023 \family sans
1024 译注:别指望中国的出版社能支持 LaTeX 格式的投稿,支持 LaTeX 的能超过一个巴掌就阿弥陀佛吧。
1025 \end_layout
1026
1027 \end_inset
1028
1029
1030 \end_layout
1031
1032 \begin_layout Standard
1033 这是几个文档类的简单描述,更多信息参见 
1034 \emph on
1035 Additional Features
1036 \emph default
1037
1038 \end_layout
1039
1040 \begin_layout Standard
1041 \align center
1042 \begin_inset Tabular
1043 <lyxtabular version="3" rows="7" columns="2">
1044 <features tabularvalignment="middle">
1045 <column alignment="center" valignment="top" width="0pt">
1046 <column alignment="center" valignment="top" width="0pt">
1047 <row>
1048 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1049 \begin_inset Text
1050
1051 \begin_layout Plain Layout
1052 Name
1053 \end_layout
1054
1055 \end_inset
1056 </cell>
1057 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1058 \begin_inset Text
1059
1060 \begin_layout Plain Layout
1061 Notes
1062 \end_layout
1063
1064 \end_inset
1065 </cell>
1066 </row>
1067 <row>
1068 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1069 \begin_inset Text
1070
1071 \begin_layout Plain Layout
1072 文章(article)
1073 \end_layout
1074
1075 \end_inset
1076 </cell>
1077 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1078 \begin_inset Text
1079
1080 \begin_layout Plain Layout
1081 单面、无章
1082 \end_layout
1083
1084 \end_inset
1085 </cell>
1086 </row>
1087 <row>
1088 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1089 \begin_inset Text
1090
1091 \begin_layout Plain Layout
1092 文章 (article AMS)
1093 \end_layout
1094
1095 \end_inset
1096 </cell>
1097 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1098 \begin_inset Text
1099
1100 \begin_layout Plain Layout
1101
1102 \family sans
1103 美国数学学会专用
1104 \end_layout
1105
1106 \end_inset
1107 </cell>
1108 </row>
1109 <row>
1110 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1111 \begin_inset Text
1112
1113 \begin_layout Plain Layout
1114
1115 \family sans
1116 报告(
1117 \family default
1118 report
1119 \family sans
1120
1121 \end_layout
1122
1123 \end_inset
1124 </cell>
1125 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1126 \begin_inset Text
1127
1128 \begin_layout Plain Layout
1129
1130 \family sans
1131 比文章长、双面
1132 \end_layout
1133
1134 \end_inset
1135 </cell>
1136 </row>
1137 <row>
1138 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1139 \begin_inset Text
1140
1141 \begin_layout Plain Layout
1142
1143 \family sans
1144 书籍(
1145 \family default
1146 book
1147 \family sans
1148
1149 \end_layout
1150
1151 \end_inset
1152 </cell>
1153 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1154 \begin_inset Text
1155
1156 \begin_layout Plain Layout
1157
1158 \family sans
1159 报告加上前后的一些零碎儿
1160 \end_layout
1161
1162 \end_inset
1163 </cell>
1164 </row>
1165 <row>
1166 <cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
1167 \begin_inset Text
1168
1169 \begin_layout Plain Layout
1170
1171 \family sans
1172 幻灯片(
1173 \family default
1174 presentation
1175 \family sans
1176
1177 \end_layout
1178
1179 \end_inset
1180 </cell>
1181 <cell alignment="center" valignment="top" bottomline="true" leftline="true" rightline="true" usebox="none">
1182 \begin_inset Text
1183
1184 \begin_layout Plain Layout
1185 透明
1186 \end_layout
1187
1188 \end_inset
1189 </cell>
1190 </row>
1191 <row>
1192 <cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
1193 \begin_inset Text
1194
1195 \begin_layout Plain Layout
1196 书信(letter)
1197 \end_layout
1198
1199 \end_inset
1200 </cell>
1201 <cell alignment="center" valignment="top" bottomline="true" leftline="true" rightline="true" usebox="none">
1202 \begin_inset Text
1203
1204 \begin_layout Plain Layout
1205 包含地址、签名等特殊环境
1206 \end_layout
1207
1208 \end_inset
1209 </cell>
1210 </row>
1211 </lyxtabular>
1212
1213 \end_inset
1214
1215
1216 \end_layout
1217
1218 \begin_layout Section
1219 模板:写一封信
1220 \end_layout
1221
1222 \begin_layout Standard
1223 要写信,你只需要新建一个文件并从 
1224 \family sans
1225 Document\SpecialChar \menuseparator
1226 Settings 对话框中设定书信文档类就行了。但每次写信都需要设定发信人地址、收信人地址、正文、签名等环境,LyX 的书信模板可以省下不少时间
1227 ,你只要替换模板中相应部分的文字即可。
1228 \end_layout
1229
1230 \begin_layout Standard
1231 点击菜单 
1232 \family sans
1233 File\SpecialChar \menuseparator
1234 New
1235 \begin_inset space ~
1236 \end_inset
1237
1238 from
1239 \begin_inset space ~
1240 \end_inset
1241
1242 Template,并选择 
1243 \family typewriter
1244 letter.lyx
1245 \family default
1246  
1247 \family sans
1248 模板。保存打印,看看不同的环境是怎么排版的。
1249 \end_layout
1250
1251 \begin_layout Standard
1252 在环境下拉列表框中,你会看到几个书信文档类独有的环境,如:我的地址环境(
1253 \family sans
1254 My
1255 \begin_inset space ~
1256 \end_inset
1257
1258 Address
1259 \family default
1260 )。建议在这儿把这些环境一个一个的都试试。你可能会注意到签名环境(
1261 \family sans
1262 Signature
1263 \family default
1264 ),签名文字前边有个红色的“
1265 \family sans
1266 Signature
1267 \family default
1268 :”标签,该标签并不出现在打印出来的书信中。它就是告诉你这里有你设置的签名,它出现在哪里也不重要,LyX 是所见即所想的,无论把它放在哪里,LyX
1269  都知道在打印时它应该出现在最后。
1270 \end_layout
1271
1272 \begin_layout Standard
1273 模板本身是一个 LyX 常规文件,你可以修改一下另存为一个新的模板。下次写信时,使用新模板会节省时间。这里我们没有建议的练习,你就给某人写封信吧。
1274 \begin_inset Foot
1275 status collapsed
1276
1277 \begin_layout Plain Layout
1278 One warning, if you're writing from a template.
1279  If you erase all of the text in an environment — for example, if you erase
1280  the whole 
1281 \family sans
1282 My
1283 \begin_inset space ~
1284 \end_inset
1285
1286 Address
1287 \family default
1288  field so that you can replace it with your own — and then you move the
1289  cursor without writing any text, the environment may disappear.
1290  This is because most environments cannot exist without any text in them.
1291  Just reselect the environment from the 
1292 \family sans
1293 Environment
1294 \family default
1295  box to get it back.
1296 \end_layout
1297
1298 \end_inset
1299
1300
1301 \end_layout
1302
1303 \begin_layout Standard
1304 鉴于使用模板能够节省大量时间,我们强烈建议您使用它。另外它们还能够帮助人们学习其它新奇的文档类。如果您想把 LyX 介绍给不太会用计算机的人使用的话,模板也能帮
1305 上忙。模板还能降低初学者对 LyX 的恐惧感。
1306 \end_layout
1307
1308 \begin_layout Section
1309 文档标题
1310 \end_layout
1311
1312 \begin_layout Standard
1313 标题包括题目、作者、日期、摘要。LyX 把标题视为文档中单独的一部分。
1314 \end_layout
1315
1316 \begin_layout Standard
1317 新建一个 LyX 文档,令其使用文章文档类(
1318 \family sans
1319 Article
1320 \family default
1321 )。
1322 \begin_inset Foot
1323 status collapsed
1324
1325 \begin_layout Plain Layout
1326 You should not be using the letter any more, since the 
1327 \family sans
1328 Letter
1329 \family default
1330  document class doesn't allow titles.
1331 \end_layout
1332
1333 \end_inset
1334
1335 在第一行写上题目并令其为标题环境(
1336 \family sans
1337 Title
1338 \family default
1339 ),下一行写上你的名字并设为作者环境(
1340 \family sans
1341 Author
1342 \family default
1343 ),再下一行写上日期并设为日期环境(
1344 \family sans
1345 Date
1346 \family default
1347 )。然后再写上一两段摘要,并设为摘要环境(
1348 \family sans
1349 Abstract
1350 \family default
1351 )。看看这些东西打印出来后是什么样子的。如果把文档设为书籍类,将会得到一个单独的标题页,看起来就像本教程的第一页。
1352 \end_layout
1353
1354 \begin_layout Standard
1355 练习:在 
1356 \family typewriter
1357 example_raw.lyx
1358 \family default
1359  中修改标题、日期、作者。
1360 \end_layout
1361
1362 \begin_layout Section
1363 标签(Labels)与交叉引用(Cross-References)
1364 \end_layout
1365
1366 \begin_layout Standard
1367 你可以为章节标题、列表项、公式、脚注、浮动体(floats)添加标签,之后可在文档的其它部分通过交叉引用引用它们,可以引用章节编号也可以引用页码,LyX
1368  当然也会自动计算交叉引用的编号。自动标签和交叉引用是 LyX 相对于其它字处理软件的显著优点。
1369 \end_layout
1370
1371 \begin_layout Subsection
1372 标签
1373 \end_layout
1374
1375 \begin_layout Standard
1376 我们回到第一个文档的第二节,它的标题是“About This Document”。将光标定位至该行末尾,选择 
1377 \family sans
1378 Insert\SpecialChar \menuseparator
1379 Label 或工具栏按钮
1380 \family default
1381  
1382 \begin_inset Graphics
1383         filename ../../images/label-insert.png
1384         scale 50
1385         groupId In line
1386
1387 \end_inset
1388
1389 。在对话框中输入标签名,点击 OK 后,标签名将会出现在行尾。
1390 \end_layout
1391
1392 \begin_layout Standard
1393 节标签可以放在节的任意位置,节的引用将会指向离标签最近的一个节或子节。你可以把节标签放在节标题上,或者是节的第一行上边,这样可以保证引用的页码会是节的开始页。
1394 \end_layout
1395
1396 \begin_layout Standard
1397 到目前为止,我们还没做什么事情,输出的 DVI 文件也不会有什么变化,因为标签是不会出现在打印文档中的。现在已经添加了一个标签,下边我们将会通过交叉引用来引用它
1398
1399 \end_layout
1400
1401 \begin_layout Subsection
1402 交叉引用
1403 \end_layout
1404
1405 \begin_layout Standard
1406 将光标定位到文档的节 2,输入
1407 \end_layout
1408
1409 \begin_layout LyX-Code
1410 If you want to know more about this document, then see 
1411 \begin_inset Newline newline
1412 \end_inset
1413
1414 section, which can be found on page.
1415 \end_layout
1416
1417 \begin_layout Standard
1418 然后将光标放在单词“section”后边,选择 
1419 \family sans
1420 Insert\SpecialChar \menuseparator
1421 Cross
1422 \begin_inset space ~
1423 \end_inset
1424
1425 Reference 或点击工具栏按钮
1426 \family default
1427  
1428 \begin_inset Graphics
1429         filename ../../images/dialog-show-new-inset_ref.png
1430         scale 50
1431         groupId In line
1432
1433 \end_inset
1434
1435  调出交叉引用对话框。你将会看到可用的标签列表,当然现在只有一个:
1436 \begin_inset Quotes eld
1437 \end_inset
1438
1439 sec:About-This-Document
1440 \begin_inset Quotes erd
1441 \end_inset
1442
1443 ,选定它并点击应用(
1444 \family sans
1445 Apply
1446 \family default
1447 )按钮。现在再把光标定位到单词“page”后边,并把引用格式改为页码,最后再点击应用。(为了保证排版的正确性,应该在单词“section”和引用之间放置一个保护
1448 性空格(
1449 \family sans
1450 Protected
1451 \begin_inset space ~
1452 \end_inset
1453
1454 Blank
1455 \family default
1456 )。对页码的引用也是这样。)
1457 \end_layout
1458
1459 \begin_layout Standard
1460 另外还可以在标签上右击,在上下文菜单(右键菜单)中选择“复制为引用”(
1461 \family sans
1462 Copy as Reference
1463 \family default
1464 )。这样当前标签的交叉引用就已经复制到了剪贴板中,在需要的地方粘贴即可。
1465 \end_layout
1466
1467 \begin_layout Standard
1468 LyX 会将交叉引用放在光标所在位置。在打印出来的文档中,引用将会被替换成页码或节编号(这要看引用格式是怎么设置的了)。在输出的 DVI 文件中,我们会看到对节
1469  2(Section
1470 \begin_inset space ~
1471 \end_inset
1472
1473 2)和页 1(Page
1474 \begin_inset space ~
1475 \end_inset
1476
1477 1)的引用。
1478 \end_layout
1479
1480 \begin_layout Standard
1481 点击交叉引用将会出现交叉引用对话框,点击转至标签(
1482 \family sans
1483 Go
1484 \begin_inset space ~
1485 \end_inset
1486
1487 to
1488 \begin_inset space ~
1489 \end_inset
1490
1491 Label
1492 \family default
1493 ),光标将会定位到引用标签。这个功能还真有点像超链接。
1494 \end_layout
1495
1496 \begin_layout Subsection
1497 关于标签的更多讨论
1498 \end_layout
1499
1500 \begin_layout Standard
1501 前边说过,LyX 会自动计算交叉引用的编号,现在来试试这个功能。在节 2 前边添加一个新节,更新 DVI 输出文件,对节的交叉引用已经变成 3
1502  了。再把“About this Document”设置成子节(subsection),引用将会从 3 变为 2.1 。当然,不在标签前边添加一整页文字的话,引用
1503 的页码是不会改变的。
1504 \end_layout
1505
1506 \begin_layout Standard
1507 你可以再多添加几个标签,在其它地方引用一下。如果使用交叉引用比较多的话,开着交叉引用对话框是个好主意。
1508 \end_layout
1509
1510 \begin_layout Standard
1511
1512 \shape italic
1513 \emph on
1514 还可以从 
1515 \shape default
1516 User's Guide
1517 \emph default
1518  
1519 \shape italic
1520 \emph on
1521 那里,复制些文字过来
1522 \begin_inset Foot
1523 status collapsed
1524
1525 \begin_layout Plain Layout
1526 By the way, copying a chapter title may cause an error, because chapters
1527  aren't allowed in the article class, see section
1528 \begin_inset space ~
1529 \end_inset
1530
1531
1532 \begin_inset CommandInset ref
1533 LatexCommand ref
1534 reference "sec:文档类"
1535
1536 \end_inset
1537
1538 .
1539  If this happens, just delete the chapter title.
1540 \end_layout
1541
1542 \end_inset
1543
1544 ,检验一下对页码的引用是不是正确。
1545 \end_layout
1546
1547 \begin_layout Standard
1548 练习:修正 
1549 \family typewriter
1550 example_raw.lyx
1551 \family default
1552  中的引用。
1553 \end_layout
1554
1555 \begin_layout Section
1556 脚注(Footnotes)与旁注(Margin Notes)
1557 \end_layout
1558
1559 \begin_layout Standard
1560 点击工具栏按钮 
1561 \begin_inset Graphics
1562         filename ../../images/footnote-insert.png
1563         scale 50
1564         groupId In line
1565
1566 \end_inset
1567
1568  或菜单 
1569 \family sans
1570 Insert\SpecialChar \menuseparator
1571 Footnote,将会在当前位置插入脚注。在文档中找到单词“LyX”,将光标定位在它后边,点击
1572 \family default
1573 工具栏按钮 
1574 \begin_inset Graphics
1575         filename ../../images/footnote-insert.png
1576         scale 50
1577         groupId In line
1578
1579 \end_inset
1580
1581 ,脚注框将会出现在“LyX”后边,可以在里边输入脚注文字,现在输入
1582 \end_layout
1583
1584 \begin_layout LyX-Code
1585 LyX is a typesetting word processor.
1586 \end_layout
1587
1588 \begin_layout Standard
1589 脚注文字前边有一个灰框,写着“脚注 x”(foot x),这里的“x”是脚注编号,点击它,脚注框将会关闭,光剩下那个灰框,这个动作称为“折叠”(folding)
1590 ,再次点击又会“展开”(unfold)。以后可以随时展开它重新编辑脚注文字。
1591 \end_layout
1592
1593 \begin_layout Standard
1594 这一段已经过时,跳过不译。
1595 \end_layout
1596
1597 \begin_layout Standard
1598 脚注也可以像普通文字那样剪切、粘贴,选定脚注的灰框后就可以粘贴了。另外,选定一段文本再点击按钮 
1599 \begin_inset Graphics
1600         filename ../../images/footnote-insert.png
1601         scale 50
1602         groupId In line
1603
1604 \end_inset
1605
1606 ,你就可以将一段文本转换为脚注了。要将从脚注变为常规文字,只需要将光标定位在脚注文字的最前边后再按下退格键(
1607 \family sans
1608 Backspace
1609 \family default
1610 ),或者将光标定位在脚注文字的最后边再按下删除键(
1611 \family sans
1612 Delete
1613 \family default
1614 )。
1615 \end_layout
1616
1617 \begin_layout Standard
1618 使用菜单 
1619 \family sans
1620 Insert\SpecialChar \menuseparator
1621 Marginal
1622 \begin_inset space ~
1623 \end_inset
1624
1625 Note 或工具栏按钮 
1626 \family default
1627
1628 \begin_inset Graphics
1629         filename ../../images/marginalnote-insert.png
1630         scale 50
1631         groupId In line
1632
1633 \end_inset
1634
1635 ,可以添加旁注。旁注和脚注从功能上说是类似的,其不同之处在于:
1636 \end_layout
1637
1638 \begin_layout Itemize
1639 屏幕上旁注显示为“旁注”(margin),脚注显示为“脚注”(foot)。
1640 \end_layout
1641
1642 \begin_layout Itemize
1643 旁注文字显示在页面旁边,脚注文字显示在页面底部。
1644 \end_layout
1645
1646 \begin_layout Itemize
1647 旁注不编号。
1648 \end_layout
1649
1650 \begin_layout Standard
1651 将脚注转变为常规文字,再把它们转变为旁注。运行 LaTeX 看看旁注是什么样的。
1652 \end_layout
1653
1654 \begin_layout Standard
1655 练习:修正 
1656 \family typewriter
1657 example_raw.lyx 
1658 \family default
1659 中的脚注
1660 \family typewriter
1661
1662 \end_layout
1663
1664 \begin_layout Section
1665 参考文献
1666 \family sans
1667 (Bibliography
1668 \family default
1669
1670 \begin_inset CommandInset label
1671 LatexCommand label
1672 name "sec:参考文献"
1673
1674 \end_inset
1675
1676
1677 \end_layout
1678
1679 \begin_layout Standard
1680 参考文献和交叉引用有点像,它在文档末尾有一个引用列表,你可以在文档中引用它们。和章节标题一样,LyX 和 LaTeX也会为您自动计算参考文献的编号,当编号改变时
1681 ,引用也会随之改变。
1682 \end_layout
1683
1684 \begin_layout Standard
1685 定位至文档末尾并切换至参考文献环境(
1686 \family sans
1687 Bibliography
1688 \family default
1689 ),你输入的每一个段落都将成为一个被引用对象。现在输入第一个引用项:“
1690 \family typewriter
1691 The Lyx Tutorial, by the LyX Documentation Team
1692 \family default
1693 ”。LyX 将会在每个引用项前边的框加上编号,点击引用项前边的框参考文献项(
1694 \family sans
1695 Bibliography
1696 \begin_inset space ~
1697 \end_inset
1698
1699 item
1700 \family default
1701 )对话框就会出现。其中“键”(key)是 LyX 中标识该引用项用的,标签(
1702 \family sans
1703 Label
1704 \family default
1705 )将会出现在输出文档中。标签项没有被设定时(默认如此),输出文档中就会出现参考文献的编号。为了方便记忆,把“键”(key)设定为“lyxtutorial”。
1706 \end_layout
1707
1708 \begin_layout Standard
1709 现在将光标定位至文档中要引用该文献的地方,选择 
1710 \family sans
1711 Insert\SpecialChar \menuseparator
1712 Citation 或工具栏按钮 
1713 \family default
1714
1715 \begin_inset Graphics
1716         filename ../../images/dialog-show-new-inset_citation.png
1717         scale 50
1718         groupId In line
1719
1720 \end_inset
1721
1722 ,将出现引用对话框(
1723 \family sans
1724 Citation
1725 \family default
1726  dialog)。对话框中左侧
1727 \begin_inset Foot
1728 status collapsed
1729
1730 \begin_layout Plain Layout
1731 原文误写为右侧
1732 \end_layout
1733
1734 \end_inset
1735
1736 面板列出了可用的文献项,选择“lyxtutorial”并点击添加按钮(Add)指定将引用的文献(可指定多个),最后点击确定或应用按钮插入文献引用(原文中少了这一
1737 步操作)。查看输出文件,你会看到方括号中以编号或标签的形式引用了文档末尾的参考文献项。
1738 \end_layout
1739
1740 \begin_layout Standard
1741 引用对话框中的注释字段会在方括号中引用文献后边添加一个注释,用以说明引用的是哪一页或哪一章。要想引用文献的标签而不是编号的话,在参考文献项对话框(
1742 \family sans
1743 Bibliography
1744 \begin_inset space ~
1745 \end_inset
1746
1747 item
1748 \family default
1749  dialog)中设定标签值即可。更多信息参见 
1750 \emph on
1751 User's Guide
1752 \emph default
1753
1754 \end_layout
1755
1756 \begin_layout Standard
1757 练习:修正 
1758 \family typewriter
1759 example_raw.lyx
1760 \family default
1761  中的参考文献项和引用。
1762 \end_layout
1763
1764 \begin_layout Section
1765 目录(Table of Contents)
1766 \end_layout
1767
1768 \begin_layout Standard
1769 用 LyX 在文档开始添加目录非常简单:在文档标题后敲回车,选择 
1770 \family sans
1771 Insert\SpecialChar \menuseparator
1772 List
1773 \begin_inset space ~
1774 \end_inset
1775
1776 /
1777 \begin_inset space ~
1778 \end_inset
1779
1780 TOC\SpecialChar \menuseparator
1781 Table
1782 \begin_inset space ~
1783 \end_inset
1784
1785 of
1786 \begin_inset space ~
1787 \end_inset
1788
1789 Contents 就可插入目录了。这时文字“
1790 \family default
1791 Table of Contents
1792 \family sans
1793 ”以按钮的形式出现在文档的第一行。
1794 \end_layout
1795
1796 \begin_layout Standard
1797 输出文档后,你会发现目录已经生成了,它列出了文档中的章节标题。修改文档的章节后,重新输出文档,目录也会随之改变。
1798 \end_layout
1799
1800 \begin_layout Standard
1801 为了保证文档的可读性,LyX 的编辑窗口中并不显示目录内容。选择 
1802 \family sans
1803 Document\SpecialChar \menuseparator
1804 Outline 或工具栏按钮 
1805 \family default
1806
1807 \begin_inset Graphics
1808         filename ../../images/dialog-toggle_toc.png
1809         scale 50
1810         groupId In line
1811
1812 \end_inset
1813
1814 ,将在一个新开的提纲窗口(
1815 \family sans
1816 Outline
1817 \family default
1818  window)中显示目录内容。就算你没在文档中插入目录,这一操作依然有效。当你需要在文档各部分间快速切换时,这一工具会变得相当有用。在提纲窗口中点击某一章节标
1819 题将会高亮显示该行,并在编辑窗口中定位至该章节。你也可以使用方向键在目录中移动
1820 \begin_inset Foot
1821 status collapsed
1822
1823 \begin_layout Plain Layout
1824 本人测试无效,原因不明。
1825 \end_layout
1826
1827 \end_inset
1828
1829 。编辑文档时开着提纲窗口将会很方便。导航菜单(
1830 \family sans
1831 Navigate
1832 \family default
1833 )也能提供类似功能。
1834 \end_layout
1835
1836 \begin_layout Standard
1837 删掉 Table of Contents 按钮就能删掉目录了。
1838 \end_layout
1839
1840 \begin_layout Standard
1841 练习:修正 
1842 \family typewriter
1843 example_raw.lyx
1844 \family default
1845  中的目录。
1846 \end_layout
1847
1848 \begin_layout Chapter
1849 数学公式
1850 \end_layout
1851
1852 \begin_layout Standard
1853 不少科学家使用 LaTeX,这是因为它能够输出漂亮的公式,还不用使用其它字处理软件的控制字和它们的公式编辑器。但这些科学家中有不少人觉得 LaTeX
1854  很难用,因为它用起来不像是在写文章,而像是在编程。LyX 能够很好的解决这个问题,它对公式能够实现所见即所想。如果熟悉 LaTeX 的话,你会发现以前常用的
1855  LaTeX 的数学命令都能被 LyX 正确识别,而且能够显示成最后输出时的样子。如果不会使用 LaTeX的话,你照样能通过数学面板简单快速的输入漂亮的数学公式
1856
1857 \end_layout
1858
1859 \begin_layout Section
1860 数学模式
1861 \end_layout
1862
1863 \begin_layout Standard
1864 在你的文档中输入:
1865 \end_layout
1866
1867 \begin_layout LyX-Code
1868 I like what Einstein said, E=mc^2, because it's so simple.
1869  
1870 \end_layout
1871
1872 \begin_layout Standard
1873 现在你的公式并不能被正确显示,因为 LyX 并不知道你是在输入公式,所以它按照常规文本来处理输入的公式。
1874 \end_layout
1875
1876 \begin_layout Standard
1877 要输入公式,只要点击工具栏上的按钮 
1878 \begin_inset Graphics
1879         filename ../../images/math-mode.png
1880         scale 50
1881         groupId In line
1882
1883 \end_inset
1884
1885  或使用菜单 
1886 \family sans
1887 Insert\SpecialChar \menuseparator
1888 Math\SpecialChar \menuseparator
1889 Inline
1890 \begin_inset space ~
1891 \end_inset
1892
1893 Formula,LyX 就会插入一个蓝色方框,这就是一个空的公式。现在再输入 
1894 \family typewriter
1895 E=mc^2 就行了。在公式中输入字符后,蓝色方框会消失。按下 Esc 退出公式输入状态,公式四角的紫色标记会消失并将光标定位在公式右边。再输入文字时,LyX
1896  会按照常规字符来处理它们的。
1897 \end_layout
1898
1899 \begin_layout Standard
1900 将文档输出后,你会看到公式已经被正确排版了。等号两边都留有间距,数字“2”也被放到了上标的位置。在数学模式下数字就被看作数字处理,英文字符被视为变量并使用斜体排
1901 版。
1902 \end_layout
1903
1904 \begin_layout Standard
1905 LyX 的公式编辑器是所见即所得哲学的又一个例子。LaTeX 中用文本和命令输入公式,如:
1906 \backslash
1907 sqrt{2},将文档输出后才能看到公式的真正样子,在编辑状态下,一般人是很难发现所输入公式的错误的。虽然 LyX 并没有试着让公式在编辑状态下就显示的非常完美
1908 ,但它的确让人看到了所输入公式的样子。输出时 LaTeX 再接手对公式进行专业的排版。
1909 \begin_inset Foot
1910 status collapsed
1911
1912 \begin_layout Plain Layout
1913 译注:如果你设置了即时预览,LyX 在公式退出编辑状态后就会将公式显示为文档输出后的样子!
1914 \end_layout
1915
1916 \end_inset
1917
1918
1919 \end_layout
1920
1921 \begin_layout Section
1922 在公式中导航
1923 \end_layout
1924
1925 \begin_layout Standard
1926 现在把 
1927 \begin_inset Formula $E=mc^{2}$
1928 \end_inset
1929
1930  改为 
1931 \begin_inset Formula $E=1+mc^{2}$
1932 \end_inset
1933
1934 。使用方向键将光标移入公式中,公式四角会出现紫色标记告诉你现在正在编辑公式。按下方向键将光标定位在等号后边,输入“1+”。使用方向键将光标移出公式或使用
1935  Esc 退出公式编辑状态。
1936 \end_layout
1937
1938 \begin_layout Standard
1939 在公式中的编辑操作和常规文字的编辑没有区别,不再详述。
1940 \end_layout
1941
1942 \begin_layout Standard
1943 如果想把 
1944 \begin_inset Formula $E=mc^{2}$
1945 \end_inset
1946
1947  改为 
1948 \begin_inset Formula $E=mc^{2.5}+1$
1949 \end_inset
1950
1951 ,你需要将光标定位至公式相应的位置上修改即可。要注意的是上下标的编辑方式,如果使用鼠标进行定位的话,公式正文和上下标的位置是不容易区分的。你可用方向键将光标定位
1952 到字母“c”后边、数字“2”前边,按下方向键“上”后你就可以修改上标了。完成后再按方向键“下”或空格回到公式正文编辑状态。
1953 \end_layout
1954
1955 \begin_layout Section
1956 指数与上下标
1957 \end_layout
1958
1959 \begin_layout Standard
1960 输入指数时,你可以使用界面下方的工具栏或直接输入“^”,LyX 会在上标位置放置一个蓝色方框,接下来输入的字符会被视为上标。上标输入完成后按空格回到公式正文编辑
1961 状态。类似指数的输入,输入下标只需键入“_”。
1962 \end_layout
1963
1964 \begin_layout Standard
1965 练习:将 
1966 \family typewriter
1967 example_raw.lyx
1968 \family default
1969  中的公式 1 改为数学模式。
1970 \end_layout
1971
1972 \begin_layout Section
1973 数学工具栏
1974 \end_layout
1975
1976 \begin_layout Standard
1977 使用数学工具栏可以输入各种符号和复杂的公式。虽然使用键盘和菜单也能实现这些功能,但现在我们只讨论如何使用数学工具栏。以后你可以从其它手册中学到如何使用快捷键输入
1978
1979 \end_layout
1980
1981 \begin_layout Standard
1982 进入公式编辑状态后,数学工具栏会自动出现在界面下方。你也可以使用菜单 
1983 \family sans
1984 View\SpecialChar \menuseparator
1985 Toolbars\SpecialChar \menuseparator
1986 Math 将其永久调出。
1987 \end_layout
1988
1989 \begin_layout Subsection
1990 希腊字母与符号
1991 \end_layout
1992
1993 \begin_layout Standard
1994 使用数学工具栏你可以输入很多数学符号,包括:各种箭头、关系、运算符、求和求积符号。求和、求积的上下限可以使用上下标实现。
1995 \end_layout
1996
1997 \begin_layout Standard
1998 在这里你无所不能。
1999 \end_layout
2000
2001 \begin_layout Subsection
2002 根号、重音与定界符
2003 \end_layout
2004
2005 \begin_layout Standard
2006 点击按钮 
2007 \begin_inset Graphics
2008         filename ../../images/math/sqrt.png
2009         scale 50
2010
2011 \end_inset
2012
2013 ,LyX 会插入根号并将光标定位在根号下的蓝色方框中。你可以在里边输入任何公式符号,LyX 会自动缩放根号大小以适应输入的公式。
2014 \end_layout
2015
2016 \begin_layout Standard
2017 可以使用重音修饰单个字符(
2018 \begin_inset Formula $\overrightarrow{v}$
2019 \end_inset
2020
2021 )或一组字符(
2022 \begin_inset Formula $\overrightarrow{a+b}$
2023 \end_inset
2024
2025 ),方法都是相同的。点击按钮 
2026 \begin_inset Graphics
2027         filename ../../images/math/hat.png
2028         scale 50
2029         groupId In line
2030
2031 \end_inset
2032
2033 ,LyX 将插入该修饰并附带一个输入点,在这里输入字符即可。有两种修饰类型:一个是自动缩放的;另一个是固定尺寸的。固定尺寸的适合修饰单个字符。
2034 \end_layout
2035
2036 \begin_layout Standard
2037 定界符(小括号、中括号、大括号)的用法都差不多,点击按钮 
2038 \begin_inset Graphics
2039         filename ../../images/dialog-show_mathdelimiter.png
2040         scale 50
2041         groupId In line
2042
2043 \end_inset
2044
2045  出现一个对话框,在里边选择你需要的即可。默认时,两边的定界符是匹配的,取消“keep matched”复选框后也可以把两边的定界符设置成不同的。例如:
2046 \begin_inset Formula $a=\left\langle 7\right.$
2047 \end_inset
2048
2049 ,“7”的右边就没有使用定界符。
2050 \end_layout
2051
2052 \begin_layout Standard
2053 觉得麻烦的话也可以直接用键盘输入括号,不过这样输入的括号和常规文本一样都是固定大小的。如果括号中有大个的分式或矩阵的话,公式就会很难看,看了下边的公式你就明白了
2054
2055 \begin_inset Formula 
2056 \[
2057 (\frac{\frac{1}{2}}{\frac{2}{\frac{1}{3}}+\sqrt{2}})=\left(\frac{\frac{1}{2}}{\frac{2}{\frac{1}{3}}+\sqrt{2}}\right)
2058 \]
2059
2060 \end_inset
2061
2062
2063 \end_layout
2064
2065 \begin_layout Standard
2066 选定公式的一部分后再从面板插入根号、重音或定界符,看看发生了什么?
2067 \end_layout
2068
2069 \begin_layout Standard
2070 练习:把 
2071 \begin_inset Formula $f=ma$
2072 \end_inset
2073
2074  变为 
2075 \begin_inset Formula $\overrightarrow{f}=m\overrightarrow{a}$
2076 \end_inset
2077
2078
2079 \end_layout
2080
2081 \begin_layout Subsection
2082 分式
2083 \end_layout
2084
2085 \begin_layout Standard
2086 使用数学工具栏按钮 
2087 \begin_inset Graphics
2088         filename ../../images/math/frac.png
2089         scale 50
2090         groupId In line
2091
2092 \end_inset
2093
2094  插入分式,LyX 将在分式上创建两个输入点,并将焦点定位在上边的输入点上,你可以使用方向键或鼠标在这两个输入点间切换
2095 \begin_inset Foot
2096 status collapsed
2097
2098 \begin_layout Plain Layout
2099 译注:当焦点在上边时,按下“Tab”可以切换到下边的输入点。
2100 \end_layout
2101
2102 \end_inset
2103
2104 。在这两个输入点上输入公式,就能得到所需的分式了。
2105 \end_layout
2106
2107 \begin_layout Standard
2108 练习:修正 
2109 \family typewriter
2110 example_raw.lyx
2111 \family default
2112  中的公式 2。
2113 \end_layout
2114
2115 \begin_layout Subsection
2116 TeX 模式:lim、log、sin与其它
2117 \end_layout
2118
2119 \begin_layout Standard
2120 由于公式中的字符都被视为变量,所以输入的“sin”会被看作是三个变量 
2121 \begin_inset Formula $s$
2122 \end_inset
2123
2124
2125 \begin_inset Formula $i$
2126 \end_inset
2127
2128
2129 \begin_inset Formula $n$
2130 \end_inset
2131
2132  的乘积,并使用 Roman 斜体显示,而且在 sin 和 变量 x 之间也没有额外的间距。应该如何得到 
2133 \begin_inset Formula $\sin\left(x\right)$
2134 \end_inset
2135
2136  而不是 
2137 \begin_inset Formula $sin(x)$
2138 \end_inset
2139
2140  呢?
2141 \end_layout
2142
2143 \begin_layout Standard
2144 点击数学工具栏上的按钮 
2145 \begin_inset Graphics
2146         filename ../../images/math/functions.png
2147         scale 50
2148         groupId In line
2149
2150 \end_inset
2151
2152  并选择“sin”,LyX 将输入“sin”并将其设为黑色 Roman 正体。“sin”这三个字符被视为一个整体,删除也是一起删除。然后再输入“(x)”,它们将
2153 被显示为蓝色斜体。在输出文件中,公式将会被正确排版。
2154 \end_layout
2155
2156 \begin_layout Standard
2157 在按钮 
2158 \begin_inset Graphics
2159         filename ../../images/math/functions.png
2160         scale 50
2161         groupId In line
2162
2163 \end_inset
2164
2165  的函数列表中还有其它三角函数及其反函数、双曲函数、对数、极限等。这些函数都可以接受上下标,如:“
2166 \begin_inset Formula $\cos^{2}\theta$
2167 \end_inset
2168
2169 ” 和 “
2170 \begin_inset Formula $\lim_{n\rightarrow\infty}$
2171 \end_inset
2172
2173 ”。
2174 \end_layout
2175
2176 \begin_layout Standard
2177 练习:修正 
2178 \family typewriter
2179 example_raw.lyx
2180 \family default
2181  中的公式 3。
2182 \end_layout
2183
2184 \begin_layout Subsection
2185 矩阵
2186 \end_layout
2187
2188 \begin_layout Standard
2189 点击数字工具栏按钮 
2190 \begin_inset Graphics
2191         filename ../../images/dialog-show_mathmatrix.png
2192         scale 50
2193         groupId In line
2194
2195 \end_inset
2196
2197 ,出现的对话框将允许你设置要输入的矩阵的行数和列数,现在分别将其设为 2 和 3。LyX 将会插入一个 
2198 \begin_inset Formula $2\times3$
2199 \end_inset
2200
2201  的矩阵,你可以在其中的 6 个输入点上输入任何公式,当然将它们留空也是可以的。
2202 \end_layout
2203
2204 \begin_layout Standard
2205 可以使用 Tab 键或方向键在矩阵各元素的输入点之间切换,赶快去试试它们的功能吧。
2206 \end_layout
2207
2208 \begin_layout Standard
2209 你还可以使用菜单 
2210 \family sans
2211 Edit\SpecialChar \menuseparator
2212 Rows
2213 \begin_inset space \thinspace{}
2214 \end_inset
2215
2216 &
2217 \begin_inset space \thinspace{}
2218 \end_inset
2219
2220 Columns 或数学工具栏按钮 
2221 \family default
2222
2223 \begin_inset Graphics
2224         filename ../../images/tabular-feature_append-row.png
2225         scale 50
2226         groupId In line
2227
2228 \end_inset
2229
2230
2231 \begin_inset Graphics
2232         filename ../../images/tabular-feature_delete-row.png
2233         scale 50
2234         groupId In line
2235
2236 \end_inset
2237
2238
2239 \begin_inset Graphics
2240         filename ../../images/tabular-feature_append-column.png
2241         scale 50
2242         groupId In line
2243
2244 \end_inset
2245
2246  和 
2247 \begin_inset Graphics
2248         filename ../../images/tabular-feature_delete-column.png
2249         scale 50
2250         groupId In line
2251
2252 \end_inset
2253
2254  改变矩阵的维数。
2255 \end_layout
2256
2257 \begin_layout Standard
2258 有关矩阵各列的水平对齐方式和整个矩阵的垂直对齐方式的更多信息请看 
2259 \emph on
2260 User's Guide。
2261 \shape italic
2262 注意:想要输入一个包含文字的表格时,请使用 LyX 强大的表格功能,而不要使用矩阵。
2263 \end_layout
2264
2265 \begin_layout Subsection
2266 显示模式
2267 \end_layout
2268
2269 \begin_layout Standard
2270 LyX 中公式的显示方式有两种,一种是行内公式,一种是单行公式。行内公式适合于较简短的公式,单行公式适合于较庞大的公式或是你想把它单独显示。另外,多行公式必需是
2271 单行公式,而且只有单行公式才能加标签和编号(参见 
2272 \emph on
2273 User's Guide
2274 \emph default
2275 )。
2276 \end_layout
2277
2278 \begin_layout Standard
2279 点击按钮 
2280 \begin_inset Graphics
2281         filename ../../images/math-display.png
2282         scale 50
2283         groupId In line
2284
2285 \end_inset
2286
2287  会插入一个单行公式,该公式新起一行并居中显示。按钮 
2288 \begin_inset Graphics
2289         filename ../../images/math-display.png
2290         scale 50
2291         groupId In line
2292
2293 \end_inset
2294
2295  其实是一个切换开关,点击它你会在公式的两种显示模式间切换。
2296 \end_layout
2297
2298 \begin_layout Standard
2299 单行公式和行内公式在显示上大致是相同的,你需要注意以下几点不同:
2300 \end_layout
2301
2302 \begin_layout Itemize
2303 几个符号的默认字体变大,如:
2304 \begin_inset Formula $\sum$
2305 \end_inset
2306
2307  和 
2308 \begin_inset Formula $\int$
2309 \end_inset
2310
2311  。
2312 \end_layout
2313
2314 \begin_layout Itemize
2315 极限和求和的上下标被放在了符号的顶部和底部。
2316 \end_layout
2317
2318 \begin_layout Itemize
2319 公式居中对齐。
2320 \end_layout
2321
2322 \begin_layout Standard
2323 关于单行公式最后一个需要注意的问题是排版问题。你需要确切的知道,单行公式和其前后的文字是不是在同一段中。如果你在单行公式后敲回车,那么它后边的文字将是新的一段,
2324 而新起一段是有段间距和缩进的。如果你不想新起一段,那么直接在单行公式后边输入文字就好了。
2325 \end_layout
2326
2327 \begin_layout Standard
2328 练习:将 
2329 \family typewriter
2330 example_raw.lyx
2331 \family default
2332  中的公式改为单行公式,看看有什么不同。
2333 \end_layout
2334
2335 \begin_layout Standard
2336 练习:使用本节学到的知识输入下边公式
2337 \begin_inset Foot
2338 status collapsed
2339
2340 \begin_layout Plain Layout
2341 完成后试试菜单 
2342 \family sans
2343 Insert\SpecialChar \menuseparator
2344 Math\SpecialChar \menuseparator
2345 Cases
2346 \begin_inset space ~
2347 \end_inset
2348
2349 Environment。
2350 \end_layout
2351
2352 \end_inset
2353
2354
2355 \begin_inset Formula 
2356 \[
2357 f(x)=\left\{ \begin{array}{cc}
2358 \log_{8}x & x>0\\
2359 0 & x=0\\
2360 \sum_{i=1}^{5}\alpha_{i}+\sqrt{-\frac{1}{x}} & x<0
2361 \end{array}\right.
2362 \]
2363
2364 \end_inset
2365
2366
2367 \end_layout
2368
2369 \begin_layout Section
2370 继续学习
2371 \end_layout
2372
2373 \begin_layout Standard
2374 LyX 的公式编辑器能做很多事情,现在你只是刚刚熟悉了最基本的。继续阅读
2375 \emph on
2376  User's Guide
2377 \emph default
2378 ,你可以学到:
2379 \end_layout
2380
2381 \begin_layout Itemize
2382 给公式添加标签、编号。
2383 \end_layout
2384
2385 \begin_layout Itemize
2386 多行公式。
2387 \end_layout
2388
2389 \begin_layout Itemize
2390 改变字型。
2391 \end_layout
2392
2393 \begin_layout Itemize
2394 细调字体大小与间距(草稿的最后阶段再考虑这些事)。
2395 \end_layout
2396
2397 \begin_layout Itemize
2398 编辑宏。在文档开头处编写好后,文档中任何地方都可以使用。
2399 \end_layout
2400
2401 \begin_layout Itemize
2402 其它。
2403 \end_layout
2404
2405 \begin_layout Chapter
2406 杂项
2407 \end_layout
2408
2409 \begin_layout Section
2410 LyX 的其它重要特性
2411 \end_layout
2412
2413 \begin_layout Standard
2414 我们并没有把 LyX 的所有都说全,也没有这样的打算。你可以查看 
2415 \emph on
2416 User's Guide
2417 \emph default
2418  和 
2419 \emph on
2420 Embedded
2421 \begin_inset space ~
2422 \end_inset
2423
2424 Objects
2425 \emph default
2426  获得更多信息。这里我们将提到几个 LyX 的重要特性:
2427 \end_layout
2428
2429 \begin_layout Itemize
2430 LyX 具有所见即所想的表格支持。使用菜单 
2431 \family sans
2432 Insert\SpecialChar \menuseparator
2433 Table 或 按钮 
2434 \family default
2435
2436 \begin_inset Graphics
2437         filename ../../images/tabular-insert.png
2438         scale 50
2439         groupId In line
2440
2441 \end_inset
2442
2443  可以插入表格。在表格上单击右键,在右键菜单中选择表格设置对话框可以编辑表格的更多属性。
2444 \end_layout
2445
2446 \begin_layout Itemize
2447 LyX 可以支持各种格式的图片。点击菜单 
2448 \family sans
2449 Insert\SpecialChar \menuseparator
2450 Graphics 或工具栏按钮 
2451 \family default
2452
2453 \begin_inset Graphics
2454         filename ../../images/dialog-show-new-inset_graphics.png
2455         scale 50
2456         groupId In line
2457
2458 \end_inset
2459
2460 ,选择图片文件,你还可以对它旋转、缩放。你还可以对图表使用标题,LyX 还能自动产生图表的列表。
2461 \end_layout
2462
2463 \begin_layout Itemize
2464 LyX 有很强的可定制性,从界面外观到文档的输出方式都可以通过几种方式来定制。大多的定制可以通过菜单 
2465 \family sans
2466 Tools\SpecialChar \menuseparator
2467 Preferences 来实现。更多信息参见菜单 Help\SpecialChar \menuseparator
2468 Customization。
2469 \end_layout
2470
2471 \begin_layout Itemize
2472 LyX 开发组成员来自五大洲,所以 LyX 能比其它字处理软件更好的支持非英语(如荷兰语、德语、法语、希腊语、捷克语、土耳其语)。从右到左的语言:阿拉伯语、波斯
2473 语、希伯来语;亚洲语言:中文、日语、韩语等都能得到支持。你可以使用其它的语言写文档,也可以将 LyX 的界面和错误信息定义成其它的语言。
2474 \end_layout
2475
2476 \begin_layout Itemize
2477 LyX 的菜单支持快捷键绑定。你既可以通过 
2478 \family sans
2479 Alt+F O 实现菜单 File\SpecialChar \menuseparator
2480 Open 的点击效果,也可以通过快捷键来实现(默认是 Ctrl+O)。快捷键绑定也是可以自定义的,更多信息参见菜单
2481  Help\SpecialChar \menuseparator
2482 Customization。
2483 \end_layout
2484
2485 \begin_layout Itemize
2486 LyX 可以读取 LaTeX 文档。参见 
2487 \begin_inset CommandInset ref
2488 LatexCommand ref
2489 reference "sub:tex2lyx"
2490
2491 \end_inset
2492
2493
2494 \end_layout
2495
2496 \begin_layout Itemize
2497 LyX 支持拼写检查、同义词典和字数统计。
2498 \end_layout
2499
2500 \begin_layout Itemize
2501 LyX 支持附录和集注。
2502 \end_layout
2503
2504 \begin_layout Section
2505 LaTeX 用户必读
2506 \begin_inset CommandInset label
2507 LatexCommand label
2508 name "sec:LaTeX-用户必读"
2509
2510 \end_inset
2511
2512
2513 \end_layout
2514
2515 \begin_layout Standard
2516 如果你对 LaTeX 一无所知,那么你可以跳过这一节。如果你想了解一点 LaTeX 相关的东西,那就继续读下去吧。很多使用 LyX 的人都对 LaTeX
2517  比较熟悉,如果你也是这种人的话,你可能会有个疑问:LyX 真的能做到所有 LaTeX 能做的事情吗?LyX 的确能够通过这样或那样的方式做到
2518  LaTeX 能做的所有事情,而且 LyX 还能大大简化编辑 LaTeX 文档的工作量。
2519 \end_layout
2520
2521 \begin_layout Standard
2522 由于本教程仅仅是一个入门指南,所以我们只将注意力集中在新手们关心的地方。为了缩短篇幅,我们只给出了最少的信息。在 
2523 \emph on
2524 Additional
2525 \begin_inset space ~
2526 \end_inset
2527
2528 Features
2529 \emph default
2530  和 
2531 \emph on
2532 Embedded
2533 \begin_inset space ~
2534 \end_inset
2535
2536 Objects
2537 \emph default
2538  中有 LyX 和 LaTeX 区别的大量信息,那里还将教你如何在 LyX 中玩各种 LaTeX 的花活儿。
2539 \end_layout
2540
2541 \begin_layout Subsection
2542 TeX 模式
2543 \end_layout
2544
2545 \begin_layout Standard
2546 选择菜单 
2547 \family sans
2548 Insert\SpecialChar \menuseparator
2549 TeX
2550 \begin_inset space ~
2551 \end_inset
2552
2553 Code 或工具栏按钮 
2554 \family default
2555
2556 \begin_inset Graphics
2557         filename ../../images/ert-insert.png
2558         scale 50
2559         groupId In line
2560
2561 \end_inset
2562
2563  进入 TeX 模式。在 TeX 模式下输入的所有东西都会用红色显示,并直接送给 LaTeX 编译处理。
2564 \end_layout
2565
2566 \begin_layout Standard
2567 数学公式中 TeX 模式处理起来稍有不同,这里键入“
2568 \backslash
2569 ”进入 TeX 模式,输入空格或非字母字符(如:数字、下划线、脱字号或括号)退出 TeX 模式。退出 TeX 模式时,如果 LyX 认识你输入的
2570  TeX 命令,它就会将之转化为编译后的样子。如果你输入了“
2571 \family typewriter
2572
2573 \backslash
2574 gamma
2575 \family default
2576 ”并按下空格,LyX 会把它转化为蓝色的“
2577 \begin_inset Formula $\gamma$
2578 \end_inset
2579
2580 ”。对于不复杂的数学宏命令,LyX 都能转化成功的。对于熟练的 LaTeX 用户来说,直接输入 TeX 命令的方式会比使用数学工具栏速度快。
2581 \end_layout
2582
2583 \begin_layout Standard
2584 如果在 TeX 模式下输入“{”,LyX 将输入左右两个括号、退出 TeX 模式并将光标定位在两个括号中间等待输入。这使输入带参数的命令非常方便。
2585 \end_layout
2586
2587 \begin_layout Standard
2588 LyX 不能支持所有的 LaTeX 功能。有些根本就不支持,有些能够支持但不能实现所见即所想。TeX 模式使用户能够得到全部 LaTeX 的强大功能,而且还能使
2589 用 LyX 的方便特性(如:所见即所想的数学公式、表格和编辑方式)。LyX 永远也不会支持所有的 LaTeX 包,但你可以在序言加入 
2590 \family typewriter
2591
2592 \backslash
2593 usepackage{foo}
2594 \family default
2595 (见 
2596 \begin_inset CommandInset ref
2597 LatexCommand ref
2598 reference "sub:其它序言"
2599
2600 \end_inset
2601
2602 ),这样你就可以使用所有 LaTeX 包了。当然这些包并没有所见即所想支持。
2603 \end_layout
2604
2605 \begin_layout Subsection
2606 导入 LaTeX 文档── tex2lyx
2607 \begin_inset CommandInset label
2608 LatexCommand label
2609 name "sub:tex2lyx"
2610
2611 \end_inset
2612
2613
2614 \end_layout
2615
2616 \begin_layout Standard
2617 使用菜单 
2618 \family sans
2619 File\SpecialChar \menuseparator
2620 Import\SpecialChar \menuseparator
2621 LaTeX
2622 \begin_inset space ~
2623 \end_inset
2624
2625 (plain) 导入 LaTeX 文档,程序将执行 
2626 \family typewriter
2627 tex2lyx
2628 \family sans
2629 ,从 
2630 \family typewriter
2631 foo.tex
2632 \family sans
2633  创建 
2634 \family typewriter
2635 foo.lyx
2636 \family sans
2637 ,然后打开它。如果转换不成功,你可以试试在命令行加参数执行 
2638 \family typewriter
2639 tex2lyx
2640 \family sans
2641  命令。
2642 \end_layout
2643
2644 \begin_layout Standard
2645
2646 \family typewriter
2647 tex2lyx
2648 \family default
2649  能够转换大部份 LaTeX 文档,但不是所有东西都转换。它会把不懂的部分保留为 TeX 形式,所以你需要再进行手动修改。
2650 \end_layout
2651
2652 \begin_layout Standard
2653
2654 \family typewriter
2655 tex2lyx
2656 \family default
2657  有自己的 manpage。阅读它找到不能被支持的命令、bugs 及其解决方法还有如何使用命令选项。
2658 \end_layout
2659
2660 \begin_layout Subsection
2661 将 LyX 文档转化为 LaTeX 文档
2662 \end_layout
2663
2664 \begin_layout Standard
2665 选择菜单 
2666 \family sans
2667 File\SpecialChar \menuseparator
2668 Export\SpecialChar \menuseparator
2669 LaTeX 将你正在编辑的文档 
2670 \family typewriter
2671 whatever.lyx
2672 \family default
2673  输出为 
2674 \family typewriter
2675 whatever.tex
2676 \family default
2677
2678 \end_layout
2679
2680 \begin_layout Subsection
2681 LaTeX 序言
2682 \end_layout
2683
2684 \begin_layout Subsubsection
2685 文档类
2686 \end_layout
2687
2688 \begin_layout Standard
2689
2690 \family sans
2691 Document\SpecialChar \menuseparator
2692 Settings 对话框中的 
2693 \family default
2694 Document Class 页面能够处理很多 
2695 \family typewriter
2696
2697 \backslash
2698 documentclass
2699 \family default
2700  命令选项。这里你能够修改文档类、默认字体、页面大小,还可以在 Class options 区域中输入额外的选项
2701 \begin_inset Foot
2702 status collapsed
2703
2704 \begin_layout Plain Layout
2705 原文写的是 
2706 \family sans
2707 E
2708 \bar under
2709 x
2710 \bar default
2711 tra
2712 \begin_inset space ~
2713 \end_inset
2714
2715 Options,在 LyX 1.6.4 中没找到。
2716 \end_layout
2717
2718 \end_inset
2719
2720
2721 \end_layout
2722
2723 \begin_layout Subsubsection
2724 其它序言
2725 \begin_inset CommandInset label
2726 LatexCommand label
2727 name "sub:其它序言"
2728
2729 \end_inset
2730
2731
2732 \end_layout
2733
2734 \begin_layout Standard
2735 在 LaTeX 文档中输入的特殊命令在 LyX 当然也能使用。选择 
2736 \family sans
2737 Document\SpecialChar \menuseparator
2738 Settings\SpecialChar \menuseparator
2739 LaTeX
2740 \begin_inset space ~
2741 \end_inset
2742
2743 Preamble,在对话框中输入命令即可,输入的任何东西都会直接传给 LaTeX 编译处理。
2744 \end_layout
2745
2746 \begin_layout Subsection
2747 BibTeX
2748 \end_layout
2749
2750 \begin_layout Standard
2751 使用 BibTeX 可以创建供多文档使用的文献数据库……没错,LyX 能够支持 BibTeX。选择 
2752 \family sans
2753 Insert\SpecialChar \menuseparator
2754 List
2755 \begin_inset space ~
2756 \end_inset
2757
2758 /
2759 \begin_inset space ~
2760 \end_inset
2761
2762 TOC\SpecialChar \menuseparator
2763 BibTeX
2764 \begin_inset space ~
2765 \end_inset
2766
2767 Bibliography 加入一个 
2768 \family typewriter
2769 BibTeX
2770 \family sans
2771  文件,在数据库字段填入 
2772 \family default
2773 BibTeX 文件名,在样式字段填入 BibTeX 样式文件名。
2774 \end_layout
2775
2776 \begin_layout Standard
2777 这时你就可以引用参考文献了(见 
2778 \begin_inset CommandInset ref
2779 LatexCommand ref
2780 reference "sec:参考文献"
2781
2782 \end_inset
2783
2784 )。LyX 会自动管理 BibTeX 的运行。引用对话框中将会显示你 
2785 \family typewriter
2786 BibTeX
2787 \family default
2788  文件中所有可用的引用项列表。
2789 \end_layout
2790
2791 \begin_layout Section
2792 错误!
2793 \end_layout
2794
2795 \begin_layout Standard
2796 编译文档时,如果有 LyX 或 LaTeX 不能识别的东西,LyX 将会报错。这时会出现 LaTeX 错误对话框,点击某个错误将会定位到 LyX
2797  文档中发生错误的地方,并显示详细 LaTeX 错误信息。
2798 \end_layout
2799
2800 \begin_layout Standard
2801 \begin_inset ERT
2802 status open
2803
2804 \begin_layout Plain Layout
2805
2806
2807 \backslash
2808 clearpage
2809 \end_layout
2810
2811 \end_inset
2812
2813
2814 \end_layout
2815
2816 \end_body
2817 \end_document