这里以 Mac 为例,简单介绍一下使用 Latex 来绘制数学公式 , Latex 的 LOGO 本身暗含其绘制复杂图案的能力
LaTex WiKi : https://en.wikipedia.org/wiki/LaTeX
一. Installation
Download the installation package for mac from the website - https://www.latex-project.org/get/
二. Usage
1. Open the application : "Application" - "Tex" - "LaTeXiT"
2. Input any mathematical formula definition in LaTeX format , for example :
e^{x} \sin{\left (x \right )} + e^{x} \cos{\left (x \right )}
3. With "Display" button selected , click "LaTeX it !" button :
三. Mathematical formula definiton in LaTex format
We Use Sympy :
#coding:utf-8
#[email protected]
from sympy import *
def func():
# variables definition
x = symbols('x')
# derivative
y = exp(x)*sin(x) + exp(x)*cos(x)
# print mathematical formula in LaTeX format
print(latex(y))
Output :
e^{x} \sin{\left (x \right )} + e^{x} \cos{\left (x \right )}
四. Basic Latex grammar
1. Subscript
eg : A_x outputs :
eg : \lim_{x \to 0} outputs :
eg : \lim_{x \to +\infty} outputs :
2. Exponent
eg : x^2 outputs :
3. Fraction
eg : \frac{3x^2+7x^3}{x^2+5x^4} outputs :
4. Norm
eg : ||_.|| + ||.|| + ||^.|| outputs :
5. Equal or Greater than & Equal or Lesser than
eg: n \ge 6 \; \& \; n \le 100 outputs :
6. Belong to & Not Belong to
eg : 8 \in Z^+ \;\;\&\;\; 8 \not\in Z^- outputs :
7. Space
eg : \;
8. Root Sign
eg : \sqrt[3]{1000} outputs :
9. Greek Letter
https://jingyan.baidu.com/article/9f7e7ec05fe9d66f2815541a.html
eg : \alpha_1 + \beta^2 outputs :
n. Comprehensiveness
eg : \lim_{x \to 0} \frac{3x^2 + 7x^3}{x^2 + 5x^4} = 3 outputs :
That's it !
How to use sympy : http://docs.sympy.org/latest/tutorial/index.html