Computer Science
Algorithm
Data Processing
Digital Life
Distributed System
Distributed System Infrastructure
Machine Learning
Operating System
Android
Linux
Tizen
Windows
iOS
Programming Language
C++
Erlang
Go
Scala
Scheme
Type System
Software Engineering
Storage
UI
Flutter
Javascript
Beautiful Math with MathJex (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)
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 MathJex

Posted on 17 Dec 2012, tagged compositionMathJexLaTex

Never ever say you are a geek if you don’t have some mathematical formulas on your website! I have done so though MathJex:). 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 except (b \ne 0) in expression (a \over b) and the famous formula (E = mc^2) from Einstein.

However, there are some issues to use MathJex 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 a html/xml block. Such as <span>\(a \ne 0\)</span> for a inline formula (a \ne 0).