Go Latex Maiden Entry Command syntax set

Source: Internet
Author: User
Tags control characters

1. The framework for Latex files is as follows:

\documentclass{article}
\begin{document}
The body of the article
\end{document}
  
The first sentence: \documentclass[option]{class}, determines the processing format of the whole article, periodical or conference papers generally optional class is article, and then pay the options to control the global format, such as font, font size, page format, paper size and so on. There are also periodicals that provide class templates directly, such as lecture Notes in computer science, as long as the corresponding class name is placed in the {class} is OK, do not need to bother. The old version here uses \documentstyle.

Next is to include some use of the macro package to enhance the function,\usepackage{macro Package}, the macro package is included in the . sty file, the used macro package is: CJK support Chinese environment; times font; GRAPHICX illustration ; Pyperref refers to hyperlinks. There are also periodicals that provide macro packages for custom formats, such as the IEEE Computer Society Press. It feels like # include in the C language provides interfaces for third parties. Some of the sample files provided in the Documentclass option add a macro package, which is compatible with older versions.

The above is the introductory area, and then the remainder is the body part, which is included in \begin{document} and \end{document} . The latex command has a somewhat similar object and scope to the HTML tag, with a start and end flag, and some presentation formats are defined in the starting position. The introductory area may also have \pagestyle{options}, and page styles such as the empty option indicate that there are no headers and footers. The introduction area also has other global settings.

The body part first is the title \title{of the article title }, then the author information \author{author information}. In which the author information multiple lines, with \ \ line, automatic Center. Multiple authors are connected by \and , and are automatically sorted horizontally or vertically by format. Then \maketitle indicates that this page is a title page for automatic formatting.

Then the article body content of the various parts.

Summary \begin{abstract}...\end{abstract}.

The section is \section{first-level title}, \subsection{second-level title}.

The reference section is followed by two methods.

The first method is to manually add the "\bibitem{keyword} " to the maximum number of \begin{thebibliography}{} ... \end{thebibliography} in the end of the body. Articles quoted in the place with \cite{keyword}, automatically numbered in the order of accession, shape like [1]. The second method is to use BibTex. Create a document database file: The database name. Bib, which contains the information by field, as well as the corresponding "reference keywords." BibTeX generates a. bbl file that contains references to the contents of the file, at the end of the body with the \bibliography{document database name} , and note that the document database name cannot contain spaces. The reference format in the article is the same as the previous method, the referenced literature in the literature database appears in the end of the text in the format, the unreferenced literature can use the \nocite{keyword} to make it appear at the end of the text. The advantages of the latter method are: first, the literature database can be shared; second, the content of the document and the presentation of the format of separation, the content is more clear, but also better control of the format, such as the order of the document. The format control is to include the \bibliographystyle{format name}in the introductory area, where the format is contained in the . BST file, which can be provided by Latex or by a journal unit.

From a structural perspective, the article is finished with typesetting. Here are some of the details of the text of the article to leave some attention points.
  
Illustration: Using the Graphics macro package is handy for referencing. eps format pictures, personal general pictures are matlab drawing pictures, you can directly output EPS format. In particular, PS EPS is not possible. The picture is generally concentrated in the current directory under the subdirectory, using subdirectories in the introduction with the \graphicspath{{subdirectory name/}}, this inside {} can not be less, the picture file name is referenced when the subdirectory name can be omitted, indicating. EPS is highly efficient.

\begin{figure} [HTBP] \label{fig:fig4}
\centering
\includegraphics[height=3.7cm]{fig4.png}
\caption{an example of the network model.}
\end{figure}

Table: Table cells are content-propped, you can use the \rule[start position]{width} {height} to prop up the desired format. The rule defines a rectangle, where the starting position refers to the distance between the bottom line and the current line baseline, and a negative value indicates the bottom line below the baseline.

\BEGIN{TABLE}[HTP] \label{table:4}
\caption{pseudo Code of SPGA and MPGA}
\BEGIN{TABULAR}{P{238PT}L}
\hline
\end{tabular}\\
\end{table}

Formula:

\begin{equation} \label{eq:eq8}
Avgload (B) = \frac{{\sum\limits_{m = 1}^m {\left ({{{sr_m}/{s{c_m}}}} \right)}}}{m}
\end{equation}

Illustrations, tables, formulas can be labeled with their own auto-numbered tags \label{keyword}, referring to the \ref{keyword} can automatically appear the corresponding number.

The article is formatted well, the output document needs to pay attention to several points. According to the introduction area format, compiling and generating DVI as an intermediate preview is basically no problem, but the final PDF output is generally required.

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 Fonts

\it Italian Fonts

\BF blackbody

\SL Tilt Body

\SF and other line bodies

\SC Small Caps

\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, the 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 $$

An example of editing a mathematical formula

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}$
  
The following is the control command for the equation environment: the equation is automatically added to the sequence number (1) ....
\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$$%n tends to infinity symbol just below Lim
$\lim_{n \rightarrow \infty}\sin x_{n}=0$% tends to infinity symbol in Lim right lower corner
  
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$$

Latex templates in Chinese and English

