Latex

基本组成

速查表:

命令 用途 示例
documentclass[12pt, letterpaper]{article}\texttt{\\documentclass[12pt, letterpaper]\{article\}} 指定文档类型和选项 documentclass[12pt, letterpaper]{article}\texttt{\\documentclass[12pt, letterpaper]\{article\}}
title{}\texttt{\\title\{…\}} 设置文档标题 title{My Title}\texttt{\\title\{My Title\}}
author{}\texttt{\\author\{…\}} 设置作者信息 author{Name}\texttt{\\author\{Name\}}
date{}\texttt{\\date\{…\}} 设置日期 date{Today}\texttt{\\date\{Today\}}
usepackage{}\texttt{\\usepackage\{…\}} 引入宏包 usepackage{graphicx}\texttt{\\usepackage\{graphicx\}}
begin{document}\texttt{\\begin\{document\}} 开始文档 begin{document}\texttt{\\begin\{document\}}
maketitle\texttt{\\maketitle} 生成标题页 maketitle\texttt{\\maketitle}
end{document}\texttt{\\end\{document\}} 结束文档 end{document}\texttt{\\end\{document\}}
textbf{}\texttt{\\textbf\{…\}} 加粗文本 textbf{bold}\texttt{\\textbf\{bold\}}
textit{}\texttt{\\textit\{…\}} 斜体文本 textit{italic}\texttt{\\textit\{italic\}}
underline{}\texttt{\\underline\{…\}} 添加下划线 underline{underline}\texttt{\\underline\{underline\}}
emph{}\texttt{\\emph\{…\}} 强调(通常斜体) emph{important}\texttt{\\emph\{important\}}
begin{itemize}item end{itemize}\texttt{\\begin\{itemize\}\\item …\\end\{itemize\}} 无序列表 begin{itemize}item Appleend{itemize}\texttt{\\begin\{itemize\}\\item Apple\\end\{itemize\}}
begin{enumerate}item end{enumerate}\texttt{\\begin\{enumerate\}\\item …\\end\{enumerate\}} 有序列表 begin{enumerate}item Oneend{enumerate}\texttt{\\begin\{enumerate\}\\item One\\end\{enumerate\}}
$$\texttt{\$…\$} 行内数学公式 $E = mc2$\texttt{\$E = mc}^2\texttt\$
\texttt{\\[ … \\]} 块级数学公式
begin{equation} end{equation}\texttt{\\begin\{equation\} …\\end\{equation\}} 带编号的公式块
part{}\texttt{\\part\{…\}} 分部(book/report 文档结构) part{Part Title}\texttt{\\part\{Part Title\}}
chapter{}\texttt{\\chapter\{…\}} 章节(仅 book/report 类) chapter{Chapter 1}\texttt{\\chapter\{Chapter 1\}}
section{}\texttt{\\section\{…\}} 一级标题 section{Intro}\texttt{\\section\{Intro\}}
section*{}\texttt{\\section*\{…\}} 无编号一级标题 section*{Intro}\texttt{\\section*\{Intro\}}
subsection{}\texttt{\\subsection\{…\}} 二级标题 subsection{Details}\texttt{\\subsection\{Details\}}
subsection*{}\texttt{\\subsection*\{…\}} 无编号二级标题 subsection*{Details}\texttt{\\subsection*\{Details\}}
subsubsection{}\texttt{\\subsubsection\{…\}} 三级标题 subsubsection{More}\texttt{\\subsubsection\{More\}}
paragraph{}\texttt{\\paragraph\{…\}} 段落标题 paragraph{Note}\texttt{\\paragraph\{Note\}}
subparagraph{}\texttt{\\subparagraph\{…\}} 子段落标题 subparagraph{Detail}\texttt{\\subparagraph\{Detail\}}
tableofcontents\texttt{\\tableofcontents} 自动生成目录 tableofcontents\texttt{\\tableofcontents}

高阶用法

排版

功能 命令
段落居中 begin{center} ... end{center}\texttt{\\begin\{center\} ... \\end\{center\}}
插入空行 par\texttt{\\par}
段落对齐(默认两端对齐) begin{flushleft} ... end{flushleft}\texttt{\\begin\{flushleft\} ... \\end\{flushleft\}}
begin{flushright} ... end{flushright}\texttt{\\begin\{flushright\} ... \\end\{flushright\}}
组内对齐 begingroup raggedright ... endgroup\texttt{\\begingroup \\raggedright ... \\endgroup}
begingroup raggedleft ... endgroup\texttt{\\begingroup \\raggedleft ... \\endgroup}
begingroup centering ... endgroup\texttt{\\begingroup \\centering ... \\endgroup}
段落缩进 setlength{parindent}{20pt}\texttt{\\setlength\{\\parindent\}\{20pt\}}
indent ...\texttt{\\indent ...}
noindent ...\texttt{\\noindent ...}

数学

导入数学包

建议使用如下方式导入更多数学公式的支持:
usepackage{amsmath,amssymb,amsthm}\texttt{\\usepackage\{amsmath,amssymb,amsthm\}}

对齐公式:

begin{align*}\texttt{\\begin\{align*\}} 并结合 &\texttt{\&} 来指定对齐

自定义算子
\usepackage{amsmath}
\DeclareMathOperator{\arctg}{arctg}
\begin{document}
User-defined operator for arctangent:
\[
    \arctg \frac{\pi}{3} = \sqrt{3}
.\]
间距控制
\begin{align*}
f(x) &= x^2\! +3x\! +2 \\
f(x) &= x^2+3x+2 \\
f(x) &= x^2\, +3x\, +2 \\
f(x) &= x^2\: +3x\: +2 \\
f(x) &= x^2\; +3x\; +2 \\
f(x) &= x^2\ +3x\ +2 \\
f(x) &= x^2\quad +3x\quad +2 \\
f(x) &= x^2\qquad +3x\qquad +2 
\end{align*}
\begin{align*} f(x) &= x^2\! +3x\! +2 \\ f(x) &= x^2+3x+2 \\ f(x) &= x^2\, +3x\, +2 \\ f(x) &= x^2\: +3x\: +2 \\ f(x) &= x^2\; +3x\; +2 \\ f(x) &= x^2\ +3x\ +2 \\ f(x) &= x^2\quad +3x\quad +2 \\ f(x) &= x^2\qquad +3x\qquad +2 \end{align*}

运算符之间本身也有间距,如下:

  • \thinmuskip (默认情况下它等于 3 mu)
  • \medmuskip (默认等于 4 mu)
  • \thickmuskip (默认等于 5 mu)
显示样式
  • \textstyle :应用段落中数学公式的排版样式
  • \displaystyle :应用单独成行数学公式的排版样式
  • \scriptstyle :应用下标或上标的排版样式
  • \scriptscriptstyle :应用用于二阶下标或上标的样式
数学字体
\mathcal{RQSZ}
\mathfrak{RQSZ}
\mathbb{RQSZ}
\mathnormal{3x^2 \in R \subset Q}
\mathrm{3x^2 \in R \subset Q}
\mathit{3x^2 \in R \subset Q}
\mathbf{3x^2 \in R \subset Q}
\mathsf{3x^2 \in R \subset Q}
\mathtt{3x^2 \in R \subset Q}

RQSZRQSZRQSZ3x2RQ3x2RQ3x2RQ3x2RQ3x2RQ3x2RQ\begin{aligned} \mathcal{RQSZ} \\ \mathfrak{RQSZ} \\ \mathbb{RQSZ} \\ \mathnormal{3x^2 \in R \subset Q} \\ \mathrm{3x^2 \in R \subset Q} \\ \mathit{3x^2 \in R \subset Q} \\ \mathbf{3x^2 \in R \subset Q} \\ \mathsf{3x^2 \in R \subset Q} \\ \mathtt{3x^2 \in R \subset Q} \end{aligned}

其他数学公式请去查表

图片

LaTeX\LaTeX 无法自行管理图像,因此我们需要使用 graphicx 包。要使用它,我们需要在导言部分包含以下行:
usepackage{graphicx}\texttt{\\usepackage\{graphicx\}}
然后设置图片路径 (可选):
graphicspath{ {./images/} }\texttt{\\graphicspath\{ \{./images/\} \}}

大小
  • includegraphics[scale=1.5]{overleaf-logo}\texttt{\\includegraphics[scale=1.5]\{overleaf-logo\}}
  • includegraphics[width=5cm, height=4cm]{overleaf-logo}\texttt{\\includegraphics[width=5cm, height=4cm]\{overleaf-logo\}}
  • includegraphics[0.8textwidth]{overleaf-logo}\texttt{\\includegraphics[0.8\\textwidth]\{overleaf-logo\}}:根据文本宽度,也可以是 linewidth\texttt{\\linewidth}
  • includegraphics[scale=1.2, angle=45]{overleaf-logo}\texttt{\\includegraphics[scale=1.2, angle=45]\{overleaf-logo\}}:带上旋转
