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