MathJax Support Demo
This page demos MathJax support, nothing else
467 Words … ⏲ Reading Time: 2 Minutes, 7 Seconds
2023-08-18 08:37 +0000
Beautiful and accessible math in all browsers
A JavaScript display engine for mathematics that works in all browsers.
Configuration
Mathjax support is implemented via partials. Please find partial in /layouts/partials/mathjax.html
|
|
I have given a simple style for mathjax components. You may find in /assets/scss/_mathjax.scss
. You may extend this stylesheet according to your liking.
|
|
Finally, Javacript. Mathjax has two JS.
/assets/js/mathjax/mathjax-full@3_es5_tex-mml-svg.min.js
(This is the main library downloaded from jsDelivr)/assets/js/mathjax/mathjax-assistant.js
(You may extend this according to your liking)
|
|
You can invoke partial in following ways:
- If you want global Mathjax support (for technical blog): set
global_mathjax
to true in hugo.toml - If you want mathjax support in individual articles : add
mathjax : true
to Frontmatter
I have consciously decoupled main javascript from Mathjax javascript, so that you may visualize if there is any load latency, given mathjax JS is huge. I have minified it, but still if you get any better optimizations, let me know.
The MathJax library version (at the time of publising this article) is : 3.2.2.
It includes components : tex-mml-svg.
The Quadratic Formula
$$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$
Cauchy’s Integral Formula
$$ f(a) = \frac{1}{2\pi i} \oint\frac{f(z)}{z-a}dz $$
Gauss’ Divergence Theorem
$$ \int_D ({\nabla\cdot} F)dV=\int_{\partial D} F\cdot ndS $$
Curl of a Vector Field
$$ \vec{\nabla} \times \vec{F} = \left( \frac{\partial F_z}{\partial y} - \frac{\partial F_y}{\partial z} \right) \mathbf{i} + \left( \frac{\partial F_x}{\partial z} - \frac{\partial F_z}{\partial x} \right) \mathbf{j} + \left( \frac{\partial F_y}{\partial x} - \frac{\partial F_x}{\partial y} \right) \mathbf{k} $$
Standard Deviation
$$ \sigma = \sqrt{ \frac{1}{N} \sum_{i=1}^N (x_i -\mu)^2} $$
Definition of Christoffel Symbols
$$ (\nabla_X Y)^k = X^i (\nabla_i Y)^k = X^i \left( \frac{\partial Y^k}{\partial x^i} + \Gamma_{im}^k Y^m \right) $$
Inline
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}.$$
A complex equation
\begin{equation} S (ω)=1.466, H_s^2 , \frac{ω_0^5}{ω^6 } , e^[-3^ { ω/(ω_0 )]^2} \end{equation}
Another equation
$$\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}$$