figure 环境于普通图片
\begin{figure}[t]
\includegraphics[width=8cm]{Plot}
\centering    % 要求图片居中,默认是左对齐
\end{figure}
参数 位置
h 将浮动元素放置于此 ,即 大约 在源文本中出现的相同位置(但不是 正好 在该位置)
t 位于页面的 顶部 。
b 定位在页面的 底部 。
p 将浮动元素放置在专门的页面上。
! 覆盖 LaTeX 用于确定"良好"浮动位置的内部参数。
H 将浮动元素精确放置在 LaTeX 代码中的指定位置。需要使用 float 包,但偶尔可能会引发问题。这某种程度上等同于 h! 。
环绕图片

需要导入包:
usepackage{wrapfig}\texttt{\\usepackage\{wrapfig\}}
基本用法:

\begin{wrapfigure}[lineheight]{position}{width}
  ...
\end{wrapfigure}

位置参数有八个可能的值:

r R 文本右侧
l L 文本左侧
i I 内边缘—靠近装订(在_双面_文档中)
o O 外缘——远离装订

大写版本允许图形浮动。小写版本表示就这里。

实例:

\begin{wrapfigure}{r}{0.25\textwidth} %this figure will be at the right
    \centering
    \includegraphics[width=0.25\textwidth]{mesh}
\end{wrapfigure}

There are several ways to plot a function of two variables, 
depending on the information you are interested in. For 
instance, if you want to see the mesh of a function so it 
easier to see the derivative you can use a plot like the 
one on the left.

\begin{wrapfigure}{l}{0.25\textwidth}
    \centering
    \includegraphics[width=0.25\textwidth]{contour}
\end{wrapfigure}

On the other side, if you are only interested on
certain values you can use the contour plot, you 
can use the contour plot, you can use the contour 
plot, you can use the contour plot, you can use 
the contour plot, you can use the contour plot, 
you can use the contour plot, like the one on the left.

⑧工具/学术/精通Latex/image 3.webp

配图说明、标注和引用

caption{Example of a parametric plot ($ sin (x), cos(x), x $)}\texttt{\\caption\{Example of a parametric plot (\$ \\sin (x), \\cos(x), x \$)\}}
若需要把 caption 放在侧面或者其他位置,请引入:
usepackage[rightcaption]{sidecap}\texttt{\\usepackage[rightcaption]\{sidecap\}}

同时也有 leftcaption,outercaption,innercaption\texttt{leftcaption,outercaption,innercaption}

举例:

\begin{SCfigure}[0.5][h]
\caption{Using again the picture of the universe.
This caption will be on the right}
\includegraphics[width=0.6\textwidth]{universe}
\end{SCfigure}

别忘了每个图都最好定义一个标签:label{fig:xxx}\texttt{\\label\{fig:xxx\}}
然后引用时直接:ref{fig:xxxx}\texttt{\\ref\{fig:xxxx\}}pageref{fig:xxxx}\texttt{\\pageref\{fig:xxxx\}}

如果想要和目录一样有个图片索引,还可以直接使用:
listoffigures\texttt{\\listoffigures}

高分辨率与低分辨率

因为 LaTeX\LaTeX 不需要图片后缀,所以当存在同名文件时请用如下方式决定优先级,开发环境使用低分辨率的 .png\texttt{.png},生产环境使用高分辨率的 .pdf\texttt{.pdf}

  • 开发环境: DeclareGraphicsExtensions{.png,.pdf}\texttt{\\DeclareGraphicsExtensions\{.png,.pdf\}}
  • 生产环境: DeclareGraphicsExtensions{.pdf,.png}\texttt{\\DeclareGraphicsExtensions\{.pdf,.png\}}
图片对齐

要更改对齐方式,请导入:usepackage[export]{adjustbox}\texttt{\\usepackage[export]\{adjustbox\}}
然后在使用时就可以对齐了:includegraphics[width=0.5textwidth, right]{overleaf-logo}\texttt{\\includegraphics[width=0.5\\textwidth, right]\{overleaf-logo\}}

多图格式

可以在一个图中插入多张图片,每张图片都有自己的引用和标签。
usepackage{subcaption}\texttt{\\usepackage\{subcaption\}}

\begin{figure}[h]

\begin{subfigure}{0.5\textwidth}
\includegraphics[width=0.9\linewidth, height=6cm]{overleaf-logo} 
\caption{Caption1}
\label{fig:subim1}
\end{subfigure}

\begin{subfigure}{0.5\textwidth}
\includegraphics[width=0.9\linewidth, height=6cm]{mesh}
\caption{Caption 2}
\label{fig:subim2}
\end{subfigure}

\caption{Caption for this figure with two images}
\label{fig:image2}
\end{figure}
文本环绕图形

usepackage{wrapfig}\texttt{\\usepackage\{wrapfig\}}

\begin{wrapfigure}{l}{0.25\textwidth}
\includegraphics[width=0.9\linewidth]{overleaf-logo} 
\caption{Caption1}
\label{fig:wrapfig}
\end{wrapfigure}

image 11.webp

在 LaTex 中直接绘图

TiKZ 宏包

表格

tabular 环境是 LaTeX 创建表格的默认方法:

\begin{center}
\begin{tabular}{ |c|c|c| } 
 \hline
 cell1 & cell2 & cell3 \\ 
 cell4 & cell5 & cell6 \\ 
 cell7 & cell8 & cell9 \\ 
 \hline
\end{tabular}
\end{center}
  • { |c|c|c| }:在表格中使用三个由垂直线分隔的列,每个 c 表示列内容将居中。您也可以使用 r 将文本右对齐,以及 l 用于左对齐。
% 也可以使用双分割线
\begin{center}
\begin{tabular}{||c c c c||} 
 \hline
 Col1 & Col2 & Col2 & Col3 \\ [0.5ex] 
 \hline\hline
 1 & 6 & 87837 & 787 \\ 
 \hline
 2 & 7 & 78 & 5415 \\
 \hline
 3 & 545 & 778 & 7507 \\
 \hline
 4 & 545 & 18744 & 7560 \\
 \hline
 5 & 88 & 788 & 6344 \\ [1ex] 
 \hline
\end{tabular}
\end{center}

⑧工具/学术/精通Latex/image 4.webp

固定宽度的表格

先引入:usepackage{array}\texttt{\\usepackage\{array\}}
然后在写标题头部时引入:
begin{tabular}{ m{5em} m{1cm} m{1cm} }\texttt{\\begin\{tabular\}\{ m\{5em\} m\{1cm\} m\{1cm\} \}}
对齐选项有 m 表示居中,p 表示顶部对齐,b 表示底部对齐。使用这些参数时,文本会自动格式化以适应每个单元格。

控制表格宽度

如果您不需要控制每个单元格的宽度,而是需要控制整个表格的宽度,并均匀分配内部空间,请使用 tabularx 包。请参阅下例:

\usepackage{tabularx}
\begin{document}
\begin{tabularx}{0.8\textwidth} { 
  | >{\raggedright\arraybackslash}X 
  | >{\centering\arraybackslash}X 
  | >{\raggedleft\arraybackslash}X | }
 \hline
 item 11 & item 12 & item 13 \\
 \hline
 item 21  & item 22  & item 23  \\
\hline
\end{tabularx}

环境 tabularx 与 tabular 类似,但更加灵活。要使用它,需在文档前置部分添加行 \usepackage{tabularx}
⑧工具/学术/精通Latex/image 5.webp

合并行和列

使用 multicolumn\texttt{\\multicolumn} 即可:
multicolumn{4}{c}{Country List}\texttt{\\multicolumn\{4\}\{c\}\{Country List\}}
如果合并行,usepackage{multirow}\texttt{\\usepackage\{multirow\}}
使用方法举例:

\multirow{3}{4em}{Multiple row} & cell2 & cell3 \\ 
& cell5 & cell6 \\ 
& cell8 & cell9 \\

⑧工具/学术/精通Latex/image 6.webp

多页表格

适用跨页的场景:
usepackage{longtable}\texttt{\\usepackage\{longtable\}}

\documentclass{article}
\usepackage{longtable}

\begin{document}
 
 \begin{longtable}[c]{| c | c |}
 \caption{Long table caption.\label{long}}\\

 \hline
 \multicolumn{2}{| c |}{Begin of Table}\\
 \hline
 Something & something else\\
 \hline
 \endfirsthead

 \hline
 \multicolumn{2}{|c|}{Continuation of Table \ref{long}}\\
 \hline
 Something & something else\\
 \hline
 \endhead

 \hline
 \endfoot

 \hline
 \multicolumn{2}{| c |}{End of Table}\\
 \hline\hline
 \endlastfoot

 Lots of lines & like this\\
 Lots of lines & like this\\
 Lots of lines & like this\\
 Lots of lines & like this\\
 Lots of lines & like this\\
 Lots of lines & like this\\
 Lots of lines & like this\\
 Lots of lines & like this\\
 ...
 Lots of lines & like this\\
 \end{longtable}

