赞
踩
文末3.9节有![]()
Typora 是什么
Typora 是一款支持实时预览的 Markdown 文本编辑器。它有 OS X、Windows、Linux 三个平台的版本,并且完全免费。它功能强大,且非常轻量级,使用体验同txt无异。想要下载的同学请移步官网:
a markdown editor, markdown reader.www.typora.io另外知乎也支持Markdown,下面讲的内容都可以用作知乎文章和回答。
Typora默认无法在行内插入公式,只能单独一行,以及没有高亮。所以我们修改下设置,将这两个功能开启。
文件->偏好->Markdown, 勾选“内联公式”和“高亮”。然后重启Typora,我们就可以在Typora中使用这两个功能了。
1. 一些基本操作
1.1 标题
- # 这是一级标题
- ## 这是二级标题
- #### 这是四级标题
1.2 加粗
**你要加粗的内容**
1.3 斜体
*你要斜体的内容*
1.4 下划线
<u>你要下划线的内容</u>
1.5 删除线
~你要删除线的内容~
1.6 分割线
***或---
1.7 无序列表
- - 第一条内容
- - 第二条内容
效果如下:
1.8 有序列表
- 1. 第一条内容
- 2. 第二挑内容
效果如下:
1.9 任务列表
- - [ ] 任务1
- - [ ] 任务2
- - [ ] 任务3
效果如下:
1.10 URL链接
<www.baidu.com>
效果如下:
www.baidu.com
1.11 图片
通过拖拉的方法,将本地文件夹中的图片或网络图片插入。
效果如下:(还可以插入动图哦!)
1.12 表格
- |姓名|性别|年龄|
- |:-:|:-:|:-:|
- |小明|男|21|
- |小红|女|18|
效果如下:
其中 :- 表示左对齐, -: 表示右对齐, :-:表示居中对齐。
1.13 注释
这个功能比较少用。我们可以对某一个词进行注释。
- Trump is the [^president] of American.
- [^president]: The president is a leader of an country.
1.14 目录列表
[toc]
效果如下:
1.15 表情
- :happy:
- :cry:
- :1st_place_medal:
- :2nd_place_medal:
- :3rd_place_medal:
- :girl:
- :family_man_girl:
- :family_man_girl_boy:
- :family_man_man_girl_boy:
效果如下:
1.16 标题自动添加标号
文件->偏好设置->外观->打开主题文件夹,在打开的文件夹下新建文件名为“base.user.css”的文件,把下面内容复制到这个文件里。重启Typora。
- /** initialize css counter */
- #write {
- counter-reset: h1
- }
- h1 {
- counter-reset: h2
- }
- h2 {
- counter-reset: h3
- }
- h3 {
- counter-reset: h4
- }
- h4 {
- counter-reset: h5
- }
- h5 {
- counter-reset: h6
- }
- /** put counter result into headings */
- #write h1:before {
- counter-increment: h1;
- content: counter(h1) " "
- }#write h2:before {
- counter-increment: h2;
- content: counter(h1) "." counter(h2) " "
- }
- #write h3:before,
- h3.md-focus.md-heading:before /** override the default style for focused headings */ {
- counter-increment: h3;
- content: counter(h1) "." counter(h2) "." counter(h3) " "
- }
- #write h4:before,
- h4.md-focus.md-heading:before {
- counter-increment: h4;
- content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) " "
- }
- #write h5:before,
- h5.md-focus.md-heading:before {
- counter-increment: h5;
- content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) " "
- }
- #write h6:before,
- h6.md-focus.md-heading:before {
- counter-increment: h6;
- content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) "." counter(h6) " "
- }
- /** override the default style for focused headings */
- #write>h3.md-focus:before,
- #write>h4.md-focus:before,
- #write>h5.md-focus:before,
- #write>h6.md-focus:before,
- h3.md-focus:before,
- h4.md-focus:before,
- h5.md-focus:before,
- h6.md-focus:before {
- color: inherit;
- border: inherit;
- border-radius: inherit;
- position: inherit;
- left:initial;
- float: none;
- top:initial;
- font-size: inherit;
- padding-left: inherit;
- padding-right: inherit;
- vertical-align: inherit;
- font-weight: inherit;
- line-height: inherit;
- }

