Using markdown to write mathematical formulas

Keywords: Operating System Math markdown

It's really convenient to use markdown to write documents and support mathematical formulas!!!

Step 1: modify the preference settings and check the inline formula option

file -> Preferences -> Markdown -> Inline formula

After setting according to the following figure, we can happily enter the formula in Typora~

1, Enter Greek letters

  • Enter: $+ esc in the line, and the word $$will appear. Enter LaTex syntax between the two dollar symbols to insert a formula in the line.
  • If you enter $$` + ` enter 'between lines, a pair of ` $$$symbols will appear. Enter LaTex syntax between these symbols to insert formulas between lines.

Note: the dollar sign needs to be input under the English input method.

The LaTex syntax of Greek letters is shown in the figure below.

You can try to enter the code in your Typora editor according to the above method to observe the effect.

Note: please do not add a dun sign in the actual input code. The Dun sign here is only for a schematic separation.

$\alpha$,$\beta$,$\chi$,$\Delta$,$\Gamma$,$\Theta$
 
 $$
 \alpha\beta\chi
 $$

$\alpha$,$\beta$,$\chi$,$\Delta$,$\Gamma$,$\Theta$

$$ \alpha\beta\chi $$

2, Insert some mathematical structures

The method is the same as above, just replace the corresponding LaTex syntax. Here are a few examples to experience the usage. The rest can be tried in the Typora editor.

$\frac{abc}{xyz}$
 
 $$
 \frac{abc123}{xyz123}
 $$

For example, in line: $\ frac{abc}{xyz}$

Inter line input:

$$ \frac{abc123}{xyz123} $$

3, Insert delimiter

$|$,$\|$,$\Uparrow$

$|$ $\|$ $\Uparrow$

Note: combining the above delimiter with \ left and right can make the delimiter match the height of its content.

For example, to construct a determinant of the following matrix.

![4-variable](/images/2020-12-14-mathtypora/4-variable.png) $$
 \left|\begin{matrix}
    1 & 2 & 3 \\
    4 & 5 & 6 \\
    7 & 8 & 9
   \end{matrix} \right|
 $$

The display effect is as follows:

$$ \left| \begin{matrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{matrix} \right| $$

4, Insert some variable size symbols

 $$
 \bigcap\bigcup\bigoplus\bigotimes\sum\int\oint\iint
 $$

$$ \bigcap\bigcup\bigoplus\bigotimes\sum\int\oint\iint $$

5, Insert some function names

 $$
 \tan(at-n\pi)\\
 \sin\\
 \cos\\
 \log\\
 $$

$$ \tan(at-n\pi)\\ \sin\\ \cos\\ \log\\ $$

6, Insert binary and relational operators

$\times$,$\ast$,$\div$,$\pm$,$\mp$,$\leq$,$\geq$,$\lessgtr$

$\times$,$\ast$,$\div$,$\pm$,$\mp$,$\leq$,$\geq$,$\lessgtr$

7, Insert arrow symbol

$\leftarrow$,$\Leftarrow$,$\nLeftarrow$,$\rightleftarrows$

$\leftarrow$,$\Leftarrow$,$\nLeftarrow$,$\rightleftarrows$

8, Insert some other symbols

$\heartsuit$,$\infty$,$\iiint$,$\partial$

$\heartsuit$,$\infty$,$\iiint$,$\partial$

9, Superscript and subscript

We can use ^ to output superscript, using_ To output the subscript, use {} to include the scope.

For example:

 $$
 \sin^2(\theta) + \cos^2(\theta) = 1
 $$
 
 $$
 \sum_{n=1}^\infty k
 $$
 
 $$
 \int_a^bf(x)\,dx
 $$
 
 $$
 \lim\limits_{x\to\infty}\exp(-x) = 0
 $$
 

$$ \sin^2(\theta) + \cos^2(\theta) = 1 $$

$$ \sum_{n=1}^\infty k $$

$$ \int_a^bf(x)\,dx $$

$$ \lim\limits_{x\to\infty}\exp(-x) = 0 $$

10, Output matrix

The elements in the matrix are separated by $\ \ to wrap lines.

 $$
 \begin{matrix}
 0&1&2\\
 3&4&5\\
 6&7&8\\
 \end{matrix}
 $$

$$ \begin{matrix} 0&1&2\\ 3&4&5\\ 6&7&8\\ \end{matrix} $$

$$
 \begin{bmatrix}
 0&1&2\\
 3&4&5\\
 6&7&8\\
 \end{bmatrix}
 $$

$$ \begin{bmatrix} 0&1&2\\ 3&4&5\\ 6&7&8\\ \end{bmatrix} $$

 $$
 \begin{Bmatrix}
 0&1&2\\
 3&4&5\\
 6&7&8\\
 \end{Bmatrix}
 $$

$$ \begin{Bmatrix} 0&1&2\\ 3&4&5\\ 6&7&8\\ \end{Bmatrix} $$

$$
 \begin{vmatrix}
 0&1&2\\
 3&4&5\\
 6&7&8\\
 \end{vmatrix}
 $$

$$ \begin{vmatrix} 0&1&2\\ 3&4&5\\ 6&7&8\\ \end{vmatrix} $$

 $$
 \begin{Vmatrix}
 0&1&2\\
 3&4&5\\
 6&7&8\\
 \end{Vmatrix}
 $$

$$ \begin{Vmatrix} 0&1&2\\ 3&4&5\\ 6&7&8\\ \end{Vmatrix} $$

11, Output piecewise function

Use \ begin{cases} and \ end{cases} to construct segmented functions, and use \ \ to segment in the middle

 $$
 f(x) = 
 \begin{cases}
 2x,\,\,x>0\\
 3x,\,\,x\le0\\
 \end{cases}
 $$

$$ f(x) = \begin{cases} 2x,\,\,x>0\\ 3x,\,\,x\le0\\ \end{cases} $$

12, Typeface

 $\mathbf{ABCDEFGHIJKLMNOPQRSTUVWXYZabc123}$

$\mathbf{ABCDEFGHIJKLMNOPQRSTUVWXYZabc123}$

 $\mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZabc123}$

$\mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZabc123}$

 $\mathfrak{ABCDEFGHIJKLMNOPQRSTUVWXYZabc123}$

$\mathfrak{ABCDEFGHIJKLMNOPQRSTUVWXYZabc123}$

 $\mathsf{ABCDEFGHIJKLMNOPQRSTUVWXYZabc123}$

$\mathsf{ABCDEFGHIJKLMNOPQRSTUVWXYZabc123}$

 $\mathbb{ABCDEFGHIJKLMNOPQRSTUVWXYZabc123}$

$\mathbb{ABCDEFGHIJKLMNOPQRSTUVWXYZabc123}$

Follow & & contact

gitee: https://gitee.com/cmcc-oneos/OneOS-Lite

docs: https://oneos-lite.com/

Posted by fukumdaryl on Mon, 08 Nov 2021 17:10:25 -0800