1.多個(gè)blankspace等于一個(gè)blankspace,多個(gè)空行(line)等于一個(gè)空行,一個(gè)空行效果等于另起一段,并不會(huì)真正出現(xiàn)一個(gè)空行。
2.九大保留字符的輸入
# $ % ^ & _ { } 前面加\就可以,如\$
\
要用命令$\backslash$
3.latex命令的書寫要求
$a\pm b___FCKpd___1nbsp; $a\pm3b___FCKpd___1nbsp;
命令\pm后面的空格、數(shù)字或者任何非字母的字符都標(biāo)志著該命令的結(jié)束。
如何在命令后產(chǎn)生一個(gè)空格:{}可以保護(hù)后面的空格。
Get \LaTeX{} Started.
一些命令(\footnote 或\phantom)內(nèi)嵌于\caption 或\section時(shí)會(huì)失效,這時(shí)加上\protect可以保證不失效。
\section{Higer Order Difference Equations \footnote{See
James(2000)}} %\footnote失效
\section{Higer Order Difference Equations
\protect\footnote{See James(2000)}}
注意\protect只保護(hù)緊跟其后的命令本身,命令的參數(shù)并不受到保護(hù),如果要保護(hù)參數(shù),需要在參數(shù)前加\protect.其他一些脆弱命令還有:
All commands that have an optional argument are fragile.
Environments
delimited by \begin ... \end are fragile.
Display math environment delimited
by \[ ... \]
Math environment \( ... \) ,However, $ ... $ is robust
Line
breaks, \\ .
\item commands .
\footnote commands .
4.如何打印命令(將程序命令打印出來而不讓命令執(zhí)行)
\begin{verbatim} Get \LaTeX{} Started.
\end{verbatim}
\verb*|like this :-) |
5.添加程序注釋的兩種方法
%Get \LaTeX{} Started.
\begin{comment} Get \LaTeX{}
Started. \end{comment}
第二個(gè)方法要在導(dǎo)言區(qū)添加\usepackage{verbatim}
6.document class有哪些常見類型
article, proc, minimal, report, book, slides
7.頁面式樣
\pagestyle{plain}
\pagestyle{headings}
\pagestyle{empty}
\thispagestyle{empty}
%將當(dāng)前頁面的式樣改為empty.
8.大型文檔中插入一些子文檔的方法
\include{filename}
%想讓插入的子文檔在新的一頁開始顯示;
\input{filename} %插入的子文檔直接顯示,不用新開一頁。
\includeonly{file1,file2,file3} %在導(dǎo)言區(qū)使用。只有在此列出的子文檔才會(huì)在正文中被插入。
9.快速檢查語法
\usepackage{syntonly}
\syntaxonly
10.分行分頁的方法
\\ or \newline
:另起一行,但不另起一段。
\\* :另起一行,但禁止分頁。
\newpage:另起一頁。
11.確定單詞斷點(diǎn)位置
\hyphenation{FORTRAN Hy-phen-a-tion}
%只有在-出現(xiàn)的地方才能斷,沒有-的單詞不能斷,必須整體出現(xiàn)。
un\-derstood %在正文中輸入understood的時(shí)候,插入\-告訴latex這里可以分開。
12.幾個(gè)單詞整體出現(xiàn)
\mbox{0116 291 2319}
%讓這幾位數(shù)字作為一個(gè)整體出現(xiàn)在一行,不在不同的行顯示。
\fbox{0116 291 2319}
%功能和\mbox一樣,同時(shí)還在這個(gè)整體周圍加框。
13.特殊符號(hào)
引號(hào)
``well understood `physical' formula'' 雙引號(hào)要用兩個(gè)重音號(hào)``和兩單引號(hào)''前后表示。
破折號(hào)
daughter-in-law, X-rated\pages 13--67\yes---or no?
\$0$, $1$ and $-1$
波浪號(hào)~
\~understood \~{}physical $\sim$formula 效果各不同
溫度度數(shù)
$-30\,^{\circ}\mathrm{C}$
$-30$\textcelsius %這一種要加載\usepackage{textcomp}
歐元符號(hào)
\texteuro 100
\euro
100 $需加載\usepackage[official]{eurosym}或者\(yùn)usepackage[gen]{eurosym}
\EURtm $需加載\usepackage{marvosym}
省略號(hào)
直接用...不行,要用 \ldots, 文本中位于下部的省略號(hào)
$\cdots___FCKpd___1nbsp;%math mode,
數(shù)學(xué)符號(hào)中的位于中部的省略號(hào)
$\cdot___FCKpd___1nbsp; %math mode,數(shù)學(xué)符號(hào)中位于中部的一個(gè)點(diǎn)號(hào)。
連字
不管你信不信,在latex中,ff和f{}f顯示的結(jié)果是不同的。ff是兩個(gè)連在一起的整體符號(hào)。
14.調(diào)整單詞間隔
\frenchspacing
15.論文的標(biāo)題、章節(jié)目等安排
\title{My
Dissertation} %在后面正文中用\maketitle生成標(biāo)題
\author{George Bush, Allen Greenspan}
\date{\today}
\tableofcontents %在此位置插入章節(jié)目錄
\listoffigures %在此位置插入圖形目錄
\listoftables %在此位置插入表格目錄
\part{XXX} %產(chǎn)生單獨(dú)的一頁,例如Part
I XXX
\chapter{Introduction to SAS} %章 1 只有report和book才有章的劃分。
\section{My
God} %節(jié) 1.1
\subsection{...} %目
1.1.1
\subsubsection{...} %以下不再編號(hào)
\paragraph{...}
\subparagraph{...}
\section*{My God} %加了*后,該節(jié)就不出現(xiàn)在目錄中,也不編號(hào)。
\appendix %該命令說明后面開始附錄,下面的chapter命令采用字母編號(hào)
\chapter{Mathematical analysis}
%Appendix A Mathematical analysis
\section{Set Theory} %A.1 Set Theory
16.book風(fēng)格的文檔
\frontmatter %緊跟著\begin{document}命令出現(xiàn),該命令啟用羅馬數(shù)字編頁碼。
\mainmatter %出現(xiàn)在第一章前面,該命令啟用阿拉伯?dāng)?shù)字編頁碼。
\appendix
%標(biāo)志書中附錄材料的開始。該命令后的各章序號(hào)改用字母標(biāo)記。
\backmatter %應(yīng)該插入書中最后一部分內(nèi)容的前面,如參考文獻(xiàn)和索引
17.交叉引用法
\label{sec:my1} %放在在節(jié)、子節(jié)、圖、表或定理后面,作為后面需要引用的標(biāo)記
\ref{sec:my1} %引用標(biāo)志詞sec:my1那里的節(jié)、子節(jié)、圖、表或定理的序號(hào)
\pageref{sec:my1} %引用標(biāo)志詞sec:my1所在的頁碼
18.腳注、頁邊注和尾注
\footnote{type the text here.}
\marginpar{type the text
here.}
尾注的方法
\usepackage{endnotes} %加載尾注宏包
\endnote{type the text
here.} %在需要尾注的地方添加
\theendnotes %指明尾注內(nèi)容在文中該地方出現(xiàn)。
19.強(qiáng)調(diào)
\underline{text} %下劃線強(qiáng)調(diào)
\emph{text} %斜體強(qiáng)調(diào)
20. 三種枚舉方法Itemize、Enumerate
和Description
\flushleft
\begin{enumerate}
\item The strategy:
\begin{itemize} \item First,look silly.\item[-] Second,be
smart.\end{itemize}
\item The result:
\begin{description}
\item[Stupid] You'll be smart.\item[Smart] You'll be
stupid.\end{description}
\end{enumerate}
21.文本的對(duì)齊和居中
\begin{flushleft}。。。。。。\end{flushleft}
\begin{flushright}。。。。。。\end{flushright}
\begin{center}。。。。。。\end{center}
22.引文、詩歌、摘要
\begin{quote}。。。。。。\end{quote} %一次少量引用
\begin{quotation}。。。。。。\end{quotation} %一次大量引用
\begin{verse}。。。。。。\end{verse} %引用詩歌,排成韻律風(fēng)格,每一行后用\\斷行。
\begin{abstract}。。。。。。\end{abstract} %學(xué)術(shù)論文的摘要。
23.表格
\begin{tabular}{|r||l @{ + } c@{ . }rrr@{ * }c|c|} \hline \hline
Position
& Club & Games & W & T & L & Goals & Points\\[1.5ex]
\hline
1 & Amesville Rockets & 33 & 19 & 13 & 1 &
66:31 & 51:15 \2 & Borden Comets & 33 & 18 & 9 & 6
& 65:37 & 45:21 \... & ..... & .. & .. & .. &
.. & ... & ... \17 & Quincy Giants & 33 & 7 & 5
& 21 & 40:89 & 19:47 \18 & Ralston Regulars & 33 &
3 & 11 & 19 & 37:74 & 17:49\\ \hline \hline
\end{tabular}
另一種更加復(fù)雜的表,可以隨意畫橫線,幾列共用一個(gè)標(biāo)簽
\begin{tabular}{|r|l||rrr|r@{ : }l|r@{ : }l||c|}
\hline
\multicolumn{10}{|c|}{\bfseries {\itshape Table 1}. 1st Regional
Soccer League --- Final Results 2002/03}\\ \hline
\itshape Position &
\itshape Club & \itshape W & \itshape T & \itshape L &
\multicolumn{2}{|c|}{\itshape Goals} & \multicolumn{2}{|c||}{\itshape
Points} & \itshape Remarks\\[1ex] \hline \hline
1 & Amesville Rockets
& 19 & 13 & 1 & 66&31 & 51&15 & League Champs\\
\hline
2 & Borden Comets & 18 & 9 & 6 & 65&37 &
45&21 & Trophy Winners\\ \hline
... & ..... & .. & ..
& .. & .. & ... & ... & ...& ...\\ \hline
17 &
Quincy Giants & 7 & 5 & 21 & 40&89 & 19&47 &
Candidates \\ \cline{1-9}
18 & Ralston Regulars & 3 & 11 & 19
& 37&74 & 17&49 & for Losers\\ \hline
\end{tabular}
24.
浮動(dòng)體
浮動(dòng)體就是一個(gè)整體在正文中上下浮動(dòng),尋找合適的放置位置,通常為了避免一個(gè)“整體對(duì)象”遭遇分頁等尷尬問題。例如不想讓表格一半在上一頁,一半在下一頁。將上面表格作為浮動(dòng)體處理,浮動(dòng)體放置許可規(guī)則[!hbtp]表示忽略內(nèi)部參數(shù)[!],首先優(yōu)先放在這兒here[h],其次是bottom[b],再次放在top[t],然后考慮放在一個(gè)floating
page[p]。下面是表和圖的浮動(dòng)體例子。其中caption命令添加標(biāo)題,[..]內(nèi)的是簡(jiǎn)單標(biāo)題,在\listoffigures 和 \listoftables
中出現(xiàn),{...}內(nèi)的是長標(biāo)題,在正文中顯示。
\begin{table}[!hbtp]
\caption[Finals]{1st Regional Soccer League --- Final
Results.}
\begin{tabular}{|r|l||rrr|r@{ : }l|r@{ : }l||c|}
\hline
\multicolumn{10}{|c|}{\bfseries {\itshape Table 1}. 1st Regional
Soccer League --- Final Results 2002/03}\\ \hline
\itshape Position &
\itshape Club & \itshape W & \itshape T & \itshape L &
\multicolumn{2}{|c|}{\itshape Goals} & \multicolumn{2}{|c||}{\itshape
Points} & \itshape Remarks\\[1ex] \hline \hline
1 & Amesville Rockets
& 19 & 13 & 1 & 66&31 & 51&15 & League Champs\\
\hline
2 & Borden Comets & 18 & 9 & 6 & 65&37 &
45&21 & Trophy Winners\\ \hline
... & ..... & .. & ..
& .. & .. & ... & ... & ...& ...\\ \hline
17 &
Quincy Giants & 7 & 5 & 21 & 40&89 & 19&47 &
Candidates \\ \cline{1-9}
18 & Ralston Regulars & 3 & 11 & 19
& 37&74 & 17&49 & for Losers\\ \hline
\end{tabular}
\end{table}
Figure \ref{white} is an example of
Pop-Art.
\begin{figure}[!hbp]
\makebox[\textwidth]{\framebox[5cm]{\rule{0pt}{5cm}}}
\caption[FiveFig]{Five
by Five in Centimetres.\label{white}}
\end{figure}
浮動(dòng)體的放置順序遵循“先來先放”的原則。有時(shí)等待序列中浮動(dòng)體太多,命令\clearpage可以讓等待結(jié)束,立刻新開一頁放置所有等待中的浮動(dòng)體。
在LaTeX文檔中插入圖片http://hepg./Service/tips/latex/latexfig.html
25.如何使用中文字體
先在導(dǎo)言區(qū)加載\usepackage{CJK}
然后在正文使用中文的地方用
\begin{CJK*}{GBK}{song} 中文或者英文 \end{CJK*}
加*和不加*的區(qū)別在于對(duì)~的處理不同。加了*后,漢字之間的空格用~代替。不加*,漢字之間空格用英文正??崭?。常用的其他字體還有:fs(仿宋)、kai(楷體)、hei(黑體)、li(隸書)、you(幼圓)。命令中的
GBK 是指中文內(nèi)碼,還可以用 GB 和 BIG5(繁體字),前提是相應(yīng)的字庫設(shè)置是正確的。
如果在中間想要將宋體改變仿宋,就可以使用:
\CJKfamily{GBK}{fs}
26.段首縮進(jìn)
latex默認(rèn)每一段段首縮進(jìn),但是正文第一段不縮進(jìn)。如果要縮進(jìn),采用下面兩種方法:
(1).加載\usepackage{indentfirst}的方法。
(2).在該段首用\parindent來專門控制縮進(jìn),例如:
\setlength{\parindent}{4em}
%放置在段首,它設(shè)置為當(dāng)前字號(hào)的4個(gè)大寫字母M的寬度,大約正好是4個(gè)漢字的寬度
27.行距和段距的控制
\setlength{\baselineskip}{1.8em} %行距控制為1.8個(gè)M,直到下次出現(xiàn)修改為止。1.8em是中文常見行距。
\setlength{\parskip}{1ex} %段距控制為1個(gè)x,直到下次出現(xiàn)修改為止。
28.頁眉頁腳
\usepackage{fancyhdr}
\pagestyle{fancy}
29.頁面設(shè)置
\usepackage[top=1in, bottom=1in, left=1in,
right=1in]{geometry}