效果如下:
2.1 代码块
输入```,然后回车
2.2 行内插入代码
一行的左边`你要插入的代码`一行的右边
效果如下:
一行的左边你要插入的代码
一行的右边
2.3 引用块
>你要引用的内容
效果如下:
你要引用的内容
2.4 公式块
数学公式以$
开头和结尾,如果要独占一行的话,以$$
开头和结尾。
- $$
- Y=Ax+b
- $$
效果如下:
我在行左 $Y=Ax+b$ 我在行右
效果如下:
我在行左
3.1 常用符号
3.2 集合符号
3.3 希腊符号
空心字母与Fraktur字母与花体字
3.4 向量加粗
使用mathbf
修饰需要加粗字符(bf就是单纯加粗),如下所示输入:
- $$
- mathbf Lambda=Lambda_1+Lambda_2+cdots+Lambda_n
- $$
效果如下:
其中 :
Lambda ->![]()
mathbfLambda ->![]()
cdots ->![]()
同理:
- $$
- mathbf Lambda=Lambda_1 times Lambda_2 times cdots times Lambda_n
- $$
效果如下:
其中 times表示乘号,在3.1节有讲。
3.5 大括号
用left
和right
作为前缀,来修饰(),[]和{}
。
f(x) = x^2 + left (y^2 + frac{b}{a}right )
3.6 多行公式
当公式超过一行时,用begin
和 end
把公式包围起来,每行以结尾,每个元素
&
分隔。
- $$
- begin{align}
- f(x) = a + b
- = c + d
- end{align}
- $$
3.7 多值函数
使用case
块表达式,每行结尾,每个元素&分隔。
- $$
- p(x) =
- begin{cases}
- p, & x = 1
- 1 - p, & x = 0
- end{cases}
- $$
3.8 矩阵
使用begin{matrix}
开头及end{matrix}
结尾,每行结尾,每个元素
&
分隔。
- $$
- begin{matrix}
- 1 & 0 & 0
- 0 & 1 & 0
- 0 & 0 & 1
- end{matrix}
- $$
- $$
- begin{pmatrix}
- 1 & 0 & 0
- 0 & 1 & 0
- 0 & 0 & 1
- end{pmatrix}
- $$
- $$
- begin{pmatrix}
- 1 & a_1 & a_1^2 & cdots & a_1^n
- 1 & a_2 & a_2^2 & cdots & a_2^n
- vdots & vdots & vdots & ddots & vdots
- 1 & a_m & a_m^2 & cdots & a_m^n
- end{pmatrix}
- $$
- $$
- begin{bmatrix}
- 1 & 0 & 0
- 0 & 1 & 0
- 0 & 0 & 1
- end{bmatrix}
- $$
- $$
- begin{Bmatrix}
- 1 & 0 & 0
- 0 & 1 & 0
- 0 & 0 & 1
- end{Bmatrix}
- $$
- $$
- begin{vmatrix}
- 1 & 0 & 0
- 0 & 1 & 0
- 0 & 0 & 1
- end{vmatrix}
- $$
- $$
- begin{Vmatrix}
- 1 & 0 & 0
- 0 & 1 & 0
- 0 & 0 & 1
- end{Vmatrix}
- $$
3.9 经典公式翻译
- $$
- G(x)=frac{1}{sqrt{2pi}sigma}e^{-frac{x^2}{2sigma^2}}
- $$
其中,
frac{a}{b} -->![]()
sqrt{x} -->![]()
x^2 -->![]()
- $$
- G(x,y)=frac{1}{2pisigma^2}e^{-frac{x^2+y^2}{2sigma^2}}
- $$
- $$
- parallel mathbf xparallel_p = left( sum_ileft| x_i right|^p right)^frac{1}{p}
- $$
其中,
left( x right) -->![]()
left| x right| -->![]()
parallel x parallel -->![]()
x_i -->![]()
- $$
- begin{align}
- mathbf a cdot mathbf b &= sum_{i=1}^n a_i b_i
- &= mathbf a ^top mathbf b
- &= parallel a parallel_2 parallel b parallel_2cos{theta}
- end{align}
-
- $$
其中,
多行公式时, 用begin end; 公式换行时用
{align} 用来对齐公式, $表示对齐位置。
我们3行公式都以等号(=)对齐,所以在=前加$。(不加$时,默认是右对齐)
mathbf a -->![]()
sum_{i=1}^n -->![]()
cdot -->![]()
mathbf a^top -->![]()
- $$
- Var(f(x))=mathbb{E}left[ (f(x)-mathbb{E}left[f(x)right])^2 right]
- $$
其中,
mathbb{E} -->![]()
mathbb{R} -->![]()
- $$
- underset{lambdainLambda}{argmin}
- $$
其中,
underset{a}{b} -->![]()
- $$
- 2H_2+O_2xlongequal[]{燃烧}2H_2O
- $$
其中,
xlongequal[abc]{ABC} -->![]()
[]中填等号下面的内容,{}中填等号上面的内容。[]{}内可以为空。
等号的长度会根据[]和{}内表达式的长度自动调节。
- $$
- 2H_2+O_2xlongequal[]{}2H_2O
- 2H_2+O_2xlongequal[]{quad}2H_2O
- 2H_2+O_2xlongequal[]{quadquad}2H_2O
- $$
其中,
xlongequal[]{} -->![]()
quad : 表示4倍,在这里就是加长的意思。
quad越多,等号越长。
------------
对了, 想知道文字怎么
哈哈,如下:
- $$
- color{red}{变色}color{green}{变色}color{blue}{变色}
- $$
上面也可以这样写:
- $$
- color{#F00}{变色}color{#0F0}{变色}color{#00F}{变色}
- $$
{#xxx}中xxx表示rgb三通道的值,每一个的范围都在16进制的0~F之间,通过调配他们,这样你就有无数种颜色可以用啦!
- <div class="note default"><p>default</p></div>
- <div class="note primary"><p>primary</p></div>
- <div class="note success"><p>success</p></div>
- <div class="note info"><p>info</p></div>
- <div class="note warning"><p>warning</p></div>
- <div class="note danger"><p>danger</p></div>
- <div class="note default no-icon"><p>danger no-icon</p></div>
- <table><tr><td bgcolor=lightblue>背景色yellow</td></tr></table>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。