image 8.webp

  • \endfirsthead 此命令以上的内容将出现在表格的开头,在第一页。
  • \endhead 在此命令之前、\endfirsthead 以下的内容将在除第一页外的每一页的表格顶部显示。
  • \endfoot 与 \endhead 类似,在 \endhead 之后和此命令之前输入的内容,将在除最后一页外的每一页表格底部显示。
  • \endlastfoot 与 \endfirsthead 类似。在 \endfoot 之后和此命令之前的内容将仅在表格出现的最后一页显示在表格底部。
定位表格

将表格置于 begin{table} ... end{table}\texttt{\\begin\{table\} ... \\end\{table\}} 中,即可和图片一样使用 [h!][t][b]\texttt{[h!][t][b]} 等进行定位放置。
同样,和图片一样支持:listoftables\texttt{\\listoftables}

表格外观

全局表格样式需要在 begin{document}\texttt{\\begin\{document\}} 之前:

  • setlength{arrayrulewidth}{0.5mm}\texttt{\\setlength\{\\arrayrulewidth\}\{0.5mm\}}:设置了表格边框的厚度
  • setlength{tabcolsep}{18pt}\texttt{\\setlength\{\\tabcolsep\}\{18pt\}}:将文本与其包含单元格的左右边距之间的空间设置为 18pt
  • renewcommand{arraystretch}{1.5}\texttt{\\renewcommand\{\\arraystretch\}\{1.5\}}:每行的高度设置为相对于其默认高度的1.5倍。
斑马着色方式

需要引入另外的包:
usepackage[table]{xcolor}\texttt{\\usepackage[table]\{xcolor\}}

\rowcolors{3}{green!80!yellow!50}{green!70!yellow!40}
\begin{tabular}{ |p{3cm}|p{3cm}|p{3cm}|  } % 注意放在begin{tabular}之前

三个参数分别为:从第几行开始上色,奇数行颜色,偶数行颜色。

自定义着色方式
\documentclass{article}
\usepackage[table]{xcolor}
\setlength{\arrayrulewidth}{1mm}
\setlength{\tabcolsep}{18pt}
\renewcommand{\arraystretch}{2.5}
\newcolumntype{s}{>{\columncolor[HTML]{AAACED}} p{3cm}}     % 列的背景颜色
% 定义一个名为 `s` 的列类型,其对齐方式为 `p`,列宽为 `3cm`,颜色使用 HTML 格式设置为 `AAACED`。该新列类型用于 `tabular` 环境。

\arrayrulecolor[HTML]{DB5800}                               % 在这里设置线条颜色
\begin{document}
\begin{tabular}{ |s|p{3cm}|p{3cm}| }
\hline
\rowcolor{lightgray} \multicolumn{3}{|c|}{Country List} \\
\hline
Country Name or Area Name& ISO ALPHA 2 Code &ISO ALPHA 3 \\
\hline
Afghanistan & AF &AFG \\
\rowcolor{gray}        % 行背景颜色
Aland Islands & AX & ALA \\
Albania   &AL & ALB \\
Algeria  &DZ & DZA \\
American Samoa & AS & ASM \\
Andorra & AD & \cellcolor[HTML]{AA0044} AND    \\        % 单元格背景颜色
Angola & AO & AGO \\
\hline
\end{tabular}
\end{document}
文本环绕表格

如果你的表格没有占用所有可用空间,并且你想在它旁边或前面放置文本,可以使用 wrapfig 包。
首先,导入该包 usepackage{wrapfig}\texttt{\\usepackage\{wrapfig\}}
然后你可以使用环境 wraptable,该环境接受两个参数:第一个是对齐方式,可以是 lrci 或 o,分别代表左对齐、右对齐、居中对齐、内对齐和外对齐。第二个是表格容器的宽度,需要注意的是,这个参数必须与表格的宽度相同,否则对齐可能不会正确。

Praesent in sapien. Lorem ipsum dolor sit amet, consectetuer 
adipiscing elit. Duis fringilla tristique neque. Sed interdum 
libero ut metus. Pellentesque placerat. Nam rutrum augue a leo. 
Morbi sed elit sit amet ante lobortis sollicitudin.

\begin{wraptable}{r}{8cm}    % 重点是这个
\arrayrulecolor[HTML]{DB5800}
\centering
\begin{tabular}{ |s|p{2cm}|  }
\hline
\rowcolor{lightgray} \multicolumn{2}{|c|}{Country List} \\
\hline
Country Name or Area Name& ISO ALPHA 2 Code \\
\hline
Afghanistan & AF \\
\rowcolor{gray}
Aland Islands & AX \\
Albania    &AL  \\
Algeria   &DZ \\
American Samoa & AS \\
Andorra & \cellcolor[HTML]{AA0044} AD   \\
Angola & AO \\
\hline
\end{tabular}
\caption{Table inside a wraptable}
\label{table:ta2}
\end{wraptable}

Praesent in sapien. Lorem ipsum dolor sit amet, consectetuer 
adipiscing elit. Duis fringilla tristique neque. Sed interdum 
libero ut metus. Pellentesque placerat. Nam rutrum augue a leo. 
Morbi sed elit sit amet ante lobortis sollicitudin...

image 12.webp

图表列表
\documentclass{article}
\usepackage{graphicx}
\usepackage{array}
\graphicspath{ {figures/} }

\renewcommand{\listfigurename}{List of plots}    % 重新编写标题
\renewcommand{\listtablename}{Tables}            % 重新编写表格题目

\begin{document}

\thispagestyle{empty}    % 去除页面底部的页码
\listoffigures
\listoftables
\clearpage
\pagenumbering{arabic}   % 使用阿拉伯数字重新开始页码。

Lorem ipsum dolor sit amet, consectetuer adipiscing elit.  Etiam lobortisfacilisis...
\end{document}

image 13.webp

参考文献和引文

使用 BibTeX 进行参考文献管理

参考文献:仅仅是 \bibitems 的列表。

\begin{thebibliography}{9}
\bibitem{texbook}
Donald E. Knuth (1986) \emph{The \TeX{} Book}, Addison-Wesley Professional.

\bibitem{lamport94}
Leslie Lamport (1994) \emph{\LaTeX: a document preparation system}, Addison
Wesley, Massachusetts, 2nd ed.
\end{thebibliography}

引用时使用 cite{}\texttt{\\cite\{\}} 即可

不过不建议使用上面的方法,也不是论文里的典范

应该使用 .bib\texttt{.bib} 文件,如去网站查找后得到:

@inproceedings{lesk:1977,
  title={Computer Typesetting of Technical Journals on {UNIX}},
  author={Michael Lesk and Brian Kernighan},
  booktitle={Proceedings of American Federation of
             Information Processing Societies: 1977
             National Computer Conference},
  pages={879--888},
  year={1977},
  address={Dallas, Texas}
}

引用时使用:cite{lesk:1977}\texttt{\\cite\{lesk:1977\}} 就行。

使用 natbib 进行参考文献管理

请引入:usepackage{natbib}\texttt{\\usepackage\{natbib\}}
同样,引用时使用 cite{}\texttt{\\cite\{\}}
示例:

\usepackage{natbib}
\bibliographystyle{unsrtnat}    % 设置参考文献样式 _unsrtnat_
\title{Bibliography management: \texttt{natbib} package}
\author{Overleaf}
\date {April 2021}

\begin{document}

\maketitle

This document is an example of \texttt{natbib} package using in bibliography
management. Three items are cited: \textit{The \LaTeX\ Companion} book 
\cite{latexcompanion}, the Einstein journal paper \cite{einstein}, and the 
Donald Knuth's website \cite{knuthwebsite}. The \LaTeX\ related items are 
\cite{latexcompanion,knuthwebsite}. 

\medskip    % 插入垂直间距

\bibliography{sample}    % 引入sample.bib文件

\end{document}

image 14.webp

bibtex 支持的参考文献样式

使用:bibliographystyle{stylename}\texttt{\\bibliographystyle\{stylename\}} 进行设置。

样式名称 输出
abbrv ⑧工具/学术/attachments/0e36af80f17714754497d109075f06b5_MD5.webp
acm ⑧工具/学术/attachments/c256cbeff531926acc0c09dda1c46685_MD5.webp
alpha ⑧工具/学术/attachments/3a9d67453f0b19605bc13991b94a75b2_MD5.webp
apalike ⑧工具/学术/attachments/ac2ee34ecfb91b58513b72c60eba765d_MD5.webp
ieeetr ⑧工具/学术/attachments/059fce83877473ac550f6fe495bf116f_MD5.webp
plain ⑧工具/学术/attachments/8b653c461588a9d0850c3dd2a5d89f8d_MD5.webp
siam ⑧工具/学术/attachments/0f42df47c5877654833f0636c52d1855_MD5.webp
unsrt ⑧工具/学术/attachments/7b4a60a25f8e3f73f3b24a4dd7ebcac7_MD5.webp
natbib 支持的参考文献样式

