Do math typesetting in one markdown file using KaTeX

1. Accents

Chinese version: Zhihu

Use Vs Code and extension Markdown Preview Enhanced (by Yiyi Wang) you can preview math typesetting in markdown file using KaTeX, see Math.

By the way, I use Markdown All in One (by Yu Zhang) to creat table of contents and export markdown to html, Markdown Footnote (by Mai Hou) to automatically add footnotes and markdown-index (by legendmohe) to automatically add serial numbers on titles.

Here I introduce some basic fomulas most used in Calculus, for more information, see KaTeX.

The contents in every section are: code, preview.

1. Accents

1.1. Prime

$ f'(x) $
f(x) f'(x)

1.2. Vector

$ \vec {a} $
a \vec {a}

$ \overrightarrow {PP_0} $
PP0 \overrightarrow {PP_0}

1.3. Hat

$ \hat{\theta} $
θ^ \hat{\theta}

$ \widehat{ac} $
ac^ \widehat{ac}

2. Delimiters

2.1. Parentheses

$ (x) $
(x) (x)

2.2. Brackets

$ [x] $
[x] [x]

2.3. Braces

$ \{x\} $
{x} \{x\}

2.4. Absolute Value

$ |x| $
x |x|

2.5. Delimiter Sizing

( \big( \Big( \bigg( \Bigg( ((((( ( \big( \Big( \bigg( \Bigg(

$ (\csc x)' = \Big ( \frac {1} {\sin x} \Big )' $
(cscx)=(1sinx) (\csc x)' = \Big ( \frac {1} {\sin x} \Big )'

$ \frac {d^2f} {dx^2} \big | _{x=x_0} $
d2fdx2x=x0 \frac {d^2f} {dx^2} \big | _{x=x_0}

3. Environments

3.1. Piecewise Function

$ f(x) = \begin{cases} x, &\text{if } x \ge 0 \\ -x, &\text{if } x < 0 \end{cases} $

f(x)={x,if x0x,if x<0 f(x) = \begin{cases} x, &\text{if } x \ge 0 \\ -x, &\text{if } x < 0 \end{cases}

3.2. Vmatrix

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

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

4. Layout

4.1. Line Breaks

$ a b \\ c d $
abcd a b \\ c d

5. Greek Letters

5.1. alpha

$ \alpha $
α \alpha

5.2. beta

$ \beta $
β \beta

5.3. Delta

$ \Delta $
Δ \Delta

5.4. theta

$ \theta $
θ \theta

5.5. lambda

$ \lambda $
λ \lambda

5.6. mu

$ \mu $
μ \mu

5.7. xi

$ \xi $
ξ \xi

5.8. pi

$ \pi $
π \pi

5.9. Partial Derivative

$ \partial $
\partial

6. Binary Operators

6.1. Plus

$ x + y $
x+y x + y

6.2. Minus

$ x - y $
xy x - y

6.3. Times

$ x \times y $
x×y x \times y

6.4. Divide

$ x \div y $
x÷y x \div y

6.5. Intersect

$ (0,5) \cap (-1,3) $
(0,5)(1,3) (0,5) \cap (-1,3)

6.6. Union

$ (-\infty,0) \cup (0,+\infty) $
(,0)(0,+) (-\infty,0) \cup (0,+\infty)

7. Vertical Layout

7.1. Superscript

$ e^x $
ex e^x

7.2. Subscript

$ x_n $
xn x_n

8. Spacing

$ a b \\ a \space b $
aba b a b \\ a \space b

or

$ a b \\ a \ b $
aba b a b \\ a \ b

9. Logic and Set Theory

9.1. in

$ k \in \bf {Z} $
kZ k \in \bf {Z}

9.2. subset

$ D \subset R $
DR D \subset R

10. Big Operators

10.1. Integration

$ \int _{-\infty} ^{+\infty} e^x dx $
+exdx \int _{-\infty} ^{+\infty} e^x dx

$ \iint \limits _D f(x,y) dxdy $
Df(x,y)dxdy \iint \limits _D f(x,y) dxdy

10.2. Sum

$ \sum \limits _{i=1} ^n f(x) $
i=1nf(x) \sum \limits _{i=1} ^n f(x)

$ \sum \limits _{\substack {0<i<m \\ 0<j<n}} f(x) $
0<i<m0<j<nf(x) \sum \limits _{\substack {0<i<m \\ 0<j<n}} f(x)

10.3. Product

$ \prod \limits _{k=1} ^n a_k $
k=1nak \prod \limits _{k=1} ^n a_k

11. Fractions

$ \frac {x^2} {x+1} $
x2x+1 \frac {x^2} {x+1}

$ \frac {a} {1 + \frac {1} {b}} $
a1+1b \frac {a} {1 + \frac {1} {b}}

12. Math Operators

12.1. sin

$ \sin x $
sinx \sin x

12.2. cos

$ \cos x $
cosx \cos x

12.3. tan

$ \tan x $
tanx \tan x

12.4. arcsin

$ \arcsin x $
arcsinx \arcsin x

12.5. arctan

$ \arctan x $
arctanx \arctan x

12.6. lg

$ \lg x $
lgx \lg x

12.7. ln

$ \ln x $
lnx \ln x

12.8. log

$ \log x $
logx \log x

12.9. Radical Sign

$ \sqrt x $
x \sqrt x

$ \sqrt [3] {x^2+2x+1} $
x2+2x+13 \sqrt [3] {x^2+2x+1}

12.10. lim

$ f'(x) = \lim \limits _{\Delta x \rightarrow 0} \frac {f(x + \Delta x) - f(x)} {\Delta x} $

f(x)=limΔx0f(x+Δx)f(x)Δx f'(x) = \lim \limits _{\Delta x \rightarrow 0} \frac {f(x + \Delta x) - f(x)} {\Delta x}

13. Relations

13.1. equal to

$ x = y $
x=y x = y

13.2. not equal to

$ x \ne y $
xy x \ne y

13.3. less than

$ x < y $
x<y x < y

13.4. greater than

$ x > y $
x>y x > y

13.5. less than or equal to

$ x \le y $
xy x \le y

13.6. greater than or equal to

$ x \ge y $
xy x \ge y

13.7. equivalent to

$ F(x,f(x)) \equiv 0, x \in D $
F(x,f(x))0,xD F(x,f(x)) \equiv 0, x \in D

13.8. approximately equal to

$ x \approx y $
xy x \approx y

14. Arrows

14.1. right arrow

$ x \rightarrow 0 $
x0 x \rightarrow 0

14.2. not right arrow

$ x \nrightarrow 0 $
x0 x \nrightarrow 0

14.3. Long Equal

$ 2^{\frac 1 x} \xlongequal {y = \frac 1 x} 2^y $
21x=y=1x2y 2^{\frac 1 x} \xlongequal {y = \frac 1 x} 2^y

15. Font

15.1. Bold

$ R \ \ \bf R $
R  R R \ \ \bf R

16. Symbols and Punctuation

16.1. Infinity

$ \infty $
\infty

16.2. Dots

$ \dots $
\dots

16.3. Dot Product

$ x \sdot y $
xy x \sdot y

Comments

Popular posts from this blog

Zhihu Scraper: Scraping the text content in Zhihu's public collection folder (Videos and pictures are saved in the form of links)

FFmpeg: Solve the problem that the video file can't be played due to the lack of codec, get the parameters required by the delogo command of removing the watermark, and some other commonly used commands