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