在简书中使用Latex书写数学公式

开宗明义

简书中使用Latex写法:

![](http://latex.codecogs.com/svg.latex?f(x)=\frac{P(x)}{Q(x)})

Latex语法基础:

1.LaTeX文件的通常语法如下:

\documentstyle{article}

\begin{document}

This is a first example of a simple input file.

\end{document}

如果是中文,将\documentstyle{article}改为

\documentstyle{carticle}

2.简单的规则:

(1)空格:Latex中空格不起作用。

(2)换行:用控制命令“\”,或“ \newline”.

(3)分段:用控制命令“\par” 或空出一行。

(4)换页:用控制命令“\newpage”或“\clearpage”

(5)特殊控制字符:#,$, %, &, - ,{, }, ^, ~

要想输出这些控制符用下列命令:
# %&-{}^~%&-{}^~\blackslash$表示“ \”.。

3.西文字符转换表

rm 罗马字体 \it 意大利字体

\bf 黑体 \sl 倾斜体

\sf 等线体 \sc 小体大写字母

\tt 打字机字体 \mit 数学斜体

4.字号转换命令表

点数(pt) 相应中文字号 控制命令

25 一号 \Huge

20 二号 \huge

17 三号 \LARGE

14 四号 \Large

12 小四号 \large

10 五号 \normalsize

9 小五号 \small

8 六号 \footnotesize

7 小六号 \scriptsize

5 七号 \tiny

5.纵向固定间距控制命令

smallskip \medskip \bigskip

6.页面控制命令:

\textwidth=14.5cm

\textheight=21.5cm

系统默认:字号10pt= 五号字;西文字体为罗马字体;textwidth=12.2cm,textheight=18.6cm。相当于美国标准信纸大小。

PS:

线上编辑:

LaTeX可以进行线上编纂,好处是能够随时自动保存工作进度和数据,而且可以多人合作编写文档。

常用的LaTex online compiler基本就是sharelatex.comwritelatex.com这两个。

参考:

https://cn.sharelatex.com/project/58d7c2b1037281201a96db8b

\documentclass[manuscript]{aomart}
\begin{document}

$$E=mc^2$$

$$e^{ i\pi } + 1 = 0$$

$$A = {\pi r^2}/2$$

$$A=\frac{\pi r^2}{2}$$

$$0.5=\frac{1}{2}$$

$$\binom{n}{k} = \frac{n!}{k!(n-k)!}$$

$$f(x)=\frac{P(x)}{Q(x)}$$
 
$$p(x) = 3x^6 + 14x^5y + 590x^4y^2 + 19x^3y^3 - 12x^2y^4 - 12xy^5 + 2y^6 - a^3b^3$$

$$2x - 5y &=  8$$
$$3x + 9y &=  -12$$

$$x^n + y^n = z^n$$

\end{document}

1233356-6d2583c44e243af5.png
Latex数学表达式

数学表达式教程:

https://www.sharelatex.com/learn/Mathematical_expressions

本地

用LaTeX Compiler在本地电脑工作,则需要以下软件:

For Windows:
MikTex: http://miktex.org/download和TexMaker: http://www.xm1math.net/texmaker/download.html

For Mac:

MacTeX: http://www.tug.org/mactex/index.html和TexMaker,地址同Windows.之所以都需要两个软件是因为它们各自的作用不同:MikTex是package管理软件,而TexMaker是用这些package和你自己的文字来生成最终PDF文件的软件。

矩阵示例

Latex代码:

$$
        \begin{bmatrix}
        1 & x & x^2 \\
        1 & y & y^2 \\
        1 & z & z^2 \\
        \end{bmatrix}
$$

![][matrix]
[matrix]: http://latex.codecogs.com/svg.latex?\begin{bmatrix}1&x&x2\1&y&y2\1&z&z^2\\end{bmatrix}

简书md源码:

![][matrix]
[matrix]: http://latex.codecogs.com/svg.latex?\begin{bmatrix}1&x&x^2\\1&y&y^2\\1&z&z^2\\\end{bmatrix}

公式示例:

00:

01:

02:

03:

04:

05:

06:

07: ![][07]

[07]: http://latex.codecogs.com/svg.latex?f\left(\left[\frac{1+\left{x,y\right}}{\left(\frac{x}{y}+\frac{y}{x}\right)\left(u+1\right)}+a\right]^{3/2}\right)

简书源码:

00:![][00]

01: ![][01]

02: ![][02]

03: ![][03]

04: ![][04]

05: ![][05]

06: ![][06]

07: ![][07]



[00]: http://latex.codecogs.com/png.latex?\begin{bmatrix}1&x&x^2\\1&y&y^2\\1&z&z^2\\\end{bmatrix}

[01]: http://latex.codecogs.com/png.latex?e^{i\pi}+1=0

[02]: http://latex.codecogs.com/png.latex?C_n^k=\frac{n(n-1)\ldots(n-k+1)}{k!}

[03]: http://latex.codecogs.com/svg.latex?\begin{align}\sqrt{37}&=\sqrt{\frac{73^2-1}{12^2}}\\&=\sqrt{\frac{73^2}{12^2}\cdot\frac{73^2-1}{73^2}}\\&=\sqrt{\frac{73^2}{12^2}}\sqrt{\frac{73^2-1}{73^2}}\\&=\frac{73}{12}\sqrt{1-\frac{1}{73^2}}\\&\approx\frac{73}{12}\left(1-\frac{1}{2\cdot73^2}\right)\end{align}

[04]: http://latex.codecogs.com/svg.latex?\begin{array}{c|lcr}n&\text{Left}&\text{Center}&\text{Right}\\\hline1&0.24&1&125\\2&-1&189&-8\\3&-20&2000&1+10i\\\end{array}

[05]: http://latex.codecogs.com/svg.latex?\mathbb{N,Z,Q,R,C}

[06]: http://latex.codecogs.com/svg.latex?\left\{\begin{array}{ll}a_1x+b_1y+c_1z&=d_1+e_1\\a_2x+b_2y&=d_2\\a_3x+b_3y+c_3z&=d_3\end{array}\right.

[07]: http://latex.codecogs.com/svg.latex?f\left(\left[\frac{1+\left\{x,y\right\}}{\left(\frac{x}{y}+\frac{y}{x}\right)\left(u+1\right)}+a\right]^{3/2}\right)


![][fun]
[fun]:http://latex.codecogs.com/svg.latex?f(x)=\frac{P(x)}{Q(x)}


评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

光剑书架上的书

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值