開宗明義
簡書中使用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.簡單的規(guī)則:
(1)空格:Latex中空格不起作用呼猪。
(2)換行:用控制命令“\”,或“ \newline”.
(3)分段:用控制命令“\par” 或空出一行缕粹。
(4)換頁:用控制命令“\newpage”或“\clearpage”
(5)特殊控制字符:#踩叭,$, %, &, - ,{, }, ^, ~
要想輸出這些控制符用下列命令:
# %&-{}^~%&-{}^~\blackslash$表示“ \”.逢并。
3.西文字符轉換表
rm 羅馬字體 \it 意大利字體
\bf 黑體 \sl 傾斜體
\sf 等線體 \sc 小體大寫字母
\tt 打字機字體 \mit 數(shù)學斜體
4.字號轉換命令表
點數(shù)(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
系統(tǒng)默認:字號10pt= 五號字抱怔;西文字體為羅馬字體;textwidth=12.2cm,textheight=18.6cm拉一。相當于美國標準信紙大小。
PS:
線上編輯:
LaTeX可以進行線上編纂旧乞,好處是能夠隨時自動保存工作進度和數(shù)據(jù)蔚润,而且可以多人合作編寫文檔。
常用的LaTex online compiler基本就是sharelatex.com和writelatex.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}
數(shù)學表達式教程:
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: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)}