Markdown notes: How to write a mathematical formula

Source: Internet
Author: User
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}\\\\)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.