為國賽做準備,目前在嗶站學習西北農林科技大學耿楠老師的《latex中文教程-15集從入門到精通包含各種latex操作》,在此特整理課程latex語言,整理分享給各位latex戰友,也望與各位志同道合的戰友一起交流學習,共同進步。

注:1。最好將檔案錄入TeXstudio進行編譯並檢視,效果更佳。

2。其中有極小部分內容部分作出一些改變,但對於整體框架未做任何改動。

3。其中有部分內容為筆者筆記,前有%標識。

4。所有latex語言筆者均能在TeXstudio上成功編譯並檢視,當然若有錯誤也請各位及時斧正,感激不盡!

1.原始檔基本結構

\documentclass{article}

\usepackage{ctex}

\begin{document}

你好呀,\LaTeXe 。

\end{document}

2.latex中的中文處理方法

\documentclass{ctexart}

\title{\heiti 勾股定理}

\author{\xingshu 潘鴿鴿}

\date{\today}

%\usepackage{ctex}

\newcommand\degree{^\circ}

\begin{document}

你好, world!

Let $f(x)$ be defined by the formula $$f(x)=x^2+2x$$

%雙$符號意思就是行間公式

which is a polynomial of degree 2。

勾股定理可以表述如下:

直角三角形斜邊的平方等於兩直角邊的平方和。

可以用符號語言表述為:設直角三角形$ABC$,其中$\angle C=90\degree$ 則有:

\begin{equation}

BC^2+AC^2=AB^2。

\end{equation}

\end{document}

3.latex的字型字號設定

%導言區

\documentclass[10pt]{article}

%設定基礎字型大小【10磅】

\usepackage{ctex}

\newcommand{\myfont}{\textbf{\textsf{Fancy Text}}}

%正文區(文稿區)

\begin{document}

%字型族設定(羅馬字型、無襯線字型、打字機字型)

%rmfamily表示後續字型均為“羅馬”字型。

\textrm{Roman Family} \textsf{Sans Serif Family} \texttt{Typewriter Family}

\rmfamily Roman Family {\sffamily Sans Serif Family} {\ttfamily Typewriter Family}

\sffamily The love world is big, which can hold hundreds of disappointments; the love world is small which is crowded even with three people inside。

\ttfamily The love world is big, which can hold hundreds of disappointments; the love world is small which is crowded even with three people inside。

%字體系列設定(粗細、寬度)

\textmd{Medium Series} \textbf{Boldface Series}

{\mdseries Medium Series} {\bfseries Boldface Series}

%字型形狀(直立、斜體、偽斜體、小型大寫)

%字型設定命令

\textup{Upright Shape} \textit{Italic Shape}

\textsl{Slanted Shape} \textsc{Small Caps Shape}

%字型設定宣告

{\upshape Upright Shape} {\itshape Italic Shape} {\slshape Slanted Shape} {\scshape Small Caps Shape}

%中文字型

{\songti 宋體} \quad{\heiti 黑體} \quad {\fangsong 仿宋} \quad {\kaishu 楷書}

中文字型的\textbf{粗體}與\textit{斜體}。

%字型大小

{\tiny Hello}\\

{\scriptsize Hello}\\

{\footnotesize Hello}\\

{\small Hello}\\

{\normalsize Hello}\\

{\large Hello}\\

{\Large Hello}\\

{\LARGE Hello}\\

{\huge Hello}\\

{\Huge Hello}\\

%中文字號設定命令

\zihao{-0} 你好

%具體可看文件

\myfont

\end{document}

4.latex文件篇章的基本結構

%導言區

\documentclass{ctexbook}

%利用ctexart幾個大點會居中

%而利用article則正常,均左對齊

\usepackage{ctex}

%正文區(文稿區)

\begin{document}

%tableofcontents就是整個的目錄

\tableofcontents

%加上chapter需要將ctexart改為ctexbook

