发表于: 2006.02.09 15:25
分类: 研究
出处: http://junsheng.itpub.net/post/860/52106
---------------------------------------------------------------
documentstyle{ article } %也可以采用documentclass命令,文档风格,article, book, report, or letter。
usepackage{ CJK } %使用CJK宏包,使得可以处理汉字。
begin{ CJK }{ GBK }{ song } %字体可以选择song, kai, hei, you, li。
begin{ document }
...
... %这里是内容。
...
end{ CJK }
end{ document } %注意这里的end顺序有些特别,先end CJK后end document,其他的则是按照程序对应的包含形式。
将编写好的文件按gb2312编码保存为后缀为tex的文件,然后在terminal里进到文件所在目录,执行
latex file.tex
就会编译出file.dvi文件,同时还会出现aux,log等一些文件,然后可以用xdvi查看效果
xdvi file.dvi
(这些命令执行时 可以不输入文件的后缀,比如 xdvi file)
如果满意,可以将其输出为pdf文件:
dvipdfm file
则生成file.pdf文件。
$ & % # _ { }等特殊符号的输入是在这些符号前加上backslash,呵呵也就是 ,这点是反常滴~~,通常,latex的命令是以开始的。
“......”的输入,是用两个`代替“,两个 ‘ 代替”
具体的一些Multilingual Symbols就看一些参看书吧,用时就查,方便。真的记起来倒不是很方便。
默认latex会忽略多余的空格,如果想多几个空格,可以使用 (space), 比如想增加三个空格就是 ,注意每个后面有个空格。更方便的确定增加间距可以使用
hspace{ xxmm }
其中的距离单位mm可以换成cm, em, in, pc, pt.
文字可以用hfill命令排列在两边,如:
the left hfill and right
竖直方向增加间距可以用
vspace{ xxmm }
选项同hspace
格式环境:
居中对齐:
begin{ center }
...
end{ center }
左对齐:
begin{ flushleft }
...
end{ flushleft }
右对齐:
begin{ flushright }
...
end{ flushright }
项目符号:
begin{ itemize }
item ....
item ....
.... ...
end{ itemize }
带序号列表:
begin{ enumerate }
item ...
item ...
... ....
end{ enumerate }
这可以产生这样的格式:
1.Especially for authors
(a)The author prepares and sub
(b)...
2. .............
(a)........
(b).........
i....
A........
B........
(c)...........
3................
描述列表:
begin{ description }
item[title1] ...
item[title2] ...
...
end{ description }
另外还有引用环境,“Quote"和"Quotation”,不同之处是前者首行缩进,后者不是。
begin{ quote }
...
end{ quote }
begin{ quotation }
...
end{ quotation }
诗体环境,"Verse" Environment
begin{ verse }
...
end{ verse }
直接输入环境,”Verbatim" Environment
在此环境中,输入的均当作字符原样输出,不作转换
begin{ verbatim }
....
end{ verbatim }
仅需要某一段直输环境时可以用
verb|××××××|
其中×××××为要直接输入的内容,输出时不作转换。
改变字体
rm roman
bf boldface
it italic
sc small caps
sf sans serif
sl slanted,斜体
tt typewriter
em emphasized
这些仅适用于英文。
字体大小:由小到大
tiny scriptsize footnotesize small normalsize large Large huge Huge
比如粗体加重:Some { largebf very important advice } is dots
公式编辑:
行输入公式环境,
可以用$****$建立公式环境,****为要输入内容。可以采用的格式为:
$ $
( )
begin{ math } end{ math }
显示公式环境:(单独居中显示)
$$ $$
[ ]
begin{ displaymath } end{ displaymath }
等式环境:(居中单独显示,并在右侧显示公式序号)
begin{ equation } end{ equation }
简单的一些例子:
x2 $x^2$
x2y3 $x^{ 2 }y_{ 3 }$
3/4 $3/4$
(2/9)*15.4 $(2/9)*15.4$
x=(y^3+z/5)/(y^2+ [x=frac{ y^{ 3 }+z/5 }{ y^{ 2 }+8 } ]
根号2 $sqrt{ 2 }$
3的n次方根 $sqrt[n]{ 3 }$
积分 int
对数 log
求和 sum














