Markdown notes: How to write a mathematical formula
Here is a simple record of how to write a mathematical formula in Markdown. Like StackOverflow on the regular some pretty formula, it is not generated pictures, and Mathjax engine, add Mathjax engine in Markdown is also very simple, add the following code into the markdown code:
<script type= "Text/javascript" src= "Http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=default" ></ Script>
The above code is to add a section of JS code, so that the current page will be able to use the Mathjax engine.
The syntax for writing formulas is to write formulas using Tex, in Tex $$ formula $$ represents the line formula, and \ (Formula \) represents the inline formula. But because Markdown \ is an escape character, enter the inline formula in markdown using \ \ (Formula \ \).
Inline Formula code example:
The inline formula shows:
X=−B±B2−4AC−−−−−−−√2A X=\FRAC{-B\PM\SQRT{B^2-4AC}}{2A}
In-line Formula code example:
\ \ (x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}\\)
In-line formula display: X=−B±B2−4AC√2A X=\FRAC{-B\PM\SQRT{B^2-4AC}}{2A}
Note: In the markdown engine of CSDN:
1 no need to add code referencing the Mathjax engine, it seems that it will be introduced by default;
2 in-line formula \ \ should be written in \\\\, for example, the formula code in the upper routine should be: \\\\ (x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}\\\\)