在Markdown中输入数学公式

写在前面

最近想要把一些数学编程方面的笔记记录成电子笔记,因为修改、插入新内容等比较方便。这里记一下在Markdown中输入数学公式的方法。

基础知识

公式与文本的区别

  1. 公式输入和文本输入属于不同的模式,公式中无法通过空格来控制空白,通过特殊的符号来调整空白
  2. 公式不允许空行
  3. 公式中的字母全部会被解释为变量,输入普通文字需要特殊方法

插入行内公式

$a+b$
复制代码

这是一个行内公式: a+b

插入单行公式

$$a+b$$
复制代码

这是一个单行公式:

a+b

拔、撇、尖、向量箭头 (Accents)

a', f'(x)a', f'(x)
\overline{A}, \overline{AB}\overline{A}, \overline{AB}
\hat{\theta}\hat{\theta}
\overrightarrow{AB}\overrightarrow{AB}

括号、绝对值、取整 (Delimiters)

(a)(a)[a][a]\{a\}\{a\}
\lvert a\rvert|a| or \lvert a\rvert\lfloor a\rfloor\floor a\rfloor\lceil a\rceil\lceil a\rceil

行列式、矩阵、线性方程组 (Environments)

\begin{vmatrix}a&b\\c&d\end{vmatrix}\begin{vmatrix}a&b\\c&d\end{vmatrix}
\begin{bmatrix}a&b\\c&d\end{bmatrix}\begin{bmatrix}a&b\\c&d\end{bmatrix}

方程组对齐: 以&为标准线

\begin{alignedat}{3}  10x&        &    +3&z&-4&= 2\\    3x&+13y&+100&z&   &=4 \end{alignedat}
$$\begin{alignedat}{3}
	10x&     &  +3&z&-4&=2\\
	 3x& +13y&+100&z&  &=4\end{alignedat}$$
复制代码

HTML

字母、字体 (Letters and Unicode)

希腊字母

var前缀代表字母变体写法

\Alpha\Alpha\Beta\Beta\Gamma\Gamma\Phi\Phi\varPhi\varPhi
\alpha\alpha\beta\beta\gamma\gamma\phi\phi\varphi\varphi

数集

\N\N 自然数
\R\R 实数
\Z^{+}\Z^{+} 正整数

\TeX

特殊字体

更多详细用法见: 参考资料2-Formatting mathematics symbols

\KaTeX命令例子用法
\mathrm{...}\mathrm{ABC\ abc\ 123}f(x)\mathrm{\textcolor{red}{d}}x
\mathit{...}\mathit{ABC\ abc\ 123}比普通格式排版稍好一点
\mathbf{...}\mathbf{ABC\ abc\ 123}向量加粗
\mathbb{...}\mathbb{ABC\ k}特殊数集

加粗还可以使用\boldsymbol{...}

布局 (Layout)

删除线、方框、横向大括号 (Annotation)

\sout{abc}\sout{abc}1=\not21=\not2
\underbrace{x_1+\dots+x_n=0}_{\text{共n个}}$\underbrace{x_1+\dots+x_n=0}_{\text{共n个}}\boxed{x}+1=0\boxed{x}+1=0

上标、下标、空格 (Vertical Layout & Spacing)

\limits可以改变求和限、极限变量式的位置 \substack{...}中可以利用\\来实现二元极限: 二元极限例子(\KaTeX不支持)

逻辑运算符、集合运算符 (Logic and Set Teory)

\forall\forall\exist\exist\neg\neg
\cup\cup\cap\cap
\subset\subset or \sub\supset\supset or \sup\in\in
\to\to\gets\gets\leftrightarrow\leftrightarrow
\implies\implies\impliedby\impliedby\iff\iff

宏 (Macros)

运算符 (Operators)

可以直接从键盘输入的符号

+ - = ! / ( ) [ ] < > | ' : *

+ - = ! / ( ) [ ] < > | ' : *
复制代码

求和、求积、积分

\sum_{i=1}^{n}x_i\sum_{i=1}^{n}x_i\prod\prod
\sum\limits_{i=1}^{n}x_i\sum\limits_{i=1}^{n}x_i
\int_{a}^{+\infty}f(x)\mathrm{d}x\int_{a}^{+\infty}f(x)\mathrm{d}x\oiint\oiint

模、正负号、叉乘

分数 (Fractions and Binomials)

二项式(Binomials)用法见: 参考资料1-Fractions and Binomials