使用:bibliographystyle{stylename}\texttt{\\bibliographystyle\{stylename\}} 进行设置。

stylename 输出
dinat ⑧工具/学术/attachments/104799c5c4fd82fa68de4437a44b3165_MD5.webp
plainnat ⑧工具/学术/attachments/f7315427e5be71f1c192ab110c351a86_MD5.webp
abbrvnat ⑧工具/学术/attachments/61ca69312c336b3b8bc542e3a0fe81a1_MD5.webp
unsrtnat ⑧工具/学术/attachments/33fa6ccff4278c16a6a832be7c43dcc0_MD5.webp
rusnat ⑧工具/学术/attachments/65a07f447b3939453cb8258a1d25c319_MD5.webp
ksfh_nat ⑧工具/学术/attachments/8386b2df57a0c949da53126941886309_MD5.webp
natbib 引用格式

使用 \setcitestyle{authoryear,open={((},close={))}} 来设置引用风格,例如 ((Smith, 2020))

命令 描述
\citet{} 文本引用
\citep{} 括号引用
\citet*{} 与 \citet 相同,但如果有多位作者,所有姓名都会被打印
\citep*{} 与 \citep 相同,但如果有多位作者,则打印所有姓名
\citeauthor{} 仅打印作者姓名
\citeyear{} 仅打印出版年份。

语言

使用 documentclass{ctexart}\texttt{\\documentclass\{ctexart\}} 结合 XeTex\texttt{XeTex} 即可实现多语言。

  • setCJKmainfont{BabelStone Han}\texttt{\\setCJKmainfont\{BabelStone Han\}}:使用系统字体
  • setCJKsansfont{}\texttt{\\setCJKsansfont\{\}}:使用无衬线字体
  • setCJKmonofont{}\texttt{\\setCJKmonofont\{\}}:使用特定字体

文档结构

LaTeX 可以组织、编号和索引文档的章节和节。根据文档类,定义节的最大深度可达 7 级:

-1 \part{part}
0 \chapter{chapter} 一般用于书籍和报告
1 \section{section}
2 \subsection{subsection}
3 \subsubsection{subsubsection}
4 \paragraph{paragraph}
5 \subparagraph{subparagraph}
在目录中加入无编号章节

addcontentsline{toc}{section}{Title of the section}\texttt{\\addcontentsline\{toc\}\{section\}\{Title of the section\}}

自定义章节样式

usepackage{titlesec}\texttt{\\usepackage\{titlesec\}}

\titleformat
{\chapter} % command
[display] % shape
{\bfseries\Large\itshape} % format
{Story No. \ \thechapter} % label
{0.5ex} % sep
{
    \rule{\textwidth}{1pt}
    \vspace{1ex}
    \centering
} % before-code
[
\vspace{-0.5ex}%
\rule{\textwidth}{0.3pt}
] % after-code

\titleformat{\section}[wrap]
{\normalfont\bfseries}
{\thesection.}{0.5em}{}

存在两个通用命令:
\titleformat{<command>}[<shape>]{<format>}{<label>}{<sep>}{<before-code>}[<after-code>]
其中 [<shape>] 和 [<after-code>] 是可选参数,且:

  • <command> 是要重新定义的分节命令:\part\chapter\section\subsection\subsubsection\paragraph 或 \subparagraph
  • <shape> 是分节段落形状;可能的值有:hangblockdisplayruninleftmarginrightmargindropwrap 和 frame
  • <format> 是应用于标题、标签和文本的格式;例如 \normalfont\Large\bfseries
  • <label> 指定分节标签。
  • <sep> 是标签与标题主体之间的水平间距,它必须是一个长度且不能为空。
  • <before-code> 是标题主体之前的代码。
  • <after-code> 是标题主体之后的代码。
目录

使用 tableofcontents\texttt{\\tableofcontents} 即可。

章节引用

section{Introduction} label{introduction}\texttt{\\section\{Introduction\} \\label\{introduction\}}:定义是加入 label 然后使用时 ref{}\texttt{\\ref\{\}} 就行。

索引

usepackage{imakeidx}\texttt{\\usepackage\{imakeidx\}}

  • 然后要生效是要使用:makeindex\texttt{\\makeindex}
  • 要向索引中添加条目,使用命令 index{}\texttt{\\index\{\}}
  • printindex\texttt{\\printindex}:最后实际渲染
    索引美化:
\makeindex[columns=3, title=Alphabetical Index]
% 格式化需要引入ist文件
\makeindex[columns=3, title=Alphabetical Index, 
           options= -s example_style.ist]
%% 以下为ist %%
headings_flag 1

heading_prefix "\n\\centering\\large\\sffamily\\bfseries%
\\noindent\\textbf{"heading_suffix "}\\par\\nopagebreak\n"

item_0 "\n \\item \\small "

delim_0 " \\hfill "
delim_1 " \\hfill "
delim_2 " \\hfill "

效果:
image 15.webp
makeindex[columns=3, title=Alphabetical Index, intoc]\texttt{\\makeindex[columns=3, title=Alphabetical Index, intoc]}:在目录中包含索引。

\makeindex 命令的参数

title在特定索引的开头需要排版标题。例如,在格式化索引中展示了示例。
intoc如果选择此选项,索引标题将被放置在目录中。
columns使用语法 key=value,其中值必须是一个表示列数的整数。默认值为 2。
columnsep指定表示列之间间隔的单位。语法必须为 key=value,例如 columnsep=2em
columnseprule如果传递了选项,将在列之间渲染一条垂直标尺。

词汇表

usepackage{glossaries}\texttt{\\usepackage\{glossaries\}}

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{glossaries}

\makeglossaries

\newglossaryentry{latex}
{
    name=latex,
    description={Is a markup language specially suited 
    for scientific documents}
}

\newglossaryentry{maths}
{
    name=mathematics,
    description={Mathematics is what mathematicians do}
}

\title{How to create a glossary}
\author{ }
\date{ }

\begin{document}
\maketitle

The \Gls{latex} typesetting markup language is specially suitable 
for documents that include \gls{maths}. 

\clearpage

\printglossaries

\end{document}

image 16.webp
如果想使用缩略语:usepackage[acronym]{glossaries}\texttt{\\usepackage[acronym]\{glossaries\}}

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[acronym]{glossaries}

\makeglossaries

\newglossaryentry{latex}
{
        name=latex,
        description={Is a mark up language specially suited for 
scientific documents}
}

\newglossaryentry{maths}
{
        name=mathematics,
        description={Mathematics is what mathematicians do}
}

\newglossaryentry{formula}
{
        name=formula,
        description={A mathematical expression}
}

\newacronym{gcd}{GCD}{Greatest Common Divisor}

\newacronym{lcm}{LCM}{Least Common Multiple}

\begin{document}

The \Gls{latex} typesetting markup language is specially suitable 
for documents that include \gls{maths}. \Glspl{formula} are 
rendered properly an easily once one gets used to the commands.

Given a set of numbers, there are elementary methods to compute 
its \acrlong{gcd}, which is abbreviated \acrshort{gcd}. This 
process is similar to that used for the \acrfull{lcm}.

\clearpage

\printglossary[type=\acronymtype]

\printglossary

\end{document}

\gls{ }要打印术语的小写形式。例如,\gls{maths} 在使用时打印 mathematics
\Gls{ }与 \gls 相同,但首字母将打印为大写。示例:\Gls{maths} 打印 Mathematics
\glspl{ }与 \gls 相同,但该术语以复数形式出现。例如,\glspl{formula} 将在您的最终文档中写入 formulas
\Glspl{ }与 \Gls 相同,但该术语以复数形式出现。例如,\Glspl{formula} 渲染为 Formulas

术语表

文件工程
  • include{}\texttt{\\include\{\}}:引入分页
  • input{}\texttt{\\input\{\}}:引入不分页
  • 使用 .sty\texttt{.sty} 文件把头文件格式放在单独文件里:ProvidesPackage{example}\texttt{\\ProvidesPackage\{example\}}
    • 然后记得在主文件引入:usepackage{example}\texttt{\\usepackage\{example\}}
  • import{}{}\texttt{\\import\{\}\{\}}:使用方法和之前的类似,第一个参数是路径,第二个参数是文件,记得 usepackage{import}\texttt{\\usepackage\{import\}}
超链接

usepackage{hyperref}\texttt{\\usepackage\{hyperref\}}
在导入 hyperref 时必须小心:通常,它必须是最后导入的包——但这条规则可能存在一些例外。

