How to insert formula in markdown

Reprinted from: https://www.tuicool.com/articles/qqIrUbN

How do I insert formulas into Markdown documents

The author's main writing is to write the content of programming and mathematics. For this writing situation, using Markdown documents is very convenient. In this way, when there are not many screenshots and images, Markdown documents edited with plain text are much more convenient than rich text.

But there's always a problem when writing about mathematics. Formulas are often unavoidable, and it is too far-fetched to always use the symbols on the keyboard. If it involves integration, derivation, and determinant, it is very difficult to express with the existing symbols on the keyboard.

One way is to use pictures. The author can only say that this idea is correct, but it is impossible to make a picture with one formula, and then upload it one by one during the layout. Where does this have to be uploaded. Moreover, after there are too many formulas, it is difficult to typeset, and the order is easy to get wrong. This is where the Latex formula is needed .

If you want to display a formula in a Markdown document, you need to insert the following sentence first. If you're familiar with Markdown documents, it's easy to see that this actually inserts an image.

![ Formula name]( http://latex.codecogs.com/png.latex? Enter your formula here)

The above sentence is a formula for inserting a png image format, and the following sentence is a formula for inserting a gif image format. You can choose according to your actual needs, here we choose the gif image format.

![ Formula name]( http://latex.codecogs.com/gif.latex? Enter your formula here)

Next, let's discuss how to express this formula in plain text. For simple arithmetic expressions such as addition and subtraction, equal to, greater than or less than, and English letters, all that can be expressed through the existing symbols on the keyboard are directly input. For example, to represent 3x+5, you can write:

![ Example]( http://latex.codecogs.com/gif.latex?3x+5)

Its effect is:

In mathematics, there are two ways of expressing multiplication signs. These two methods sometimes mean the same thing, but there are also different situations, such as dot product and cross product in vector (vector) operations.

Use \times for cross product
Dot product using \cdot

For example, to express 3 dots multiplied by x+5 cross multiplied by y, it can be written as:

![ Example]( http://latex.codecogs.com/gif.latex?3\cdot{x}+5\times{y})

Its effect is:

We generally use fractional lines to represent division, and of course there are cases where division signs are used:

Represented by a fractional line: \frac{numerator}{denominator}
Use a division sign: \div

For example, if the numerator is 5 divided by 3 and the denominator is 15, the fraction can be written as:

![ Example]( http://latex.codecogs.com/gif.latex?\frac{5\div3}{15})

Its effect is:

The square root is expressed as:

The case of square root: \sqrt{square root}
The case of the nth power: \sqrt[nth power]{number of squares}

For example, the cubic root of the sum of 1 plus root 2 can be written as:

![ Example]( http://latex.codecogs.com/gif.latex?\sqrt[3]{1+\sqrt{2}})

Its effect is:

Sometimes you may need to enter a longer expression, such as:

x=15+(3+5)
=15+8
=23

you need to use

\begin{align*}
\end{align*}

Wrap the expression and use a double slash to indicate a newline, insert & before the equal sign to align the equal sign.

![ Example]( http://latex.codecogs.com/gif.latex?\begin{align*}x&=15+(3+5)\\&=15+8\\&=23\end{align *})

Its effect is:

Sometimes it is necessary to insert some symbols that are not on the keyboard, such as positive and negative signs, integral signs, accumulation signs (summation signs) and so on.

Sign: \pm
Integral sign: \int
Accumulator: \sum
Reintegration : \iint Ring integral: \oint Limit number: \lim Arrow: \to Positive infinity: \infty Maximum value: \max Greater than or equal to: \ge Less than or equal to: \le Not equal to: \neq

Superscripts and subscripts are represented by:

Letter_ {subscript}^{superscript}

For example, the square of x0 would be written as:

![ Example]( http://latex.codecogs.com/gif.latex?x_{0}^{2})

Its effect is:

You may need to use Greek letters. The Greek letter is represented by a slash plus the English of the Greek letter. If a lowercase Greek letter is required, the English letter is all lowercase. If an uppercase Greek letter is required, the first letter is capitalized, and the other letters lowercase, for example:

![ Example]( http://latex.codecogs.com/gif.latex?\alpha\beta\theta\delta\pi)

Its effect is:

![ Example]( http://latex.codecogs.com/gif.latex?\Theta\Delta\Pi)

Its effect is:

If an uppercase Greek letter has the same glyph as an English letter, it will not be realised. That is, there is no such way of writing Alpha and Beta, and if you write it this way, it will not be displayed.

Next you may need to use boldface (bold), open boldface (open bold), or handwriting, which are represented like this:

Bold: \boldsymbol
Hollow Bold: \mathbb
Handwriting: \mathcal

Say you can output the XYZ of these three fonts:

![ Example]( http://latex.codecogs.com/gif.latex?\boldsymbol{XYZ}\mathbb{XYZ}\mathcal{XYZ})

Its effect is:

The above content can basically meet your needs for entering formulas in Markdown documents. Latex formulas can also be used to display more mathematical symbols as well as determinants and matrices, which we won't introduce too much here. If you want to understand the Latex formula in detail, you can refer to the related tutorial. If you like the author's articles, you can follow the author's WeChat public account: yevgeny_liu

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324687977&siteId=291194637