\frac{a}{1 + \frac{1}{b}}\frac{a}{1 + \frac{1}{b}}\dfrac{a}{1 + \frac{1}{b}}\dfrac{a}{1 + \frac{1}{b}}
\cfrac{a}{1 + \cfrac{1}{b}}\cfrac{a}{1 + \cfrac{1}{b}}\dfrac{a}{1 + \dfrac{1}{b}}\dfrac{a}{1 + \dfrac{1}{b}}

\cfrac似乎和\dfrac没什么区别

三角函数、极限号、最大最小 (Math Operators)

\sin\sin\sh\sh
\log_{a}^{x}\log_{a}^{x}\ln(ax+b)\ln(ax+b)
\lim\limits_{x\to \infty,\ y\to\infty}(ax+b)\lim\limits_{x\to \infty}(ax+b)\lim_{x\to \infty}(ax+b)\lim_{x\to \infty}(ax+b)

根号 (\sqrt)

\sqrt{x}\sqrt{x} \sqrt[3]{ax+b}\sqrt[3]{ax+b}

关系符号 (Relations)

样式、颜色、字号(Style, Color, Size, and Font)

颜色

\color{blue}F=ma\color{blue}F=ma \textcolor{blue}{F}=ma\textcolor{blue}{F}=ma \textcolor{#228B22}{F=ma}\textcolor{#228B22}{F=ma} \colorbox{aqua}{A}\colorbox{aqua}{A} \fcolorbox{red}{aqua}{A}\fcolorbox{red}{aqua}{A}

字号

\Huge AB\Huge AB\normalsize AB\normalsize AB
\huge AB\huge AB\small AB\small AB
\LARGE AB\LARGE AB\footnotesize AB\footnotesize AB
\Large AB\Large AB\scriptsize AB\scriptsize AB
\large AB\large AB\tiny AB\tiny AB

样式

\displaystyle\sum_{i=1}^n\displaystyle\sum_{i=1}^n
\textstyle\sum_{i=1}^n\textstyle\sum_{i=1}^n

其他符号和标点 (Symbols and Punctuation)

\dots\dots\cdots\cdots\ddots\ddots\vdots\vdots
\square\square\blacksquare\blacksquare\blacktriangleright\blacktriangleright
\checkmark\checkmark\infty\infty\degree\degree

参考资料

  1. \KaTeX Supported Functions (字典)
  2. \LaTeX Mathematics Wiki (用法)

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/387968.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

如何不部署Keras / TensorFlow模型

While the most articles about deep learning are focusing at the modeling part, there are also few about how to deploy such models to production. Some of them say “production”, but they often simply use the un-optimized model and embed it into a Flask web…

[BZOJ3626] [LNOI2014] LCA 离线 树链剖分

题面 考虑到询问的\(l..r,z\)具有可减性&#xff0c;考虑把询问差分掉&#xff0c;拆成\(r,z\)和\(l-1,z\)。 显然这些LCA一定在\(z\)到根的路径上。下面的问题就是怎么统计。 考虑不是那么暴力的暴力。 我们似乎可以把\(1..r\)的所有点先瞎搞一下&#xff0c;求出一个点内部有…

Linux查看系统各类信息

说明&#xff1a;Linux下可以在/proc/cpuinfo中看到每个cpu的详细信息。但是对于双核的cpu&#xff0c;在cpuinfo中会看到两个cpu。常常会让人误以为是两个单核的cpu。其实应该通过Physical Processor ID来区分单核和双核。而Physical Processor ID可以从cpuinfo或者dmesg中找到…

biopython中文指南_Biopython新手指南-第1部分

biopython中文指南When you hear the word Biopython what is the first thing that came to your mind? A python library to handle biological data…? You are correct! Biopython provides a set of tools to perform bioinformatics computations on biological data s…

整合后台服务和驱动代码注入

整合后台服务和驱动代码注入 Home键的驱动代码&#xff1a; /dev/input/event1: 0001 0066 00000001 /dev/input/event1: 0000 0000 00000000 /dev/input/event1: 0001 0066 00000000 /dev/input/event1: 0000 0000 00000000 对应输入的驱动代码&#xff1a; sendevent/dev/…

Java作业09-异常

6. 为如下代码加上异常处理 byte[] content null; FileInputStream fis new FileInputStream("testfis.txt"); int bytesAvailabe fis.available();//获得该文件可用的字节数 if(bytesAvailabe>0){content new byte[bytesAvailabe];//创建可容纳文件大小的数组…

为数据计算提供强力引擎,阿里云文件存储HDFS v1.0公测发布

2019独角兽企业重金招聘Python工程师标准>>> 在2019年3月的北京云栖峰会上&#xff0c;阿里云正式推出全球首个云原生HDFS存储服务—文件存储HDFS&#xff0c;为数据分析业务在云上提供可线性扩展的吞吐能力和免运维的快速弹性伸缩能力&#xff0c;降低用户TCO。阿里…

对食材的敬畏之心极致产品_这些数据科学产品组合将给您带来敬畏和启发(2020年中的版本)

对食材的敬畏之心极致产品重点 (Top highlight)为什么选择投资组合&#xff1f; (Why portfolios?) Data science is a tough field. It combines in equal parts mathematics and statistics, computer science, and black magic. As of mid-2020, it is also a booming fiel…

android模拟用户输入

目录(?)[-] geteventsendeventinput keyevent 本文讲的是通过使用代码&#xff0c;可以控制手机的屏幕和物理按键&#xff0c;也就是说不只是在某一个APP里去操作&#xff0c;而是整个手机系统。 getevent/sendevent getevent&sendevent 是Android系统下的一个工具&#x…

真格量化常见报错信息和Debug方法

1.打印日志 1.1 在代码中添加运行到特定部分的提示&#xff1a; 如果我们在用户日志未能看到“调用到OnQuote事件”文字&#xff0c;说明其之前的代码就出了问题&#xff0c;导致程序无法运行到OnQuote函数里的提示部分。解决方案为仔细检查该部分之前的代码是否出现问题。 1.2…

向量积判断优劣弧_判断经验论文优劣的10条诫命

向量积判断优劣弧There are a host of pathologies associated with the current peer review system that has been the subject of much discussion. One of the most substantive issues is that results reported in leading journals are commonly papers with the most e…

自定义PopView

改代码是参考一个Demo直接改的&#xff0c;代码中有一些漏洞&#xff0c;如果发现其他的问题&#xff0c;可以下方直接留言 .h文件 #import <UIKit/UIKit.h> typedef void(^PopoverBlock)(NSInteger index); interface CustomPopView : UIView //property(nonatomic,copy…

线控耳机监听

当耳机的媒体按键被单击后&#xff0c;Android系统会发出一个广播&#xff0c;该广播的携带者一个Action名为MEDIA_BUTTON的Intent。监听该广播便可以获取手机的耳机媒体按键的单击事件。 在Android中有个AudioManager类&#xff0c;该类会维护MEDIA_BUTTON广播的分发&#xf…

当编程语言掌握在企业手中,是生机还是危机?

2019年4月&#xff0c;Java的收费时代来临了&#xff01; Java是由Sun微系统公司在1995年推出的编程语言&#xff0c;2010年Oracle收购了Sun之后&#xff0c;Java的所有者也就自然变成了Oracle。2019年&#xff0c;Oracle宣布将停止Java 8更新的免费支持&#xff0c;未来Java的…

sql如何处理null值_如何正确处理SQL中的NULL值

sql如何处理null值前言 (Preface) A friend who has recently started learning SQL asked me about NULL values and how to deal with them. If you are new to SQL, this guide should give you insights into a topic that can be confusing to beginners.最近开始学习SQL的…

名言警句分享

“当你想做一件事&#xff0c;却无能为力的时候&#xff0c;是最痛苦的。”基拉大和转载于:https://www.cnblogs.com/yuxijun/p/9986489.html

文字创作类App分享-简书

今天我用Mockplus做了一套简书App的原型&#xff0c;这是一款文字创作类的App&#xff0c;用户通过写文、点赞等互动行为&#xff0c;提高自己在社区的影响力&#xff0c;打造个人品牌。我运用了Mockplus基础组件、交互组件、移动组件等多个组件库&#xff0c;简单拖拽&#xf…

数据可视化 信息可视化_动机可视化

数据可视化 信息可视化John Snow’s map of Cholera cases near London’s Broad Street.约翰斯诺(John Snow)在伦敦宽街附近的霍乱病例地图。 John Snow, “the father of epidemiology,” is famous for his cholera maps. These maps represent so many of our aspirations …

android 接听和挂断实现方式

转载▼标签&#xff1a; android 接听 挂断 it 分类&#xff1a; android应用技巧 参考&#xff1a;android 来电接听和挂断 支持目前所有版本 注意&#xff1a;android2.3版本及以上不支持下面的自动接听方法。 &#xff08;会抛异常&#xff1a;java.lang.Securi…

Eclipse External Tool Configration Notepad++

Location&#xff1a; C:\Program Files\Notepad\notepad.exe Arguments&#xff1a;  ${resource_loc} 转载于:https://www.cnblogs.com/rgqancy/p/9987610.html