1.第一个文档
打开WinEdt,建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8。
\documentclass{article}
\begin{document}
hello,
world
\end{document}
然后在WinEdt的工具栏中找到编译按钮(在垃圾桶和字母B中间),在下拉菜单中选择XeTeX,并点击编译。如果顺利的话,我们就可以顺利生成出第一个pdf文件,点击工具栏中的放大镜按钮就可以快速打开生成的pdf文件。
2.标题、作者和注释
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。
\documentclass{article}
\author{My
Name}
\title{The
Title}
\begin{document}
\maketitle
hello,
world % This is comment
\end{document}
3.章节和段落
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。
\documentclass{article}
\author{Dou zi}
\title{Welcome to LaTex World !}
\begin{document}
\maketitle
\section{Hello China} China is in East Asia. %%大标题{} + 段落
\subsection{Hello Beijing} Beijing is center of China %%子标题 + 段落
\subsubsection{Hello DongCheng District}
\paragraph{Tian‘anmen Square}is in the center of Beijing
\subparagraph{Chairman Mao} is in the center of Tian‘anmen Square
\subsection{Hello Guangzhou}
\paragraph{Sun Yat-sen University} is the best university in Guangzhou.
\end{document}
4.加入目录
建立一个新文档,将以下内容复制进入文档中,保存
\documentclass{article}
\begin{document}
\tableofcontents
\section{Hello China} China is in East Asia.
\subsection{Hello Beijing} Beijing is the capital of China.
\subsubsection{Hello Dongcheng District}
\paragraph{Hello Tian‘sanmen Square}is in the center of Beijing
\subparagraph{Hello Chairman Mao} is in the center of Tian‘sanmen Square
\end{document}
5.换行
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。
\documentclass{article}
\begin{document}
Beijing is
the
capital
of China.
New York
is
the
capital
of
America.
Amsterdam
is \\ the capital \\ %% “\\”:是顶格换行,空一行:是对齐换行
of
Netherlands.
\end{document}
6.数学公式
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。
\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\begin{document}
The Netton‘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=ma\]
Greek Letters $\eta$ and $\mu$
Fraction $\frac{a}{b}$
Power $a^b$
Subscipt $a_b$
Derivate $\frac{\partial y}{\partial t} $
Vector $\vec{n}$
Blod $\mathbf{n}$
To time differential $\dot{F}$
\end{document}
\documentclass{article}
\begin{document}
\begin{tabular}{|c|c|}
a & b \\
c & d\\
\end{tabular}
\begin{tabular}{|c|c|}
\hline
a & b \\
\hline
c & d\\
\hline
\end{tabular}
\begin{center}
\begin{tabular}{|c|c|}
\hline
a & b \\ \hline
c & d\\
\hline
\end{tabular}
\end{center}
\end{document}
原文:http://www.cnblogs.com/douzujun/p/6388033.html