Latex Basic Syntax
1. The usual syntax for latex files is as follows:
\documentstyle{article}
\begin{document}
This was a first example of a simple input file.
\end{document}
If it is in Chinese, change \documentstyle{article} to
\documentstyle{carticle}
2. Simple rules:
(1) Space: Latex Hollow lattice does not work.
(2) NewLine: Use the control command "\ \", or "\newline".
(3) Segment: Use the control command "\par" or empty a line.
(4) Page change: Use control command "\newpage" or "\clearpage"
(5) Special control characters: #,$,%, &,-, {,}, ^, ~
To output these controls, use the following command:
\# \$ \% \& \-\{\} \^{} \~{} $\blackslash$ means "\".
3. West Character Conversion table
RM Roman font \it Italian font
\BF blackbody \SL Tilt Body
\SF line body \SC Lowercase capital letters
\tt Typewriter font \mit mathematical italic
4. Font Size Conversion Command table
Points (PT) corresponding Chinese font control command
No. No. 251 \huge
No. No. 202 \huge
No. 173th \large
No. 144th \large
12 Little Fourth # \large
No. 105th \normalsize
9 Little Fifth # \small
No. 86th \footnotesize
7 Little Sixth # \scriptsize
No. 57th \tiny
5. Vertical Fixed Spacing Control command
Smallskip \medskip \bigskip
6. Page control Commands:
\textwidth=14.5cm
\textheight=21.5cm
System default: Font size 10pt= Fifth Word, West text body is Roman font; textwidth=12.2cm,textheight=18.6cm. Equivalent to US standard stationery size.
7. Common mathematical Formula typesetting commands
(1) line in the mathematical formula Status command
\begin{math} mathematical Formula \end{math}
Jane Style 1: \ (mathematical formula \)
Jane Style 2: $ math Formula $
(2) Independent mathematical Formula State command
\begin{displaymath} mathematical Formula \end{displaymath}
Jane Style 1: \[mathematical formula \]
Jane Style 2: $$ mathematical formula $$
( c) Examples of editing mathematical formulas
Various fonts in the mathematical formula:
$$
\BEGIN{ARRAY}{L}
\mathrm{abcdefghijklmnopqrstuvwxyz}\\% Roman Fonts
\mathtt{abcdefghijklmnopqrstuvwxyz}\\% Typewriter Font
\mathbf{abcdefghijklmnopqrstuvwxyz}\\% blackbody
\mathsf{abcdefghijklmnopqrstuvwxyz}\\% and other line bodies
\mathit{abcdefghijklmnopqrstuvwxyz}\\% Italian Fonts
\end{array}
$$
In this paper, the mathematical formula is used as the delimiter, and the $$ is used as the delimiter for the independent formula. Superscript with "^", subscript with "_".
For example:
$ x^{y^{z^{w}}}= (1+{\rm e}^{x}) ^{-2xy^{w}} $,
$y _1 ' +y_2 ' +y_3 ' ' $,
Su$^{\rm Per}_{\rm B} $script and so on.
The "\cal" command of the flower Body letter in mathematics
For example:
$\cal {abcdefghijklmnopqrstuvw}$
Most mathematical symbols can be found in the Math tool in the WinEdt editor.
Here is the control command for the equation environment:
\begin{equation}
0.3x+y/2=4z
\end{equation}
Sum and Integral commands:
$$\sum_{i=1}^{n} x_{i}=\int_{0}^{1}f (x) \, {\rm d}x $$
$$\sum_{{1\le i\le n}\atop {1\le j\le n}}a_{ij}$$
$\sum\limits_{i=1}^{n} x_{i}=\int_{0}^{1}f(x) \, {\rm d}x $ $\oint $
Ellipsis in mathematical formula:
$\cdots \ldots \vdots \ddots $
command to limit:
$$\lim_{n \rightarrow \infty}\sin x_{n}=0$$
$\lim_{n \rightarrow \infty}\sin x_{n}=0$
Fractional Typesetting commands:
$ $x =\frac{y+z/2}{y^2+\frac{y}{x+1}}$$
$ $a _0+\frac 1{\displaystyle a_1
+\frac 1{\displaystyle a_2
+\frac 1{\displaystyle A_3
+\frac 1{\displaystyle A_4
+\frac 1{\displaystyle {a_5}}}}}}$$
Radical Layout commands:
$ $x =\sqrt{1+\sqrt{1+\sqrt[n]{1+\sqrt[m]{1+x^{p}}}}}$$
$ $x _{\pm}=\frac{-b\pm \sqrt{b^2-4ac}}{2a}$$
Modulo command:
$\GCD (m,n) =a\bmod b$
$ $x \equiv y \pmod{a+b}$$
Matrix layout Commands:
$$
\BEGIN{ARRAY}{CLCR}
X+y+z & UV & A-B & 8\\
X+y & U+v & A & 88\\
X & 3U-VW & ABC &888\\
\end{array}
$$
$$\left (\begin{array}{c}
\left |\BEGIN{ARRAY}{CC}
A+b&b+c\\c+d&d+a
\end{array}
\right |\\
Y\\z
\end{array}\right)
$$
The modification of mathematical symbols:
(1) Underline command
$$\overline{1+\overline{1+\overline{x}^3}}$$
(2) Underline command
$$\underline{1+\underline{1+\underline{x}^3}}$$
(3) Horizontal curly brace command
$$\overbrace{x+y+z+w}$$
$$\overbrace{a+b+\cdots +y+z}^{26}_{=\alpha +\beta}$$
(4) Inverted curly brace command
$ $a +\underbrace{b+\cdots +y}_{24}+z$$
(5) Hats command
$$\hat{o}\ \ \check{o}\ \ \breve{o}$$
$$\widehat{a+b} \ \ \widetilde{a+b}$$
$$\vec{\imath}+\vec{\jmath}=\vec{k}$$
(6) Stacking order
$ $y \stackrel{\rm def}{=} f (x) \stackrel{x\rightarrow 0}{\rightarrow} a$$
(iv) Chinese and English latex templates
(1) The following is a Chinese latex2e template, at which time the file extension is. ctx. In the template, the Chinese is the Chinese annotation, and the reader can read the Chinese annotations in these templates to understand the meaning of the latex2e command involved.
\documentclass[11pt]{ccart}% File Class Description
% can also choose the class is Cctbook
\SETLENGTH{\PARINDENT}{12PT}% indent of the first line of the natural segment is 12pt
\setlength{\parskip}{10pt plus1pt minus1pt}
The distance between the% natural segments is 10pt and can vary from 8pt to 11pt
\setlength{\baselineskip}{8pt plus2pt minus1pt}
% line spacing is 8pt and can vary from 7pt to 10pt
\setlength{\textheight}{21true cm}% height of 21 cm
\setlength{\textwidth}{14.5true cm}% version width is 14.5 cm
\begin{document}% Body Start
\title{thesis}% article title, double backslash \ \ = line break
\author{author\\dept. of Math.}
% author name, unit, correspondence address, etc., double backslash \ \ = line break
\DATE{2003/8/5}
% article writing date, if omitted this line, computer date as writing date
\maketitle% Creating the title section
The body input of the% article
\begin{center}% The writing of reference documents
{\heiti Reference}
\end{center}
\vskip 0.1cm
\def\hang{\hangindent\parindent}
\def\textindent#1{\indent\llap{#1 \enspace}\ignorespaces}
\def\re{\par\hang\textindent}
\RE{[1]} Nordhaus e,stewart B,whitea.on the Maximum genus of a Graph. {\it j.combinatorial theory b},1971,11:258-267
\RE{[2]} Skoviera m.the Maximum genus of Graphs of Diameter. {\it discrete math}.1991, 87:175-180
\end{document}% End of source file
(2) English latex2e template
\documentclass[11pt]{article}% File Class Description
% can also choose the class is Book,report
\SETLENGTH{\PARINDENT}{12PT}% indent of the first line of the natural segment is 12pt
\setlength{\parskip}{10pt plus1pt minus1pt}
The distance between the% natural segments is 10pt and can vary from 8pt to 11pt
\setlength{\baselineskip}{8pt plus2pt minus1pt}
% line spacing is 8pt and can vary from 7pt to 10pt
\setlength{\textheight}{21true cm}% height of 21 cm
\setlength{\textwidth}{14.5true cm}% version width is 14.5 cm
\begin{document}% Body Start
\title{thesis}% article title, double backslash \ \ = line break
\author{author\\dept. of Math.}
% author name, unit, correspondence address, etc., double backslash \ \ = line break
\DATE{2003/8/5}
% article writing date, if omitted this line, computer date as writing date
\maketitle% Creating the title section
The body input of the% article
\section{introduction}% Introduction to the first section (Automatic numbering of machines)
{\BF theorem 1.} {\it for any fixed $\rho>0$, we have
$$|| R (U,\rho) | | \leq | | R_1 (U,\rho) | | \leq 2| | R (U,\rho) | |,~~~\forall u\in H.
\eqno ($$ Hence), (2) and (3) is equivalent for any fixed$\rho>0$.}
The notation of the% general theorem
{\BF Proof.}
\BEGIN{THEBIBLIOGRAPHY}{99}
\bibitem{kind} D. Kinderlehrer and G. Stampacchia, {\it an Introduction to
Variational inequalities and their applications}, academic Press,new York, (1980).
\end{thebibliography}% Reference Documents
\end{document}% End of source file
From:http://blog.sina.com.cn/s/blog_4b6a68ac010007c1.html
Latex basic syntax