% 可以设置样式
\hypersetup{
    colorlinks=true,
    linkcolor=blue,    % 链接着色
    filecolor=magenta, % 内部链接,由交叉引用元素生成的,以蓝色显示。      
    urlcolor=cyan,     % 网站链接设置为青色
    pdftitle={Overleaf Example},    % 为方便生成的pdf,作为pdf标题
    pdfpagemode=FullScreen,         % 显示的pdf的页面样式
}

使用时使用 href{}\texttt{\\href\{\}}

如果想使用自定义链接,可以使用

It's also possible to link directly any word 
or \hyperlink{thesentence}{any sentence} in you document.

If you read this text, you will get no information.  Really?  
Is there no information?

For instance \hypertarget{thesentence}{this sentence}.

其中第一个值是 label,第二个是具体内容

格式化

字体

  • textsl\texttt{\\textsl}:使用看起来像斜体的字体
Command Output
\tiny ⑧工具/学术/attachments/255c790dcc8d9766fedb6f6990485afd_MD5.webp
\scriptsize ⑧工具/学术/attachments/3214ba06cd6961fa879ae51df7767638_MD5.webp
\footnotesize ⑧工具/学术/attachments/eaabd25e35331f3312b40d4ca5c08810_MD5.webp
\small ⑧工具/学术/attachments/d6c271ee884563e99fcf98c7df22699a_MD5.webp
\normalsize ⑧工具/学术/attachments/3af45b31c43970af907767c91c90558e_MD5.webp
\large ⑧工具/学术/attachments/f059819f4ba906f5a64aee6ed7200fcf_MD5.webp
\Large ⑧工具/学术/attachments/734a3151fcfe0c9d550f74eed41ef055_MD5.webp
\LARGE ⑧工具/学术/attachments/73d9ac263a2d8a1716c6d13bb6564c09_MD5.webp
\huge ⑧工具/学术/attachments/6b9933ed68f00da0085fc37f43fad9b4_MD5.webp
\Huge ⑧工具/学术/attachments/da52abca87df6029f3197f9fe8e3e4e2_MD5.webp
默认字体族
字体 = 字族 命令 切换命令 输出
衬线体(罗马体) \textrm{Sample Text 0123} \rmfamily ⑧工具/学术/attachments/306a6d2e5afb12849c47e67f7dc7c073_MD5.webp
无衬线字体 \textsf{Sample Text 0123} \sffamily ⑧工具/学术/attachments/ff8942023acb72d9c657b03e4f11d76a_MD5.webp
打字机字体(等宽字体) \texttt{Sample Text 0123} \ttfamily ⑧工具/学术/attachments/66d6948fef533b35df36de61b9f4adcc_MD5.webp

字体样式

样式 命令 切换命令 输出
中等 \textmd{Sample Text 0123} \mdseries ⑧工具/学术/attachments/180dd8e34f36e564553726f3f69dc860_MD5.webp
粗体 \textbf{Sample Text 0123} \bfseries ⑧工具/学术/attachments/5a9ff40e0a43adb0fe793e5043979e5a_MD5.webp
直立 \textup{Sample Text 0123} \upshape ⑧工具/学术/attachments/306a6d2e5afb12849c47e67f7dc7c073_MD5.webp
斜体 \textit{Sample Text 0123} \itshape ⑧工具/学术/attachments/18cc083e4f0538c295596677a7685f56_MD5.webp
倾斜 \textsl{Sample Text 0123} \slshape ⑧工具/学术/attachments/4df74fd4d12bfac785a1edc728769fee_MD5.webp
小写字母 \textsc{Sample Text 0123} \scshape ⑧工具/学术/attachments/48d790f16a30e793288b682727a4b9f9_MD5.webp
更改默认文档字体

usepackage{tgbonum}\texttt{\\usepackage\{tgbonum\}}
命令 \fontfamily{qcr}\selectfont 将设置 TeX gyre 光标字体类型,其字体代码为 qcr ,用于括号内的文本。还有更多 LATEX 字体类型可供使用。
衬线字体、无衬线字体和打字机字体

字体 “字体包名称” “字体代码” 示例
Computer Modern Roman cmr ⑧工具/学术/attachments/54664b645fa34d2987cdd12d1aeee3f0_MD5.webp
Latin Modern Roman lmodern lmr ⑧工具/学术/attachments/421e8b1c2b2f9ab0a940979083ffe2cc_MD5.webp
Latin Modern Dunhill lmodern lmdh ⑧工具/学术/attachments/f614ca89cc49ea19673171c138cf98ab_MD5.webp
TeX Gyre Termes tgtermes qtm ⑧工具/学术/attachments/c2b748b042651b1d0df482857f7f7cd7_MD5.webp
TeX Gyre Pagella tgpagella qpl ⑧工具/学术/attachments/c2975ec980a2aa8bf58b935e0878719a_MD5.webp
TeX Gyre Bonum tgbonum qbk ⑧工具/学术/attachments/6cae1ba2ce5f5e8534d46ed761ac0bcd_MD5.webp
TeX Gyre Schola tgschola qcs ⑧工具/学术/attachments/4c359e4fe18f30d5e5cfd72f289f4f59_MD5.webp
Times mathptmx ptm ⑧工具/学术/attachments/7cb5ba66ebbf9105715fcb2e44f335bb_MD5.webp
Utopia / Fourier utopia / fourier put ⑧工具/学术/attachments/c4c3446848896bf0e50afe0a602da622_MD5.webp
Palatino palatino ppl ⑧工具/学术/attachments/3d42ecdce877928d2bd1b499db373b68_MD5.webp
Bookman bookman pbk ⑧工具/学术/attachments/738782284112ab39860eb15244e33ea6_MD5.webp
Charter charter bch ⑧工具/学术/attachments/ae4227ca5c394689de724c9a3a6f8968_MD5.webp
Computer Modern Sans Serif cmss ⑧工具/学术/attachments/08b8ca07bd1d8c9bda891880470c9022_MD5.webp
Latin Modern Sans Serif lmodern lmss ⑧工具/学术/attachments/b70fcad13e05be55c9f47f4853e02909_MD5.webp
TeX Gyre Adventor tgadventor qag ⑧工具/学术/attachments/b2528cd659b570351581061b06f98983_MD5.webp
TeX Gyre Heros tgheros qhv ⑧工具/学术/attachments/9e39ce232c91d7d59de9b617ba9598f2_MD5.webp
Helvetica helvet phv ⑧工具/学术/attachments/870fd69ce7e08d04d75b30b2d5b1fcb3_MD5.webp
Computer Modern Typewriter cmtt ⑧工具/学术/attachments/e5ad7f0a8fccb080b399d829b999b749_MD5.webp
Latin Modern Sans Typewriter lmodern lmtt ⑧工具/学术/attachments/244e475e363d97aac996a07b11b8c9f0_MD5.webp
TEX Gyre Cursor tgcursor qcr ⑧工具/学术/attachments/94cf37930a1ccb77d8e7a2c9988342bc_MD5.webp
Courier courier pcr ⑧工具/学术/attachments/e5b796bff8a5b8d27ba481b5b3387379_MD5.webp

演示文稿

命令

特定领域

自定义

附录-数学公式案例与表格

i=11ns=p11ps\sum_{i=1}^{\infty} \frac{1}{n^s} = \prod_p \frac{1}{1 - p^{-s}}

对齐公式:

