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