January 12, 2020

How to add math on your blog : MathJax + Blogger


This tip is useful for engineering and science bloggers who want to share their knowledge on the web. Here is the way I found. I recently tested it on the blogger system,  the purpose is to share science tutorials with you using the correct math way.

Let's do it!

Draft on paper of the Debye-Scherrer equation for crystal size calculation 


Step 1:
Add a new gadget to your blog and copy and paste the following script.

<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>


Step 2: Write code in a new post following using latex language inside:
  • Inline \( latex code here \)
  • Paragraph  \[ latex code here \]

Step 3: Equation test: Debye -Scherrer  for crystal size calculation
\[ D(\text{nm}) = \frac{0.9 \lambda}{\beta\cos{\theta}} \]
  • D: Crystal size 
  • \(\lambda\) : 0.15406 nm  X-Ray wavelength 
  • \(\beta\) :  FWHM in radians (Full width at half maximum)  
  • \(\theta\) : Angle location of the peak in radians. 
If you have any questions, please comment on the post.

Samples from : https://www.mathjax.org/#samples



  • 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 \]

  • Angle Sum Formula for Cosines
\[ \cos(\theta+\phi)=\cos(\theta)\cos(\phi)−\sin(\theta)\sin(\phi) \]

  • 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) \]

2 comments:

  1. Very good post. Do you have any idea if something similar works in the new version of Google Sites? I have made a few attempts but have not been able to.

    ReplyDelete
  2. Dear Gualberto

    Thanks for your comment.. Unfortunately I don't know anything about Google Sites.. A year ago I decided to go for a Wordpress Blog. My investment was to use Amazon LightSail as a hosting provider (3.5 USD) + Domain. You can see it here www.jesuscapistran.com

    If you want to build your personal brand I highly recommend you go for a wordpress Blog.

    Saludos

    ReplyDelete