当前位置:网站首页>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-06-30: what does the following golang code output? A:0; B:2; C: Running error. package main import “fmt“ func main()
- Ybtoj exchange game [tree chain splitting, line segment tree merging]
- 女朋友说:你要搞懂了MySQL三大日志,我就让你嘿嘿嘿!
- 2022-2028 global rotary transmission system industry research and trend analysis report
- leetcode 474. Ones and zeroes (medium)
- 2022-2028 global rampant travel industry research and trend analysis report
- 2022-2028 global ethylene oxide scrubber industry research and trend analysis report
- Techo youth 2022 academic year college open class: behind the live broadcast of Lianmai, explore how to apply audio and video technology
- 2022-2028 global retro glass industry research and trend analysis report
- 1. crawler's beautifulsoup parsing library & online parsing image verification code
猜你喜欢

ABAQUS 2022 software installation package and installation tutorial

2022-2028 global weight loss ginger tea industry research and trend analysis report

In depth understanding of jetpack compose kernel: slottable system

Bridge emqx cloud data to AWS IOT through the public network

2022-2028 global ultra high purity electrolytic iron sheet industry research and trend analysis report

Vmware16 installing win11 virtual machine (the most complete step + stepping on the pit)

2022-2028 global retro glass industry research and trend analysis report

2022-2028 global ICT test probe industry research and trend analysis report

When is it appropriate to replace a virtual machine with a virtual machine?

SSM integration process (integration configuration, function module development, interface test)
随机推荐
[UML] UML class diagram
20220215 CTF misc buuctf Xiaoming's safe binwalk analysis DD command separate rar file archpr brute force password cracking
How does the VR cloud exhibition hall bring vitality to offline entities? What are the functions?
A detailed explanation of the implementation principle of go Distributed Link Tracking
[designmode] factory pattern
The girlfriend said: if you want to understand the three MySQL logs, I will let you heiheihei!
Query points in MATLAB Delaunay triangulation
2022-2028 global single travel industry research and trend analysis report
Combining online and offline, VR panorama is a good way to transform furniture online!
深入理解 Jetpack Compose 内核:SlotTable 系统
What value should testers play in requirements review? Two minutes will stop you from being stupid
Rust book materials - yazhijia Library
CTF tool (1) -- archpr -- including installation / use process
206 page Shanghai BIM Technology Application and development report 2021
Mysql database query optimization
PS2 handle-1 "recommended collection"
The programmer's girlfriend gave me a fatigue driving test
Redis - understand the master-slave replication mechanism
Repetition is the mother of skill
5g smart building solution 2021