\chapter{緒論}

\section{引言}

某君昆仲,今隱其名,皆餘昔日在中學時良友;分隔多年,訊息漸闕。\\日前偶聞其一大病;適歸故鄉,迂道往訪,則僅晤一人,言病者其弟也。

某君昆仲,今隱其名,皆餘昔日在中學時良友;分隔多年,訊息漸闕。\par 日前偶聞其一大病;適歸故鄉,迂道往訪,則僅晤一人,言病者其弟也。

\section{試驗方法}

\section{實驗結果}

\subsection{資料}

\chapter{試驗與結果分析}

\section{結果}

\subsection{圖表}

\subsubsection{實驗條件}

\subsubsection{實驗過程}

\subsection{結果分析}

\section{結論}

\section{致謝}

\end{document}

5.latex中的特殊字元

%導言區

\documentclass{article}

\usepackage{ctex}%中文處理宏包

\usepackage{xltxtra} %提供了針對XeTeX的改進並且加入了XeTeX的LOG0

\usepackage{texnames} %一些L0GO

\usepackage{mflogo}

%正文區(文稿區)

\begin{document}

\section{空白符號}

%空行分段,多個空行等同1個

%自動縮排,絕對不能使用空格代替

%英文中多個空格處理為1個空格,中文中空格將被忽略

%漢字與其它字元的間距會自動由XeLaTeX處理

%禁止使用中文全形空格

%1pc=12pt=4。23mm

% 1em(當前字型中M的寬度)

a\quad b

% 2em

a\qquad b

%約為1/6個em

a\,b a\thinspace b

% 0。5個em

a\enspace b

%空格

a\ b

%_硬空格

a~b

% 1pc=12pt=4。 218mm

a\kern 1pc b

a\kern -1em b

a\hskip 1em b

a\hspace{35pt}b

%佔位寬度

a\hphantom{xyz}b

%彈性長度

a\hfill b

Are you wiser than others? definitely no。 in some ways, may it is true。 What can you achieve? a luxurious house? a brillilant car? an admirable career? who knows ?

近年來,隨著逆向工程和三維 重建技術的發展和應用,獲取現實止界中物體的三維資料的方法越來越多的關注和研究很多研究機構和商業公司都陸續推出了自己的三維重建系統

\section{\LaTeX 控制符}

\# \$ \% \{ \} \~{} \^{} \textbackslash \&

\section{排版符號}

\S \P \dag \ddag \copyright \pounds

\section{\TeX 標誌符號}

% 基本符號

\TeX{} \LaTeX{} \LaTeXe{}

% xltxtra宏包提供

\XeLaTeX

% texnames宏包提供

\AmSTeX{} \AmS-\LaTeX{}

\BibTeX{} \LuaTeX{ }

% mflogo宏包提供

\METAFONT{} \MF{} \MP{ }

\section{引號}