\begin{align*} x&=y & w &=z & a&=b+c\\ 2x&=-y & 3w&=\frac{1}{2}z & a&=b\\ -4 + 5x&=2+y & w+2&=-1+w & ab&=cb \end{align*}
Math Mode
hat{a}\texttt{\\hat\{a\}} a^\hat{a} check{a}\texttt{\\check\{a\}} aˇ\check{a} tilde{a}\texttt{\\tilde\{a\}} a~\tilde{a}
acute{a}\texttt{\\acute\{a\}} aˊ\acute{a} grave{a}\texttt{\\grave\{a\}} aˋ\grave{a} dot{a}\texttt{\\dot\{a\}} a˙\dot{a}
ddot{a}\texttt{\\ddot\{a\}} a¨\ddot{a} breve{a}\texttt{\\breve\{a\}} a˘\breve{a} bar{a}\texttt{\\bar\{a\}} aˉ\bar{a}
vec{a}\texttt{\\vec\{a\}} a\vec{a} widehat{A}\texttt{\\widehat\{A\}} A^\widehat{A} widetilde{A}\texttt{\\widetilde\{A\}} A~\widetilde{A}
希腊字符
alpha\texttt{\\alpha} α\alpha theta\texttt{\\theta} θ\theta o\texttt{o} oo
beta\texttt{\\beta} β\beta vartheta\texttt{\\vartheta} ϑ\vartheta pi\texttt{\\pi} π\pi
gamma\texttt{\\gamma} γ\gamma iota\texttt{\\iota} ι\iota varpi\texttt{\\varpi} ϖ\varpi
delta\texttt{\\delta} δ\delta kappa\texttt{\\kappa} κ\kappa rho\texttt{\\rho} ρ\rho
epsilon\texttt{\\epsilon} ϵ\epsilon lambda\texttt{\\lambda} λ\lambda varrho\texttt{\\varrho} ϱ\varrho
varepsilon\texttt{\\varepsilon} ε\varepsilon mu\texttt{\\mu} μ\mu sigma\texttt{\\sigma} σ\sigma
zeta\texttt{\\zeta} ζ\zeta nu\texttt{\\nu} ν\nu varsigma\texttt{\\varsigma} ς\varsigma
eta\texttt{\\eta} η\eta xi\texttt{\\xi} ξ\xi tau\texttt{\\tau} τ\tau
upsilon\texttt{\\upsilon} υ\upsilon phi\texttt{\\phi} ϕ\phi varphi\texttt{\\varphi} φ\varphi
chi\texttt{\\chi} χ\chi psi\texttt{\\psi} ψ\psi omega\texttt{\\omega} ω\omega
Gamma\texttt{\\Gamma} Γ\Gamma Lambda\texttt{\\Lambda} Λ\Lambda Sigma\texttt{\\Sigma} Σ\Sigma
Psi\texttt{\\Psi} Ψ\Psi Delta\texttt{\\Delta} Δ\Delta Xi\texttt{\\Xi} Ξ\Xi
Upsilon\texttt{\\Upsilon} Υ\Upsilon Omega\texttt{\\Omega} Ω\Omega Theta\texttt{\\Theta} Θ\Theta
Pi\texttt{\\Pi} Π\Pi Phi\texttt{\\Phi} Φ\Phi
二元关系
<\texttt{<} << >\texttt{>} >> =\texttt{=} ==
leq\texttt{\\leq} \leq geq\texttt{\\geq} \geq equiv\texttt{\\equiv} \equiv
ll\texttt{\\ll} \ll gg\texttt{\\gg} \gg doteq\texttt{\\doteq} \doteq
prec\texttt{\\prec} \prec succ\texttt{\\succ} \succ sim\texttt{\\sim} \sim
preceq\texttt{\\preceq} \preceq succeq\texttt{\\succeq} \succeq simeq\texttt{\\simeq} \simeq
subset\texttt{\\subset} \subset supset\texttt{\\supset} \supset approx\texttt{\\approx} \approx
subseteq\texttt{\\subseteq} \subseteq supseteq\texttt{\\supseteq} \supseteq cong\texttt{\\cong} \cong
sqsubset\texttt{\\sqsubset} \sqsubset sqsupset\texttt{\\sqsupset} \sqsupset Join\texttt{\\Join} \Join
sqsubseteq\texttt{\\sqsubseteq} \sqsubseteq sqsupseteq\texttt{\\sqsupseteq} \sqsupseteq bowtie\texttt{\\bowtie} \bowtie
in\texttt{\\in} \in ni\texttt{\\ni} or owns\texttt{\\owns} \ni propto\texttt{\\propto} \propto
vdash\texttt{\\vdash} \vdash dashv\texttt{\\dashv} \dashv models\texttt{\\models} \models
mid\texttt{\\mid} \mid parallel\texttt{\\parallel} \parallel perp\texttt{\\perp} \perp
smile\texttt{\\smile} \smile frown\texttt{\\frown} \frown asymp\texttt{\\asymp} \asymp
:\texttt{:} :: notin\texttt{\\notin} \notin neq\texttt{\\neq} or ne\texttt{\\ne} \neq
二元操作符
命令 渲染 命令 渲染 命令 渲染
+\texttt{+} ++ -\texttt{-} - triangleleft\texttt{\\triangleleft} \triangleleft
pm\texttt{\\pm} ±\pm mp\texttt{\\mp} \mp triangleright\texttt{\\triangleright} \triangleright
cdot\texttt{\\cdot} \cdot div\texttt{\\div} ÷\div star\texttt{\\star} \star
times\texttt{\\times} ×\times setminus\texttt{\\setminus} \setminus ast\texttt{\\ast} \ast
cup\texttt{\\cup} \cup cap\texttt{\\cap} \cap circ\texttt{\\circ} \circ
sqcup\texttt{\\sqcup} \sqcup sqcap\texttt{\\sqcap} \sqcap bullet\texttt{\\bullet} \bullet
vee\texttt{\\vee} or lor\texttt{\\lor} \vee wedge\texttt{\\wedge} or land\texttt{\\land} \wedge diamond\texttt{\\diamond} \diamond
oplus\texttt{\\oplus} \oplus ominus\texttt{\\ominus} \ominus uplus\texttt{\\uplus} \uplus
odot\texttt{\\odot} \odot oslash\texttt{\\oslash} \oslash amalg\texttt{\\amalg} ⨿\amalg
otimes\texttt{\\otimes} \otimes bigcirc\texttt{\\bigcirc} \bigcirc dagger\texttt{\\dagger} \dagger
bigtriangleup\texttt{\\bigtriangleup} \bigtriangleup bigtriangledown\texttt{\\bigtriangledown} \bigtriangledown ddagger\texttt{\\ddagger} \ddagger
lhd\texttt{\\lhd} \lhd rhd\texttt{\\rhd} \rhd wr\texttt{\\wr} \wr
unlhd\texttt{\\unlhd} \unlhd unrhd\texttt{\\unrhd} \unrhd
大操作符
sum\texttt{\\sum} \sum bigcup\texttt{\\bigcup} \bigcup bigvee\texttt{\\bigvee} \bigvee
prod\texttt{\\prod} \prod bigcap\texttt{\\bigcap} \bigcap bigwedge\texttt{\\bigwedge} \bigwedge
coprod\texttt{\\coprod} \coprod bigsqcup\texttt{\\bigsqcup} \bigsqcup bigoplus\texttt{\\bigoplus} \bigoplus
int\texttt{\\int} \int oint\texttt{\\oint} \oint bigotimes\texttt{\\bigotimes} \bigotimes
bigodot\texttt{\\bigodot} \bigodot biguplus\texttt{\\biguplus} \biguplus
箭头
leftarrow\texttt{\\leftarrow} or gets\texttt{\\gets} \leftarrow longleftarrow\texttt{\\longleftarrow} \longleftarrow uparrow\texttt{\\uparrow} \uparrow
rightarrow\texttt{\\rightarrow} or to\texttt{\\to} \rightarrow longrightarrow\texttt{\\longrightarrow} \longrightarrow downarrow\texttt{\\downarrow} \downarrow
leftrightarrow\texttt{\\leftrightarrow} \leftrightarrow longleftrightarrow\texttt{\\longleftrightarrow} \longleftrightarrow updownarrow\texttt{\\updownarrow} \updownarrow
Leftarrow\texttt{\\Leftarrow} \Leftarrow Longleftarrow\texttt{\\Longleftarrow} \Longleftarrow Uparrow\texttt{\\Uparrow} \Uparrow
Rightarrow\texttt{\\Rightarrow} \Rightarrow Longrightarrow\texttt{\\Longrightarrow} \Longrightarrow Downarrow\texttt{\\Downarrow} \Downarrow
Leftrightarrow\texttt{\\Leftrightarrow} \Leftrightarrow Longleftrightarrow\texttt{\\Longleftrightarrow} \Longleftrightarrow Updownarrow\texttt{\\Updownarrow} \Updownarrow
mapsto\texttt{\\mapsto} \mapsto longmapsto\texttt{\\longmapsto} \longmapsto nearrow\texttt{\\nearrow} \nearrow
hookleftarrow\texttt{\\hookleftarrow} \hookleftarrow hookrightarrow\texttt{\\hookrightarrow} \hookrightarrow searrow\texttt{\\searrow} \searrow
leftharpoonup\texttt{\\leftharpoonup} \leftharpoonup rightharpoonup\texttt{\\rightharpoonup} \rightharpoonup swarrow\texttt{\\swarrow} \swarrow
leftharpoondown\texttt{\\leftharpoondown} \leftharpoondown rightharpoondown\texttt{\\rightharpoondown} \rightharpoondown nwarrow\texttt{\\nwarrow} \nwarrow
rightleftharpoons\texttt{\\rightleftharpoons} \rightleftharpoons iff\texttt{\\iff}     \iff leadsto\texttt{\\leadsto} \leadsto
定界符
(\texttt{(} (( )\texttt{)} )) uparrow\texttt{\\uparrow} \uparrow
[\texttt{[} or lbrack\texttt{\\lbrack} [[ ]\texttt{]} or rbrack\texttt{\\rbrack} ]] downarrow\texttt{\\downarrow} \downarrow
lbrace\texttt{\\lbrace} {\lbrace rbrace\texttt{\\rbrace} }\rbrace updownarrow\texttt{\\updownarrow} \updownarrow
langle\texttt{\\langle} \langle rangle\texttt{\\rangle} \rangle $\texttt{ }$ or vert\texttt{\\vert} $ $
lfloor\texttt{\\lfloor} \lfloor rfloor\texttt{\\rfloor} \rfloor Vert\texttt{\\Vert} \Vert
lceil\texttt{\\lceil} \lceil rceil\texttt{\\rceil} \rceil /\texttt{/} //
backslash\texttt{\\backslash} \\backslash (dual empty) ..
lgroup\texttt{\\lgroup} \lgroup rgroup\texttt{\\rgroup} \rgroup lmoustache\texttt{\\lmoustache} \lmoustache
rmoustache\texttt{\\rmoustache} \rmoustache arrowvert\texttt{\\arrowvert} \arrowvert Arrowvert\texttt{\\Arrowvert} \Arrowvert
bracevert\texttt{\\bracevert} \bracevert
Miscellaneous Symbols
dots\texttt{\\dots} \dots cdots\texttt{\\cdots} \cdots vdots\texttt{\\vdots} \vdots
ddots\texttt{\\ddots} \ddots hbar\texttt{\\hbar} \hbar imath\texttt{\\imath} ı\imath
jmath\texttt{\\jmath} ȷ\jmath ell\texttt{\\ell} \ell Re\texttt{\\Re} \Re
Im\texttt{\\Im} \Im aleph\texttt{\\aleph} \aleph wp\texttt{\\wp} \wp
forall\texttt{\\forall} \forall exists\texttt{\\exists} \exists mho\texttt{\\mho} \mho
partial\texttt{\\partial} \partial prime\texttt{\\prime} \prime emptyset\texttt{\\emptyset} \emptyset
infty\texttt{\\infty} \infty nabla\texttt{\\nabla} \nabla triangle\texttt{\\triangle} \triangle
Box\texttt{\\Box} \Box Diamond\texttt{\\Diamond} \Diamond bot\texttt{\\bot} \bot
top\texttt{\\top} \top angle\texttt{\\angle} \angle surd\texttt{\\surd} \surd
diamondsuit\texttt{\\diamondsuit} \diamondsuit heartsuit\texttt{\\heartsuit} \heartsuit clubsuit\texttt{\\clubsuit} \clubsuit
spadesuit\texttt{\\spadesuit} \spadesuit neg\texttt{\\neg} or lnot\texttt{\\lnot} ¬\neg flat\texttt{\\flat} \flat
natural\texttt{\\natural} \natural sharp\texttt{\\sharp} \sharp
Non-Mathematical Symbols
dag\texttt{\\dag} \dag ddag\texttt{\\ddag} \ddag S\texttt{\\S} \S
copyright\texttt{\\copyright} ©\copyright P\texttt{\\P} \P pounds\texttt{\\pounds} £\pounds
AMS Delimiters
ulcorner\texttt{\\ulcorner} \ulcorner urcorner\texttt{\\urcorner} \urcorner llcorner\texttt{\\llcorner} \llcorner
lrcorner\texttt{\\lrcorner} \lrcorner
AMS 二元关系
lessdot\texttt{\\lessdot} \lessdot gtrdot\texttt{\\gtrdot} \gtrdot doteqdot\texttt{\\doteqdot} or Doteq\texttt{\\Doteq} \doteqdot
eqslant\texttt{\\eqslant} \eqslant geqslant\texttt{\\geqslant} \geqslant risingdotseq\texttt{\\risingdotseq} \risingdotseq
eqslantless\texttt{\\eqslantless} \eqslantless eqslantgtr\texttt{\\eqslantgtr} \eqslantgtr fallingdotseq\texttt{\\fallingdotseq} \fallingdotseq
leqq\texttt{\\leqq} \leqq geqq\texttt{\\geqq} \geqq eqcirc\texttt{\\eqcirc} \eqcirc
lll\texttt{\\lll} or llless\texttt{\\llless} \lll ggg\texttt{\\ggg} or gggtr\texttt{\\gggtr} \ggg circeq\texttt{\\circeq} \circeq
lesssim\texttt{\\lesssim} \lesssim gtrsim\texttt{\\gtrsim} \gtrsim triangleleq\texttt{\\triangleleq} \triangleleq
lessapprox\texttt{\\lessapprox} \lessapprox gtrapprox\texttt{\\gtrapprox} \gtrapprox bumpeq\texttt{\\bumpeq} \bumpeq
lessgtr\texttt{\\lessgtr} \lessgtr gtrless\texttt{\\gtrless} \gtrless Bumpeq\texttt{\\Bumpeq} \Bumpeq
lesseqgtr\texttt{\\lesseqgtr} \lesseqgtr gtreqless\texttt{\\gtreqless} \gtreqless thicksim\texttt{\\thicksim} \thicksim
lesseqqgtr\texttt{\\lesseqqgtr} \lesseqqgtr gtreqqless\texttt{\\gtreqqless} \gtreqqless thickapprox\texttt{\\thickapprox} \thickapprox
preccurlyeq\texttt{\\preccurlyeq} \preccurlyeq succcurlyeq\texttt{\\succcurlyeq} \succcurlyeq approxeq\texttt{\\approxeq} \approxeq
curlyeqprec\texttt{\\curlyeqprec} \curlyeqprec curlyeqsucc\texttt{\\curlyeqsucc} \curlyeqsucc backsim\texttt{\\backsim} \backsim
precsim\texttt{\\precsim} \precsim succsim\texttt{\\succsim} \succsim backsimeq\texttt{\\backsimeq} \backsimeq
precapprox\texttt{\\precapprox} \precapprox succapprox\texttt{\\succapprox} \succapprox vDash\texttt{\\vDash} \vDash
subseteqq\texttt{\\subseteqq} \subseteqq supseteqq\texttt{\\supseteqq} \supseteqq Vdash\texttt{\\Vdash} \Vdash
Subset\texttt{\\Subset} \Subset Supset\texttt{\\Supset} \Supset Vvdash\texttt{\\Vvdash} \Vvdash
sqsubset\texttt{\\sqsubset} \sqsubset sqsupset\texttt{\\sqsupset} \sqsupset backepsilon\texttt{\\backepsilon} \backepsilon
therefore\texttt{\\therefore} \therefore because\texttt{\\because} \because varpropto\texttt{\\varpropto} \varpropto
shortmid\texttt{\\shortmid} \shortmid shortparallel\texttt{\\shortparallel} \shortparallel between\texttt{\\between} \between
smallsmile\texttt{\\smallsmile} \smallsmile smallfrown\texttt{\\smallfrown} \smallfrown pitchfork\texttt{\\pitchfork} \pitchfork
vartriangleleft\texttt{\\vartriangleleft} \vartriangleleft vartriangleright\texttt{\\vartriangleright} \vartriangleright blacktriangleleft\texttt{\\blacktriangleleft} \blacktriangleleft
trianglelefteq\texttt{\\trianglelefteq} \trianglelefteq trianglerighteq\texttt{\\trianglerighteq} \trianglerighteq blacktriangleright\texttt{\\blacktriangleright} \blacktriangleright
AMS 箭头
dashleftarrow\texttt{\\dashleftarrow} \dashleftarrow dashrightarrow\texttt{\\dashrightarrow} \dashrightarrow multimap\texttt{\\multimap} \multimap
leftleftarrows\texttt{\\leftleftarrows} \leftleftarrows rightrightarrows\texttt{\\rightrightarrows} \rightrightarrows uparrows\texttt{\\uparrows} \uparrows
leftrightarrows\texttt{\\leftrightarrows} \leftrightarrows rightleftarrows\texttt{\\rightleftarrows} \rightleftarrows downdownarrows\texttt{\\downdownarrows} \downdownarrows
Lleftarrow\texttt{\\Lleftarrow} \Lleftarrow Rrightarrow\texttt{\\Rrightarrow} \Rrightarrow upharpoonleft\texttt{\\upharpoonleft} \upharpoonleft
twoheadleftarrow\texttt{\\twoheadleftarrow} \twoheadleftarrow twoheadrightarrow\texttt{\\twoheadrightarrow} \twoheadrightarrow upharpoonright\texttt{\\upharpoonright} \upharpoonright
leftarrowtail\texttt{\\leftarrowtail} \leftarrowtail rightarrowtail\texttt{\\rightarrowtail} \rightarrowtail downharpoonleft\texttt{\\downharpoonleft} \downharpoonleft
leftrightharpoons\texttt{\\leftrightharpoons} \leftrightharpoons rightleftharpoons\texttt{\\rightleftharpoons} \rightleftharpoons downharpoonright\texttt{\\downharpoonright} \downharpoonright
Lsh\texttt{\\Lsh} \Lsh Rsh\texttt{\\Rsh} \Rsh rightsquigarrow\texttt{\\rightsquigarrow} \rightsquigarrow
looparrowleft\texttt{\\looparrowleft} \looparrowleft looparrowright\texttt{\\looparrowright} \looparrowright leftrightsquigarrow\texttt{\\leftrightsquigarrow} \leftrightsquigarrow
curvearrowleft\texttt{\\curvearrowleft} \curvearrowleft curvearrowright\texttt{\\curvearrowright} \curvearrowright
circlearrowleft\texttt{\\circlearrowleft} \circlearrowleft circlearrowright\texttt{\\circlearrowright} \circlearrowright
AMS Negated Binary Relations and Arrows
nless\texttt{\\nless} \nless ngtr\texttt{\\ngtr} \ngtr varsubsetneqq\texttt{\\varsubsetneqq} \varsubsetneqq
nleq\texttt{\\nleq} \nleq ngeq\texttt{\\ngeq} \ngeq varsupsetneqq\texttt{\\varsupsetneqq} \varsupsetneqq
nleqq\texttt{\\nleqq} \nleqq ngeqq\texttt{\\ngeqq} \ngeqq nsubseteqq\texttt{\\nsubseteqq} \nsubseteqq
nleqslant\texttt{\\nleqslant} \nleqslant ngeqslant\texttt{\\ngeqslant} \ngeqslant nsupseteqq\texttt{\\nsupseteqq} \nsupseteqq
nleqq\texttt{\\nleqq} \nleqq ngeqq\texttt{\\ngeqq} \ngeqq nmid\texttt{\\nmid} \nmid
nleqq\texttt{\\nleqq} \nleqq ngeqq\texttt{\\ngeqq} \ngeqq nparallel\texttt{\\nparallel} \nparallel
nsim\texttt{\\nsim} \nsim gnsim\texttt{\\gnsim} \gnsim nshortmid\texttt{\\nshortmid} \nshortmid
napprox\texttt{\\napprox} \napprox gnapprox\texttt{\\gnapprox} \gnapprox nshortparallel\texttt{\\nshortparallel} \nshortparallel
nprec\texttt{\\nprec} \nprec nsucc\texttt{\\nsucc} \nsucc ncong\texttt{\\ncong} \ncong
npreceq\texttt{\\npreceq} \npreceq nsucceq\texttt{\\nsucceq} \nsucceq nvdash\texttt{\\nvdash} \nvdash
nprecneqq\texttt{\\nprecneqq} \nprecneqq nsuccneqq\texttt{\\nsuccneqq} \nsuccneqq nvDash\texttt{\\nvDash} \nvDash
precsim\texttt{\\precsim} \precsim succnsim\texttt{\\succnsim} \succnsim nVDash\texttt{\\nVDash} \nVDash
precnapprox\texttt{\\precnapprox} \precnapprox succnapprox\texttt{\\succnapprox} \succnapprox ntriangleleft\texttt{\\ntriangleleft} \ntriangleleft
subsetneq\texttt{\\subsetneq} \subsetneq supsetneq\texttt{\\supsetneq} \supsetneq ntriangleright\texttt{\\ntriangleright} \ntriangleright
varsubsetneq\texttt{\\varsubsetneq} \varsubsetneq varsupsetneq\texttt{\\varsupsetneq} \varsupsetneq ntrianglelefteq\texttt{\\ntrianglelefteq} \ntrianglelefteq
nsubseteqq\texttt{\\nsubseteqq} \nsubseteqq nsupseteqq\texttt{\\nsupseteqq} \nsupseteqq ntrianglerighteq\texttt{\\ntrianglerighteq} \ntrianglerighteq
nleftarrow\texttt{\\nleftarrow} \nleftarrow nrightarrow\texttt{\\nrightarrow} \nrightarrow nleftrightarrow\texttt{\\nleftrightarrow} \nleftrightarrow
nLeftarrow\texttt{\\nLeftarrow} \nLeftarrow nRightarrow\texttt{\\nRightarrow} \nRightarrow nLeftrightarrow\texttt{\\nLeftrightarrow} \nLeftrightarrow
AMS Binary Operators
dotplus\texttt{\\dotplus} \dotplus centerdot\texttt{\\centerdot} \centerdot intercal\texttt{\\intercal} \intercal
ltimes\texttt{\\ltimes} \ltimes rtimes\texttt{\\rtimes} \rtimes divideontimes\texttt{\\divideontimes} \divideontimes
Cup\texttt{\\Cup} or doublecup\texttt{\\doublecup} \Cup Cap\texttt{\\Cap} or doublecap\texttt{\\doublecap} \Cap smallsetminus\texttt{\\smallsetminus} \smallsetminus
veebar\texttt{\\veebar} \veebar barwedge\texttt{\\barwedge} \barwedge doublebarwedge\texttt{\\doublebarwedge} \doublebarwedge
boxplus\texttt{\\boxplus} \boxplus boxminus\texttt{\\boxminus} \boxminus circleddash\texttt{\\circleddash} \circleddash
boxtimes\texttt{\\boxtimes} \boxtimes boxdot\texttt{\\boxdot} \boxdot circledcirc\texttt{\\circledcirc} \circledcirc
leftthreetimes\texttt{\\leftthreetimes} \leftthreetimes rightthreetimes\texttt{\\rightthreetimes} \rightthreetimes circledast\texttt{\\circledast} \circledast
curlyvee\texttt{\\curlyvee} \curlyvee curlywedge\texttt{\\curlywedge} \curlywedge
AMS Miscellaneous
hbar\texttt{\\hbar} \hbar hslash\texttt{\\hslash} \hslash Bbbk\texttt{\\Bbbk} k\Bbbk
square\texttt{\\square} \square blacksquare\texttt{\\blacksquare} \blacksquare circledS\texttt{\\circledS} \circledS
vartriangle\texttt{\\vartriangle} \vartriangle blacktriangle\texttt{\\blacktriangle} \blacktriangle complement\texttt{\\complement} \complement
triangledown\texttt{\\triangledown} \triangledown blacktriangledown\texttt{\\blacktriangledown} \blacktriangledown Game\texttt{\\Game} \Game
lozenge\texttt{\\lozenge} \lozenge blacklozenge\texttt{\\blacklozenge} \blacklozenge bigstar\texttt{\\bigstar} \bigstar
angle\texttt{\\angle} \angle measuredangle\texttt{\\measuredangle} \measuredangle sphericalangle\texttt{\\sphericalangle} \sphericalangle
diagup\texttt{\\diagup} \diagup diagdown\texttt{\\diagdown} \diagdown backprime\texttt{\\backprime} \backprime
nexists\texttt{\\nexists} \nexists Finv\texttt{\\Finv} \Finv varnothing\texttt{\\varnothing} \varnothing
eth\texttt{\\eth} ð\eth mho\texttt{\\mho} \mho

