当前位置:网站首页>CSDN常用复杂公式模板记录
CSDN常用复杂公式模板记录
2022-07-01 00:32:00 【subtitle_】
引言
平常写CSDN博客用到MarkDown,时候有时候会敲很长的公式,公式是支持LaTex输入的,公式的显示挺美观。但有时候可能会忘记具体的公式模板。为了方便以后的书写,做一下记录,不记得可以回来直接copy。
1.公式居中
为了公式好看,一般前后使用两个$,作为行间公式,这样公式是居中的。而如果前后使用一个$是行内公式。
行间公式
$$x=y+1$$
显示效果为居中对齐的:
x = y + 1 x=y+1 x=y+1
行内公式
$x=y+1$
显示效果为左对齐的:
x = y + 1 x=y+1 x=y+1
对比之下,行间公式显示还是比较优雅的哈~推荐使用两个$
!
2.矩阵的表示
矩阵应该是非常常见的一种公式了,使用时有以下几点注意:
<1>前后使用环境
\begin{bmatrix}
\end{bmatrix}
<2>在每一行第二-最后一个矩阵元素前使用&对齐
<3>在每一行最后一个矩阵元素后面使用\\换行,当然矩阵最后一行不需要
例如下面的例子,可以把下面的代码直接复制然后修改你的公式~
$$\begin{
bmatrix}
a & b & c \\
d & ee &f \\
gx & h & i1
\end{
bmatrix}$$
显示效果为:
[ a b c d e e f g x h i 1 ] \begin{bmatrix}a&b&c \\ d & ee &f \\ gx &h &i1\end{bmatrix} ⎣⎡adgxbeehcfi1⎦⎤
3.公式等号的左对齐
有时候公式推导有连续等号,这时候如果把等式都写在一行会特别的长,可以考虑分行书写公式,使用时有以下几点注意:
<1>前后使用环境
\begin{aligned}
\end{aligned}
<2>在等式每一行等号前面使用&对齐
<3>在等式每一行最后使用\\换行,当然等式最后一行不需要
例如下面的例子,可以把下面的代码直接复制然后修改你的公式~
$$\begin{
aligned}
a&=b+1\\
&=c+2\\
&=dx-e
\end{
aligned}$$
显示效果为:
a = b + 1 = c + 2 = d x − e \begin{aligned} a&=b+1\\ &=c+2\\ &=dx-e \end{aligned} a=b+1=c+2=dx−e
【注意不同的MarkDown可能环境不同,比如我用VScode写Markdown公式等号的左对齐用到的环境是\begin{align*}
和\end{align*}
。】
4.大括号组合多个公式
有时候公式是由好几个条件组成求解的,这时候需要在前面用大括号组合多个公式,使用时有以下几点注意:
<1>大括号的写法(注意是
\{
和.
的组合)
左大括号写法:\left\}
\right.
右大括号写法:\left.
\right\}
<2>在公式每一行第一个符号前使用&对齐等号
<3>在公式每一行最后使用\\换行,当然等式最后一行不需要
例如下面的例子,可以把下面的代码直接复制然后修改你的公式~
左大括号:
$$\left\{
\begin{
array}{
l}
&a=b+1 \\
&a=c+2 \\
&ad=dx-e
\end{
array}\right.$$
显示效果为:
{ a = b + 1 a = c + 2 a d = d x − e \left\{\begin{array}{l} &a=b+1 \\ &a=c+2 \\ &ad=dx-e \end{array}\right. ⎩⎨⎧a=b+1a=c+2ad=dx−e
右大括号:
$$\left.\begin{
array}{
l}
&a=b+1 \\
&a=c+2 \\
&ad=dx-e
\end{
array}\right\}$$
显示效果为:
a = b + 1 a = c + 2 a d = d x − e } \left.\begin{array}{l} &a=b+1 \\ &a=c+2 \\ &ad=dx-e \end{array}\right\} a=b+1a=c+2ad=dx−e⎭⎬⎫
边栏推荐
- 2022-2028 global public address fire alarm system industry research and trend analysis report
- Dataloader source code_ DataLoader
- C /platform:anycpu32bitpererrored can only be used with /t:exe, /t:winexe and /t:appcontainerexe
- 1175. prime number arrangement / Sword finger offer II 104 Number of permutations
- File reading and writing for rust file system processing - rust Practice Guide
- [designmode] singleton pattern
- Fh6908a negative pole turn off synchronous rectification analog low voltage drop diode control IC chip tsot23-6 ultra low power rectifier 1W power consumption < 100ua static replacement mp6908
- Redis - understand the master-slave replication mechanism
- Query points in MATLAB Delaunay triangulation
- Tide - rust web framework based on async STD
猜你喜欢
2022-2028 global elevator emergency communication system industry research and trend analysis report
2022-2028 global 3D printing ASA consumables industry research and trend analysis report
什么是SRM系统,如何规范公司内部采购流程
[leetcode] [SQL] notes
76 page comprehensive solution 2022 for smart Logistics Park (download attached)
Teach you how to use Hal library to get started -- become a lighting master
Manage edge browser settings (ie mode, homepage binding, etc.) through group policy in the enterprise
CentOS install MySQL
CentOS installation starts redis
20220215-ctf-misc-buuctf-einstein-binwalk analyze picture-dd command separate zip file -- look for password in picture attribute
随机推荐
Fh6908a negative pole turn off synchronous rectification analog low voltage drop diode control IC chip tsot23-6 ultra low power rectifier 1W power consumption < 100ua static replacement mp6908
2022-2028 global PTFE lined valve industry research and trend analysis report
Mysql database query optimization
2022-2028 global ICT test probe industry research and trend analysis report
2022-06-30:以下golang代码输出什么?A:0;B:2;C:运行错误。 package main import “fmt“ func main()
In depth understanding of jetpack compose kernel: slottable system
Understand target detection in one article: r-cnn, fast r-cnn, fast r-cnn, Yolo, SSD "suggestions collection"
On the application of cluster analysis in work
conv2d详解--在数组和图像中的使用
The college entrance examination in 2022 is over. Does anyone really think programmers don't need to study after work?
2022-06-30: what does the following golang code output? A:0; B:2; C: Running error. package main import “fmt“ func main()
如何关闭一个开放的DNS解析器
Lombok
Warmup preheating learning rate "suggestions collection"
[leetcode] [SQL] notes
Tide - rust web framework based on async STD
1175. prime number arrangement / Sword finger offer II 104 Number of permutations
leetcode 474. Ones and Zeroes 一和零(中等)
Error when starting PHP: [pool www] cannot get uid for user '@php_ fpm_ [email protected]’
Redis - understand the master-slave replication mechanism