Computer Science
Algorithm
Data Processing
Digital Life
Distributed System
Distributed System Infrastructure
Machine Learning
Machine Learning Application
Operating System
Android
Linux
MacOS
Tizen
Windows
iOS
Programming Language
C++
Erlang
Go
Scala
Scheme
Type System
Software Engineering
Storage
UI
Flutter
Javascript
Beautiful Math with MathJax (2012)
Virtualization
Life
Life in Guangzhou (2013)
Recent Works (2013)
东京之旅 (2014)
My 2017 Year in Review (2018)
My 2020 in Review (2021)
十三年前被隔离的经历 (2022)
A Travel to Montreal (2022)
My 2022 in Review (2023)
Travel Back to China (2024)
A 2-Year Reflection for 2023 and 2024 (2025)
Travel Back To China: 2025 Edition (2025)
Projects
Bard
Blog
RSS Brain
Scala2grpc
Comment Everywhere (2013)
Fetch Popular Erlang Modules by Coffee Script (2013)
Psychology
耶鲁大学心理学导论 (2012)
Thoughts
Chinese
English

Beautiful Math with MathJax

Posted on 17 Dec 2012, tagged compositionMathJaxLaTeX

Never ever say you are a geek if you don’t have some mathematical formulas on your website! I have done so through MathJax :). Here are some examples:

Code:

$$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$
$$ |s_n - s_m|=|\sum_{k=m+1}^n u_{k}|=|u_{m+1}+u_{m+2}+...+u_{n}| \lt \epsilon $$

Result:

\(x = {-b \pm \sqrt{b^2-4ac} \over 2a}\)

\(|s_n - s_m|=|\sum_{k=m+1}^n u_{k}|=|u_{m+1}+u_{m+2}+...+u_{n}| \lt \epsilon\)

Now let’s try some inline formulas, such as you may expect (b \ne 0) in expression (a \over b) and the famous formula (E = mc^2) from Einstein.

However, there are some issues to use MathJax with Markdown because symbols in formula will be parsed by Markdown first. The easiest way to avoid this is surrounding your formula with <span> since Markdown will parse nothing in an html/xml block. Such as <span>\(a \ne 0\)</span> for an inline formula (a \ne 0).