附录 B- LaTeX\LaTeX 的单位和长度

缩写 定义
pt 一个点,是默认的长度单位。大约为0.3515毫米
mm 一毫米
cm 一厘米
in 一英寸
ex 当前字体中 x 的高度
em 当前字体中 m 的宽度
\columnsep 列之间的距离
\columnwidth 列宽
\linewidth 当前环境中的线宽
\paperwidth 页面宽度
\paperheight 页面高度
\textwidth 文本宽度
\textheight 文本高度
\unitlength 图片环境中的长度单位。
\baselineskip 段落中行与行之间的垂直距离

附录 C-选项

链接样式选项

选项 默认值 描述
hyperindex 将索引条目的页码设置为超链接
linktocpage false 在目录中,将链接设置为页码而不是文本。
breaklinks false 允许链接被拆分为多行。
colorlinks false 为链接和锚点着色,这些颜色将在打印版本中显示
linkcolor 红色 普通内部链接的颜色
anchorcolor 黑色 锚点(目标)文本的颜色
citecolor 绿色 参考文献的颜色
filecolor 青色 链接打开本地文件时的颜色
urlcolor 品红色 链接 URL 的颜色
frenchlinks false 使用小写字母代替颜色来表示链接

PDF 特定选项

选项 默认值 描述
bookmarks Acrobat 书签的创建方式与目录类似。
bookmarksopen 错误 书签显示时,所有子树都已展开。
citebordercolor 0 1 0 引用周围方框的颜色,以 RGB 格式表示。
filebordercolor 0 .5 .5 链接文件周围框的颜色,以 RGB 格式表示。
linkbordercolor 1 0 0 普通链接周围框的颜色,以 RGB 格式表示。
menubordercolor 1 0 0 菜单链接周围框的颜色,以 RGB 格式表示。
urlbordercolor 0 1 1 链接周围框的颜色,以 RGB 格式表示。
pdfpagemode 确定文件如何打开。选项包括 UseThumbs(缩略图)、UseOutlines(书签)和 FullScreen。
pdftitle 设置文档标题。
pdfauthor 设置文档作者。
pdfstartpage 1 确定 PDF 文件在哪个页面上打开。

参考文献

未完,待有空时继续整理