从一网上看到的,自己敲的代码。第一次用这个软件,还不错。
1、%建立新文档
\documentclass{article}
\begin{document}
hello, world
\end{document}
2、%标题、作者和注释
\documentclass{article}
\author {My name}
\title {My title}
\begin{document}
\maketitle
hello,world % this is comment注释
\end{document}
3、%章节和段落
\documentclass{article}
\title{hello world}
\author{my author}
\begin{document}
\maketitle
\section{hello china}china is in east asia.
\subsection {hello beijing} beijing is the capital of china.
\subsubsection{hello dongcheng district}
\paragraph{hello tian'anmen square} is in the center of beijing
\subparagraph{hello chairman mao} is in the center of tian'anmen square
\subsection{hello guangzhou}
\paragraph{sun yat-sen university}is the best university in the guangzhou
\end{document}
4、%加入目录
\documentclass{article}
\begin{document}
\tableofcontents
\section {hello china}china is in east asia.
\subsection{hello beijing}beijing is the capticle of china.
\subsubsection {hello dongcheng district}
\paragraph{tian'anmen square}is in the center of beijing.
\subparagraph{chinamen 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}
5、%换行
\documentclass{article}
\begin {document}
beijing is
the capital
of china.
new york is
the capital
of american.
amsterdam is \\ the capital \\ of netherlands
\end{document}
6、%数学公式
\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 secocnd law is \[f=ma\] %换行斜体
greek letters $\eta$ and $\mu$ % 希腊字母
fraction $\frac{a}{b}$ %分数
power $a^b$ %a的b次方
subscript $a_b$ %b是角标
derivate $\frac{\partial y}{\partial t}$ %导数
vectpr $\vec{n}$ %向量
bold $\mathbf{n}$ %加粗
to time differential $\dot{}$
matrix (lcr here means left, center or right for each colum
\[
\left[
\begin{array} {lcr}
al & b22 & c333 \\
d444&e55555&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}
7、%表格
\documentclass{article}
\begin {document}
\begin{tabular}{|c|c|}
a & b \\
c & d\\ %\\表示换行
e&f\\
\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}
8、看网上说需要支持.eps的图片,但是不知道怎么不行,而重新换成png的反倒出来了。
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\includegraphics[width=3.00 in, height=4.00 in]{image1.png} %放在同一个文件夹下
\end{document}