内容分两部分:导言区和文本内容。如下图:
导言区位于\documentclass{}
和\begin{document}
之间,是对文档基本信息的说明,比如文档的类型(文章、书信、建立抑或幻灯片)、文档的标题、文档的作者、写作时间等,还有要加载的包,文档中使用的一些自定义命令以及格式也得在导言区中定义。在\begin{document}
和\end{document}
之间是你要写的文本内容了,不多谈。
然后在WinEdt的工具栏中找到编译按钮(在垃圾桶和字母B中间),在下拉菜单中选择XeTeX,并点击编译。
如果顺利的话,我们就可以顺利生成出第一个pdf文件,点击工具栏中的放大镜按钮就可以快速打开生成的pdf文件。
1.第一个文档:
如果代码为:
\documentclass{article}
\begin{document}
hello, world
\end{document}
结果如上所示。
2.章节和段落 的使用方法
结果如下图所示:
换行可以直接用回车换行。也可以用\\进行换行(但可能造成顶格)
3.数学公式的使用:
\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\begin{document}
The Newton's second law is F=ma.
The Newton's second law is $F=ma$.
The Newton's second law is
F=ma
The Newton's second law is
F=m$\beta$
Greek Letters $\eta$ and $\mu$
Fraction $\frac{a}{b}$
Power $a^b$
Subscript $a_b$
Derivate $\frac{\partial y}{\partial t} $
Vector $\vec{n}$
Bold $\mathbf{n}$
To time differential $\dot{F}$
Matrix (lcr here means left, center or right for each column)
\[
\left[
\begin{array}{lcr}
a1 & b22 & c333 \\
d444 & e555555 & f6
\end{array}
\right]
\]
Equations(here \& is the symbol for aligning different rows)
\begin{align}
a+b&=c\\
d&=e+f+g
\end{align}
\[
\left\{
\begin{aligned}
&a+b=c\\
&d=e+f+g
\end{aligned}
\right.
\]
\end{document}
结果如下:
4.插入图片:
先搜索到一个将图片转成eps文件的软件,很容易找的,然后将图片保存为一个名字如figure1.eps。
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,放在和图片文件同一个文件夹里,编译并观察现象。
\documentclass{article}
\usepackage{graphicx} %头文件
\begin{document}
\includegraphics[width=4.00in,height=3.00in]{figure1.eps}
\end{document}
5.宏包:
编辑数学公式的宏包:\usepackage{amsmath}和 \usepackage{amssymb}
编辑数学定理和证明过程的宏包:\usepackage{amsthm}
插入图片的宏包:\usepackage{graphicx}
复杂表格的宏包:\usepackage{multirow}
\usepackage{ctex} %加载包,因为我们在用中文写文档,所以必须加载这个包,否则不支持中文
\usepackage{multicol} %加载包
\usepackage[top=1in, bottom=1in, left=1.25in, right=1.25in]{geometry} %加载包