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(nm)=0.9λβcosθ
  • D: Crystal size 
  • λ : 0.15406 nm  X-Ray wavelength 
  • β :  FWHM in radians (Full width at half maximum)  
  • θ : 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±b24ac2a

  • Cauchy's Integral Formula
f(a)=12πif(z)zadz

  • Angle Sum Formula for Cosines
cos(θ+ϕ)=cos(θ)cos(ϕ)sin(θ)sin(ϕ)

  • Gauss' Divergence Theorem
D(F)dV=DFndS

  • Curl of a Vector Field
×F=(FzyFyz)i+(FxzFzx)j+(FyxFxy)k

  • Standard Deviation
σ=1Ni=1N(xiμ)2

  • Definition of Christoffel Symbols

(XY)k=Xi(iY)k=Xi(Ykxi+ΓimkYm)

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

Buy Me A Coffee