[Tutorial] Step by step teaches you how to use Mathjax3.0 (Part 1)
Copyright Notice: This article is an original work licensed under the CC 4.0 BY-NC-ND license.
If you wish to repost this article, please include the original source link and this copyright notice.
Source link: https://v2know.com/article/510
First of all, in order to render LaTeX mathematical expressions on a web page, we can use MathJax:
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
Then you can try to output some formulas.
Example:
When \(a \ne 0\), there are two solutions to \(ax^2 + bx + c = 0\) and they are
\[x = {-b \pm \sqrt{b^2-4ac} \over 2a}.\]
MathJax:
In fact, I have to show the MathJax syntax inside code blocks; otherwise, it will be rendered as a mathematical formula. The following examples are also placed inside code blocks for the same reason.
Let me show you how to use these symbols first.
Code:
\(a \ne 0\)
MathJax:
As you can see, MathJax mathematical expressions can be written using delimiters such as \( and \), or \[ and \].
In other words, you can start with "\(" and end with "\)",
or start with "\[" and end with "\]".
The delimiters are used for different types of mathematical expressions:
\( ... \)is used for inline mathematical expressions.\[ ... \]is used for display mathematical expressions. The formula is displayed on a separate line and is usually centered.- Curly braces such as
{ }are commonly used inside LaTeX commands to group expressions.
Okay, you have learned the basic display method. In the next blog post, I will introduce another way to display mathematical expressions with MathJax.
Next: [Tutorial] Step by step teaches you how to use MathJax 3.0 (Part 2)
References:
MathJax basic tutorial and quick reference
This article was last edited at