(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

Problematic parsing

1. Question: How do I generate PS (PostScript) files?
Answer: There are two ways
(1) With dvips This tool, in the WinEdt editor has a special button;
(2) If you are using a Windows system, install the HP LaserJet 4/4m PostScript driver in the printer. When you browse the DVI file, print to the file. The file is saved as *.PRN, as long as you change him to be *.ps.
  
2. Question: How do i insert an image?
  
Answer: I know the way there is,
(1) Use the Img2cct.exe tool under Emtex.
First, the image is changed to monochrome bmp, you can do this with a brush, reminding you to save it as a monochrome image. For example, there is a monochrome BMP file Test.bmp, and then execute the command: IMG2CCT test.bmp-t3-c0 specific IMG2CCT parameters, you can directly perform "img2cct.exe" to view, Finally, copy the code of the Img2cct.exe generated Test.tex file into your article and adjust the location appropriately.
(2) Users using scientific WorkPlace (Word), as long as the menu File/import the picture function on the line.
(3) using the drawing software Latexcad, the diagram can be directly converted into latex language.
(4) Use the software to save the image format as PS format.
\USEPACKAGE{GRAPHICX}
\begin{document}
\INCLUDEGRAPHICS{YOUR.PS}
\end{document}
  
3. Question: Now many articles of the theorem, definition, inference, examples are unified numbering, no longer independent numbering, such as definition 1.1, the next may be theorem 1.2, and then deduce 1.3 How to do a general framework environment, the implementation of this automatic numbering it?
Answer: \newtheorem{athm}{\heiti \t}[section]
\newenvironment{thm} [1] {\def\t{#1}
\begin{athm} \fangsong \rm} {\end {athm}}
You can use the following in the text:
\begin{thm}{definition}
\end{thm}
Or begin{thm}{theorem}
\end{thm} and so on.
  
4. Problem: In the formula or theorem, the definition number, I do not want to follow the original format, such as Theorem 4.2, and want to use
Theorem 4.1.2. Or the direct theorem 123, how to modify it?
Answer: Redefine the label with \renewcommand.
\renewcommand {\theequation} {\arabic{chapter}.
\arabic{section}.\arabic{eqation}
Redefining the label becomes 4.1.2. (Section and subsection in article style)
  
5. Question: How do I use different font sizes and fonts? How do I use two pages in Chinese and English? (Just like a book)
What are the options and formats behind \documentstyle?
  
Answer: (1) about the font size, if you want to change the font size of the entire article. The simplest way is to modify the options in the first sentence \documentstyle[option]{format}.
(Options are ..., 9pt,10pt (default), 11pt,...; Twoside,twocolumn,proc,oneside (default); Leqno (default), FLEQN,EPSF. Formatted with Book,report,article,letter;cbook,carticle,...)
(2) If you want to choose two pages, use Twoside, (cbook default is Twoside, page number on top, chapter of the first page of the next.
(3) in the text somewhere want to change the size, English with \tiny, \scriptsize, \footnotesize, \small, \normalize,\large, \large, \large, \huge, \huge; Chinese with \zihao {n} here n desirable values: 0 (first number), 1 (a number), 2 (second), 3 (third), 4 (fourth), 4 (small four), 5,-5,6,7, etc.
(4) About fonts, English commonly used: \BF blackbody, \rm Rome, \sl Italic, \cal flower body, \SC, \it formula default, \SF line body. Chinese commonly used: \songti, \kaishu, \heiti, \fangsong, \biaosong,.
  
5. Question: How does LaTeX generate a directory?
Reply:

1) It is best to define the table of contents form, beautiful and convenient, the following is the definition of a few, you might as well try
(1) \def\mla#1#2#3{\par\noindent\hspace*{1 true cm}\parbox[b]{12.3 true cm}
{\protect\hspace*{-1 true cm}{#1}\quad{#2}~\dotfill~}
\hbox to1.0 true cm{~ (\HSS#3\HSS)}\vspace{2mm}}
(2) \def\mlb#1#2#3{\par\noindent\hspace*{1 true cm}\parbox[b]{12.3 true cm}
{\protect\hspace*{-1 true cm}{#1}~\dotfill~\hbox{#2}}
\hbox to1.0 true cm{~ (\HSS#3\HSS)}\vspace{2mm}}
(3) \def\mlc#1#2{\par\noindent\hspace*{1 true cm}\parbox[b]{12.3 true cm}
{\protect\hspace*{-1 true cm}\quad{#1}~\dotfill~}
\hbox to1.0 true cm{~ (\HSS#2\HSS)}\vspace{2mm}}
(4) \def\mld#1#2{\par\noindent\hspace*{1 true cm}\parbox[b]{12.3 true cm}
{\protect\hspace*{-1 true cm}\quad{#1}~\hfill~}
\hbox to1.0 true cm{~ (\HSS#2\HSS)}\vspace{2mm}}
  
2) Use the following methods:
\mla{title}{author}{page No.}
The result: Title author .......... (Page No.)
\mlb{title}{author}{page No.}
The effect: Title ... author ..... .....---------(page No.)
\mlc{title}{page No.}
The effect: Title ................ (Page No.)
\mld{title}{page No.}
Effect: Title (Page No.)
  
6. Question: How do you make a formula number in Latex (1.2) in this format?
Answer: \documentclass{article}
\usepackage{amsmath}
\numberwithin{equation}{section}
\begin{document}
\section{my section}
\begin{equation}
X^2+y^2=1
\end{equation}
\end[document]

Reproduced in this article:

Http://blog.csdn.net/nangergong/archive/2009/07/06/4324037.aspx

Go Latex Maiden Entry Command syntax set

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.