当前位置:网站首页>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⎭⎬⎫
边栏推荐
- Rhai - rust's embedded scripting engine
- Rust controls Dajiang programmable UAV Tello
- [PHP] self developed framework qphp, used by qphp framework
- Implementation of OSD on Hisilicon platform (1)
- conv2d详解--在数组和图像中的使用
- Can SQL execution be written in tidb dashboard
- Query points in MATLAB Delaunay triangulation
- Random ball size, random motion collision
- MySQL index test
- Kubernetes ---- pod configuration container start command
猜你喜欢

2022-2028 global single travel industry research and trend analysis report

6-1 exploit -ftp exploit
![[untitled]](/img/96/7f26614bbdcce71006e38ee34ab216.jpg)
[untitled]

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

20220215 CTF misc buuctf Xiaoming's safe binwalk analysis DD command separate rar file archpr brute force password cracking

BeanUtils. Copyproperties() vs. mapstruct

conv2d详解--在数组和图像中的使用

76 page comprehensive solution 2022 for smart Logistics Park (download attached)

The programmer's girlfriend gave me a fatigue driving test

女朋友说:你要搞懂了MySQL三大日志,我就让你嘿嘿嘿!
随机推荐
Ditto set global paste only text shortcuts
女朋友说:你要搞懂了MySQL三大日志,我就让你嘿嘿嘿!
Repetition is the mother of skill
网上开华泰证券的股票账户是否安全呢?
Excuse me, does Flink support synchronizing data to sqlserver
How does the VR cloud exhibition hall bring vitality to offline entities? What are the functions?
[untitled]
Sm2246en+ SanDisk 15131
What does it mean to open an account online? Is it safe to open an account online?
20220215 CTF misc buuctf Xiaoming's safe binwalk analysis DD command separate rar file archpr brute force password cracking
Lombok
A detailed explanation of the implementation principle of go Distributed Link Tracking
What SQL statements are supported for data filtering
Is it safe to choose mobile phone for stock trading account opening in Guangzhou?
Redis - understand the master-slave replication mechanism
2022-2028 global carbon fiber room scraper system industry research and trend analysis report
How to use robots Txt and its detailed explanation
2022-2028 global herbal diet tea industry research and trend analysis report
C WinForm program interface optimization example
Manage edge browser settings (ie mode, homepage binding, etc.) through group policy in the enterprise