` ‘ `` ’‘ ``你好’‘

\section{連字元}% 減號,調整長度

- —— ——-

\section{非英文字元}

\oe \OE \ae \AE \aa \AA \o \O \l \L\ss \SS

!` ?`

\section{重音符號(以o為例)}

\o \’o \^o \‘’o \~o \=Q \。0 \u{0} \v{0} \H{0}

\r{o} \t{o} \b{o} \c{o} \d{o}

\end{document}

6.latex中的插圖

%導言區

\documentclass{ctexart}%ctexbook, ctexrep

%\usepackage{ctex}

%導言區: \usepackage{graphicx}

%語法:\includegraphics[< 選項>]{< 檔名》}

%格式: EPS, PDF, PNG,JPEG, BMP

\usepackage{graphicx}

\graphicspath{{figures/},{pics/}} %圖片在當前目錄下的figures目錄,大括號實現分組。

%正文區(文稿區)

\begin{document}

\LaTeX{ }中的插圖:

\includegraphics{lion。jpg}

\includegraphics{mountain。jpg}

\includegraphics{oscilloscope。jpg}

%縮放因子(倍數)

\includegraphics[scale=0。3]{lion}

\includegraphics[scale=0。03]{mountain}

\includegraphics[scale=0。3]{oscilloscope}

\includegraphics[height=2cm]{lion}

\includegraphics[height=2cm]{mountain}

\includegraphics[height=2cm]{oscilloscope}

\includegraphics[width=2cm]{lion}

\includegraphics[width=2cm]{mountain}

\includegraphics[width=2cm]{oscilloscope}

%版型文字高度0。1倍的影象高度(高度一致)

\includegraphics[height=0。1\textheight]{lion}

\includegraphics[height=0。1\textheight]{mountain}

\includegraphics[height=0。1\textheight]{oscilloscope}

\includegraphics[width=0。2\textwidth]{lion}

\includegraphics[width=0。2\textwidth]{mountain}

\includegraphics[width=0。2\textwidth]{oscilloscope}

%不同引數之間逗號進行分割

\includegraphics[angle=-45,

width=0。2\textwidth]{lion}

\includegraphics[width=0。2\textwidth]{mountain}

\includegraphics [angle=45,

width=0。2\textwidth]{oscilloscope}

\end{document}

7.latex中的表格

\documentclass{ctexart}%ctexbook,ctexrep

%\usepackage{ctex}

%正文區(文稿區)

\begin{document}

%hline加橫線,正常操作{l c c c r}

%利用p設定指定寬度的列格式

\begin{tabular}{|l|c|c|c|p{1。5cm}|}

\hline

姓名 & 語文 & 數學 & 外語 & 備註\\

\hline \hline

張三 & 87 & 100 &93 & 優秀\\

\hline

李四 & 75 & 64 & 52 & 補考另行通知\\

\hline

王二 & 80 & 82 & 78 & \\

\hline

\end{tabular}

\end{document}

%\begin{tabular}[<垂直對齊方式>]{<列格式說明>}

%<表項>&<表項>&。。。&<表項>\\

%

% \end{tabular}

%用\\表示換行

%用&表示不同的列。

% l-本列左對齊

% c-本列居中對齊

% r-本列右對齊

% p{<寬>}-本列寬度固定,能夠自動換行

%正文區(文稿區)

8.latex中的浮動體

%導言區

\documentclass{ctexart}%ctexbook,ctexrep

%\usepackage{ctex}

\usepackage{graphicx}

\graphicspath{{figures/}} %圖片在當前目錄下的figures目錄

%標題控制(caption、bicaption等宏包)

%並排與子圖表(subcaption、 subfig、 floatrow等宏刨)

%繞排(picinpar、 wrapfig等宏包)

%利用ctrl+T進行大面積註釋與取消註釋。

%正義區(文稿區)

\begin{document}

\LaTeX{}中\TeX 系統的吉祥物——-小獅子見圖\ref{fig-lion}。%利用\ref進行標籤的引用,進而達到交叉引用。

\begin{figure} [htbp]%指定引數指定浮動體的排版位置

\centering

\includegraphics [scale=0。3]{lion}

\caption{\TeX 系統的吉祥物——-小獅子}\label{fig-lion} %利用fig設定標籤

\end{figure}

遙望太白,看積雪皚皚,別有一番風景(圖\ref{fig-mountain})。。

\begin{figure}[htbp]%允許各個位置

\centering

\includegraphics [scale=0。3]{mountain}

\caption{太白山}\label{fig-mountain}

\end{figure}

在\LaTeX{}中的表格:

當然,在\LaTeX{}中也如以使用表\ref {tab-score}所示的表格。%此處對錶格進行了引用。

\begin{table}[h]

\centering

\caption{考試成績單} \label{tab-score}

\begin{tabular}{|l|c|c|c|r|}

\hline

姓名 & 語文 & 數學 & 外語 & 備註 \\

\hline

張三 & 87 & 100 & 93 & 優秀 \\

\hline

李四 & 75 & 64 & 52 & 補者另行通知 \\

\hline

王二 & 80 & 82 & 78 & \\

\hline

\end{tabular}

\end{table}

\end{document}

%浮動體

%實現靈活分頁(避免無法分割的內容產生的頁面留白)

%給圖表新增標題

%交叉引用

%figure環境(table環境與之類似)

%\begin{figure}[<允許位置>]

%<任意內容>

%\end{figure}

9.latex數學公式初步

%導言區

\documentclass{article}%ctexbook

\usepackage{ctex}

\usepackage{amsmath}%有*的內容需要amsmath宏包

%正文區(文稿區)

\begin{document}

\section{簡介}

\LaTeX{}將排版內容分為文字模式和數學模式。文字模式用於普通文字排版,數學模式用於數學公式排版。

\section{行內公式}

\subsection{美元符號}

交換律是$a+b=b+a$, 如$1+2=2+1=3$。

\subsection{小括號}

交換律是\(a+b=b+a\),如 \(1+2=2+1=3\)。

\subsection{math環境}

交換律是\begin{math}a+b=b+a\end{math},如

\begin{math}1+2=2+1=3 \end{math}

\subsection{小括號}

\subsection{math環境}

\section{上下標}

\subsection{上標}

$3x^{20} - x + 2 = 0$

$3x^{3x^{20} - x + 2} - x + 2 = 0$

\subsection{下標}

$a_ 0, a_1,a_ 2$

$a_ 0,a_1, a_2,。。。, a_{3x^{20} - x + 2}$

\section{希臘字母}

$\alpha$

$\beta$

$\gamma$

$\epsilon$

$\pi$

$\omega$

$\Gamma$

$\Delta$

$\Theta$

$\Pi$

$\Omega$

$\alpha^3 + \beta^2 + \gamma = 0$ 。

\section{數學函式}

$\log$

$\sin$

$\cos$

$\arcsin$

$\arccos$

$\ln$

$\sin^2 X + \cos^2 x = 1$

$y =\arcsin x$

$y = \sin^{-1} x$

$y=\log_2 x$

$y = \ln x$

%sqrt用於排版根式

$\sqrt{2}$

$\sqrt{x^2 + y^2}$

$\sqrt{2 + \sqrt{2}}$

$\sqrt[4]{x}$

\section{分式}

大約是原體積的$3/4$。

大約是原體積的$\frac{3}{4}$

$\frac{x}{x^2 + X+ 1}$

$\frac{\sqrt{x-1}}{\sqrt{x+1}}$

$\frac{1}{1 + \frac{1}{x}}$

$\sqrt{\frac{x}{x^2 + x + 1}}$

\section{行間公式}

\subsection{美元符號}

交換律是

$$a+b=b+a$$

$$1+2=2+1=3$$

\subsection{中括號}

交換律是

\[a+b=b+a\]

\[1+2=2+1=3\]

\subsection{displaymath環境}

交換律是

\begin{displaymath}

a+b=b+a ,

\end{displaymath},

\begin{displaymath}

1+2=2+1=3。

\end{displaymath}

\subsection{自動編號公式equation環境}

交換律見式\ref{eq: commutative}%處處引用

\begin{equation}

a+b=b+a \label{eq: commutative}%利用label命令新增標籤

\end{equation}

\subsection{不編號公式equation*環境}

%交換律見式\ref{eq: commutative2}:

\begin{equation*}

a+b=b+a%\label{eq: commutative2}

\end{equation*}

公式的編號與交叉引用也是自動實現的,大家在排版中,要習慣於採用自動化的方式處理諸如圖、表、公式的編號與交叉引用。再如公式\ref{eq:pol}:

\begin{equation}

x^5 - 7x^3 + 4x = 0 \label{eq:pol}

\end{equation}

\end{document}

10.latex數學公式的矩陣

%導言區

\documentclass{ctexart}%ctexbook,ctexrep

%\usepackage{ctex}

\usepackage{amsmath}

\usepackage{mathdots}

\newcommand{\adots}{\mathinner{\mkern2mu%

\raisebox{0。1em}{。}\mkern2mu\raisebox{0。4em}{。}%

\mkern2mu\raisebox{0。7em}{。}\mkern1mu}}

%正文區(文稿區)

%矩陣環境,用&分隔列,用\\分隔行

\begin{document}

\[

\begin{matrix}

0 & 1 \\

1 & 0

\end{matrix}

% pmatrix環境

\begin{pmatrix}

0 & -i\\

i & 0

\end{pmatrix} \qquad

% bmatrix環境

\begin{bmatrix}

0 &-1 \\

1 & 0

\end{bmatrix} \qquad

% Bmatrix環境

\begin{Bmatrix}

1 &0\\

0 &-1

\end{Bmatrix} \qquad

% vmatrix環境

\begin{vmatrix}

a&b\\

c&d

\end{vmatrix} \qquad

% Vmatrix環境

\begin{Vmatrix}

i &0\\

0 &-i

\end{Vmatrix}

\]

%可以使用上下標。

\[

A =\begin{pmatrix}

a_ {11}^2 & a_ {12}^2 & a_ {13}^2 \\

0 & a_{22} & a_{23}\\

0 & 0 & a_{33}

\end{pmatrix}

\]

%常用省略號:\dots、\vdots、\ddots、\adots

\[

A = \begin{bmatrix}

a_{11} & \dots & a_{1n}\\

\adots & \ddots & \vdots \\

0 & & a_{nn}

\end{bmatrix}_ {n \times n}

\]

%此處使用\iddots同樣擁有效果,但需要引入mathdots宏包

\[

A = \begin{bmatrix}

a_{11} & \dots & a_{1n}\\

\iddots & \ddots & \vdots \\

0 & & a_{nn}

\end{bmatrix}_ {n \times n}

\]

%分塊矩陣(矩陣巢狀)

\[

\begin{pmatrix}

\begin{matrix} 1&0\\0&1 \end{matrix}

& \text{\Large 0} \\

\text{\Large 0} & \begin{matrix}

1&0\\0&-1 \end{matrix}

\end{pmatrix}

\]

%三角矩陣

\[ \begin{pmatrix}

a_ {11} & a_ {12} & \cdots & a_{1n} \\

& a_{22} & \cdots &a_{2n} \\

& & \ddots & \vdots \\

\multicolumn{2}{c}{\raisebox{1。3ex}[0pt]{\Huge 0}}

& &a_{nn}

\end{pmatrix}

\]

%multicolumn合併多列(2是合併數,c是位置在中間);taisebox調整高度

%跨列的省略號: \hdotsfor{<列數>}

\[

\begin{pmatrix}

1&\frac12&\dots&\frac1n\\

\hdotsfor{4} \\

m &\frac m2 & \dots & \frac mn

\end{pmatrix}

\]

%行內小矩陣(smallmatrix) 環境

複數$z = (x,y)$也可用矩陣

\begin{math}

\left(%需要手動加上左括號

\begin{smallmatrix}

x&-y\\y&x

\end{smallmatrix}

\right)%需要手動加上右括號

\end{math}來表示。|

%\left(形成左括號,\right)形成右括號。

% array環境(類似於表格環境tabular)

\[

\begin{array}{r|r}

\frac{1}{2} & 0 \\

\hline

0 & -\frac a{bc} \\

\end{array}

\]

%用array環境構造複雜矩陣

\[

% @{<內容>}- _新增任意內容,不佔表項計數

%此處新增一個負值空白,表示向左移- 5pt的距離

\begin{array}{c@{\hspace{-5pt}}l}

%第1行,第1列

\left(

\begin{array}{ccc|ccc}

a&\cdots&a&b&\cdots&b\\

& \ddots & \vdots & \vdots & \adots\\

& & a &b\\ \hline

& & & c & \cdots & c\\

& & & \vdots & & \vdots\\

\multicolumn{3}{c|}{\raisebox{2ex}[0pt]{\Huge0}}

& c & \cdots & c

\end{array}

\right)

&

%第1行第2列

\begin{array}{l}

%\left。僅表示與\right\}配對,什麼都不輸出

\left。 \rule{ 0mm}{7mm}\right\}p\\

\\

\left。 \rule{0mm}{7mm}\right\}q

\end{array}

\\[-5pt]

%第2行第1列

\begin{array}{cc}

\underbrace{\rule{17mm}{0mm}}_ m &

\underbrace{\rule{17mm}{0mm}}_ m

\end{array}

& %第2行第2列

\end{array}

\]

\end{document}

11.latex數學公式的多行公式

\documentclass{ctexart}%ctexbook, ctexrep

%\usepackage{ctex}

\usepackage{amsmath}

\usepackage{amssymb}

%正文區(文稿區)

\begin{document}

% gather和gather* 環境(可以使用\\換行)

%帶編號

\begin{gather}

a+b=b+a\\

ab ba

\end{gather}

%不帶編號

\begin{gather*}

3+5=5+3=8 \\

3\times5=5\times 3

\end{gather*}

%在\\前使用\notag阻止編號

\begin{gather}

3^2 + 4^2 = 5^2 \notag \\

5^2 + 12^2 = 13^2 \notag \\

a^2+b^2=C^2

\end{gather}

% align和align*環境(用&進行對齊)

%帶編號

\begin{align}

x &=t+ \cos t+1\\

y &= 2\sin t

\end{align}

%不帶編號

\begin{align*}

x &=t&x &=\cos t&x&=t\\

y&=2t&y&=\sin(t+1)&y&=\sin t

\end{align*}

%split環境(對齊採用align環境的方式,編號在中間)

\begin{equation}

\begin{split}

\cos 2x &= \cos^2 x - \sin^2 x \\

&= 2\cos^2 x - 1

\end{split}

\end{equation}

% cases 環境

%每行公式中使用&分隔為兩部分,

%通常表示值和後面的條件

\begin{equation}

D(x)= \begin{cases}

1,& \text{如果} x \in \mathbb{Q}; \\

0, & \text{如果} x \in \mathbb{R}\setminus\mathbb{Q}。 \end{cases}

%in輸出屬於;text在數學公式中輸出中文。

\end{equation}

\end{document}

12.latex中的參考文獻BibTex

%導言區

\documentclass{article}

\usepackage{ctex}

%正文區(文稿區)

\begin{document}

%一次管理,一次使用

%參考文獻格式:

%\begin{thebibliography}{編號樣本}

%\bibitem[記號]{引用標誌}文獻條目1 (利用bibitem排版一個參考文獻條目)

%\bibitem[記號]{引用標誌}文獻條目2

%。。。

%\end{thebibliography}

%其中文獻條日包括:作者,題目,出版社,年代,版本,頁碼等。

%引用時候要可以採用: \cite{引用標誌1, 引用標誌2,。}

引用一篇文章\cite{articlel} 引用一本書\cite{book1} 引用一本書\cite{latexGuide}等等

\begin{thebibliography}{99}

\bibitem{articlel}陳立程,蘇偉,蔡川,陳曉雲。 \emph{基於LaTex的Web數學公式提取方法研究}[J]。讓算機科學,2014(06)

%利用emph命令強調參考文獻中的某些內容。

\bibitem{book1}William H。 Press,Saul A。 Teukolsky,

William T。 Vetterling, Brian P。 Flannery,

\emph{Numerical Recipes 3rd Edition:

The Art of Scientific Computing}

Cambridge University Press, New York , 2007。

\bibitem{latexGuide} Kopka Helmut, W。 Daly Patrick,

\emph{Guide to \LaTeX}, $4^{th}$ Edition。

Available at \texttt{

http://

www

。 amazon。 com}。

\bibitem{1atexMath} Graetzer George, \emph{Math Into \LaTeX},

BirkhAluser Boston; 3 edition (June 22, 2000)。

\end{thebibliography}

\end{document}

14.latex中的自定義命令和環境

%導言區

\documentclass{ctexart}%ctexbook,ctexrep

% \newcommand-定 義命令

%命令只能由字母組成,不能以\end開頭

% \newcommand<命 令>[<引數個數>][<首引數預設值>]{<具體定義>}

% \newcommand可以是簡單字串替換,例如:

%使用\PRC 相當於People‘s Republic of \emph{China} 這一串內容

\newcommand\PRC{People’s Republic of \emph{China}}

% \newcommand也可以使用引數

%引數個數可以從1到9,使用時用#1,#2……#9 表示

\newcommand\loves [2]{#1喜歡#2}

\newcommand\hatedby[2]{#2不受#1喜歡}

% \newcommand的引數也可以有預設值

%指定引數個數的同時指定了首個引數的預設值,那麼這個命令的

%第一個引數就成為可選的引數(要使用中括號指定)

\newcommand\love[3][喜歡]{#2#1#3}

%\renewcommand -重定義命令

%與\newcommand命令作用和用法相同,但只能用於已有命令

% \renewcommand<命令>[<引數個數>][<首引數預設值>]{<具體定義>}

\renewcommand\abstractname{內容簡介}

%定義和重定義環境

%\newenvironment{<環境名稱>}[<引數個數>][<首引數預設值>]

% {<環境前定義>}

% {<環境後定義>}

%\renewenvironment{<環境名稱>}[<引數個數>][<首引數預設值>]

% {<環境前定義>},

% {<環境後定義>}

%為book類中定義摘要(abstract) 環境

\newenvironment{myabstract}[1][摘要]%

{\small

\begin{center}\bfseries #1 \end{center}%

\begin{quotation}}%

{\end{quotation}}

%環境引數只有<環境前定義>中可以使用引數,

% <環境後定義>中不能再使用環境引數。

%如果需要,可以先把前面得到的引數儲存在一個命令中,在後面使用:

\newenvironment{Quotation}[1]%

{\newcommand\quotesource{#1}%

\begin{quotation}}%

{\par\hfill——-《\textit{\quotesource}》%

\end{quotation}}

%正文區(文稿區)

\begin{document}

\begin{myabstract}[我的摘要]

%此處增加預設值之後【我的摘要】會取代原引數預設值——【摘要】

這是一段自定義格式的摘要。。。

\end{myabstract}

\begin{abstract}

這是一段摘要。。。

\end{abstract}

\begin{Quotation}{易$\cdot$乾}

初九,潛龍勿用。

\end{Quotation}

\PRC

\loves{貓兒}{魚}

\hatedby{貓兒}{蘿蔔}

\love{貓兒}{魚}

%貓兒是#2,魚是#3,#1是預設引數喜歡

\love[最愛]{貓兒}{魚}

%方括號“最愛”是#1引數。貓兒和魚分別是#2與#3

\end{document}

%定義命令和環境是進行\LaTeX{}格式定製、達成內容與格式分離目標的利器。使用自定義的命令和環境把字型、字號、縮排、對齊、間距等各種瑣細的內容包裝起來,賦以一個有意義的名字,可以使文擋結構清晰、程式碼整潔、易於維護。在使用宏定義的功能時,要綜合利用各種已有的命令、環境、變數等功能,事實上,前面所介紹的長度變數與盒子、字型字號等內容,大多並不直接出現在文件正文中,而主要都是用在實現各種結構化的宏定義裡。