By Python高效编程
希腊字母
latex 中希腊字母要使用$$符号包围起来。
大写字母,在小写字母 latex 形式的基础之上,首字母大写。
小写字母 | 大写字母 | latex(小写) |
---|---|---|
\alpha(\Alpha) | ||
\beta | ||
\tau | ||
\gamma | ||
\delta | ||
\epsilon | ||
\nu | ||
\zeta | ||
\omicron | ||
\pi | ||
\rho | ||
\sigma | ||
\eta | ||
\theta | ||
\iota | ||
\kappa | ||
\lambda | ||
\mu | ||
\upsilon | ||
\omega | ||
\phi | ||
\chi | ||
\psi |
段落符号
\\用来表示换行
print(‘hello’) \\
print(‘ok’)
输出结果为:
~\\ 用于输出一段空行
\indent 首行缩进
\noindent 取消首行缩进
运算符
\le 或者 \leq 代表
\ge 或者 \geq 代表
\rightarrow 代表
\infty 代表
\in 代表
\text{I’m ok} 代表文本内容 : , 否则文本之间没有空格:
\subset 代表
\subseteq 代表
\supset 代表
\supseteq 代表
\times 代表
\cdot 代表 (点乘)
\sqrt 代表
分式
\frac{分子}{分母}用来表示分式:
如 \frac{1}{1 + a}:
章节
\section{title} 大括号中 title 注明一级章节的标题
\subsection{title} 二级章节
\subsubsection{title} 三级章节
公式
启用 equation 环境,就不需要 $ 符号,公式末尾会标注序号。
\begin{equation}
\eta_i = \frac{1}{L_i + d_i + D_i}
\end{equation}
示例如下:
KaTeX parse error: No such environment: equation at position 8: \begin{̲e̲q̲u̲a̲t̲i̲o̲n̲}̲ \eta_i = \frac…
带有大括号的公式块
- 带序号
\begin{equation}
|x| = \left {
\begin{array}{cc}
-x & \text{if } x < 0, \\
0 & \text{if } x = 0, \\
x & \text{if } x > 0.
\end{array} \right .
\end{equation}
输出:
$$
\begin{equation}
|x| = \left {
\begin{array}{cc}
-x & \text{if } x < 0, \\
0 & \text{if } x = 0, \\
x & \text{if } x > 0.
\end{array} \right .
\end{equation}
$$
- 不带序号
\[
|x| = \left {
\begin{array}{cc}
-x & \text{if } x < 0, \\
0 & \text{if } x = 0, \\
x, &\text{if } x > 0.
\end{array} \right .
\]
公式换行
\begin{equation}
\begin{aligned}
\nu_{\rho} = \nu_{0}(\epsilon A + \theta B + \gamma) \\
A = 1.32 - 0.82ln(\rho) \\
B = 3.0 - 0.76\rho
\end{aligned}
\end{equation}
插入表格
\begin{tabular}{|l|l|l|}
\hline
m&Number of ants \\
\hline
V&Node set \\
\hline
\end{tabular}
其中:
格式 | 说明 |
---|---|
l/c/r | 表示单元格中的内容左对齐/居中/右对齐,单元格个数不得超过列格式 l,c,r 的总数,但可以少于这个总数 |
| | 绘制竖线{|||} |
\hline | 绘制横线 |
\\ | 换行符 |
& | 表示单元格之间内容的分割 |
插入图片
\begin{figure}[htbp]
\small
\centering
\includegraphics[width=12cm]{1.png} \\
\caption{Simulation}
\end{figure}
在 tex 文件所在文件夹中新建 figures 文件夹,将待插入图片移动到 figures 文件夹中。1.png 即为待插入图片的名称。其中,\includegraphics[width = 12 cm]中[]中的参数决定了插入图片的大小。