latex 常见用法与希腊字母

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/weixin_43773093/article/details/86682957

By Python高效编程

希腊字母

latex 中希腊字母要使用$$符号包围起来。

大写字母,在小写字母 latex 形式的基础之上,首字母大写。

小写字母 大写字母 latex(小写)
α \alpha A \Alpha \alpha(\Alpha)
β \beta B \Beta \beta
τ \tau T \Tau \tau
γ \gamma Γ \Gamma \gamma
δ \delta Δ \Delta \delta
ϵ \epsilon E \Epsilon \epsilon
ν \nu N \Nu \nu
ζ \zeta Z \Zeta \zeta
ο \omicron O \Omicron \omicron
π \pi Π \Pi \pi
ρ \rho R \Rho \rho
σ \sigma Σ \Sigma \sigma
η \eta H \Eta \eta
θ \theta Θ \Theta \theta
ι \iota I \Iota \iota
κ \kappa K \Kappa \kappa
λ \lambda Λ \Lambda \lambda
μ \mu M \Mu \mu
υ \upsilon Υ \Upsilon \upsilon
ω \omega Ω \Omega \omega
ϕ \phi Φ \Phi \phi
χ \chi X \Chi \chi
ψ \psi Ψ \Psi \psi

段落符号

\\用来表示换行

print(‘hello’) \\
print(‘ok’)

输出结果为:
p r i n t ( h e l l o ) p r i n t ( o k ) print('hello') \\ print('ok')

~\\ 用于输出一段空行

\indent 首行缩进

\noindent 取消首行缩进

运算符

\le 或者 \leq 代表 \leq

\ge 或者 \geq 代表 \geq

\rightarrow 代表 \rightarrow

\infty 代表 \infty

\in 代表 \in

\text{I’m ok} 代表文本内容 : I’m ok \text{I'm ok} , 否则文本之间没有空格: I m o k I'm ok

\subset 代表 \subset

\subseteq 代表 \subseteq​

\supset 代表 \supset​

\supseteq 代表 \supseteq

\times 代表 × \times

\cdot 代表 \cdot​ (点乘)

\sqrt 代表 5 \sqrt{5}

分式

\frac{分子}{分母}用来表示分式:

如 \frac{1}{1 + a}: 1 1 + a \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}
Python高效编程
其中:

格式 说明
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]中[]中的参数决定了插入图片的大小。

猜你喜欢

转载自blog.csdn.net/weixin_43773093/article/details/86682957