当前位置:网站首页>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⎭⎬⎫
边栏推荐
- 女朋友说:你要搞懂了MySQL三大日志,我就让你嘿嘿嘿!
- To tell you the truth, ThreadLocal is really not an advanced thing
- Solving the weird problem that the query conditions affect the value of query fields in MySQL query
- [untitled]
- Yboj mesh sequence [Lagrange interpolation]
- C# /platform:anycpu32bitpreferred 只能与 /t:exe、/t:winexe 和 /t:appcontainerexe 一起使用
- Don't worry about whether you can be a coder if you don't learn English well. Learn it first
- 2022-2028 global public address fire alarm system industry research and trend analysis report
- Ybtoj exchange game [tree chain splitting, line segment tree merging]
- 1175. prime number arrangement / Sword finger offer II 104 Number of permutations
猜你喜欢

2022-2028 global electric yacht industry research and trend analysis report

The programmer's girlfriend gave me a fatigue driving test

2022-2028 global 3D printing ASA consumables industry research and trend analysis report

Ditto set global paste only text shortcuts

Why did kubernetes win? The changes in the container circle!

Redis - understand the master-slave replication mechanism

Redis - how to understand publishing and subscribing

Combining online and offline, VR panorama is a good way to transform furniture online!

Redis - sentinel mode

CentOS installation starts redis
随机推荐
Random ball size, random motion collision
The college entrance examination in 2022 is over. Does anyone really think programmers don't need to study after work?
The full technology stack, full scene and full role cloud native series training was launched to help enterprises build a hard core cloud native technology team
[designmode] singleton pattern
Can SQL execution be written in tidb dashboard
Rhai - rust's embedded scripting engine
Makefile notes (Yiwen Institute makefile)
How do it outsourcing resident personnel position their pain points?
Cesiumjs 2022 ^ source code interpretation [6] - new architecture of modelempirical
Rust book materials - yazhijia Library
Error when starting PHP: [pool www] cannot get uid for user '@php_ fpm_ [email protected]’
Development of wireless U-shaped ultrasonic electric toothbrush
Redis - how to understand publishing and subscribing
2022-06-30: what does the following golang code output? A:0; B:2; C: Running error. package main import “fmt“ func main()
2022-2028 global capsule shell industry research and trend analysis report
[NLP] [textcnn] text classification
Thoughts on the future of data analysis in "miscellaneous talk"
Mysql database query optimization
Combining online and offline, VR panorama is a good way to transform furniture online!
2022-2028 global carbon fiber room scraper system industry research and trend analysis report