LaTeX Math Support in Astro Scholar

LaTeX Math Support in Astro Scholar


Table of Contents

Welcome to the new LaTeX math support in Astro Scholar! This post demonstrates the various ways you can write mathematical equations in your markdown files.

Inline Math

You can easily write inline math equations by wrapping them in single dollar signs. For example, the famous mass-energy equivalence formula is E=mc2E = mc^2.

Here are some more inline examples:

  • The area of a circle: A=πr2A = \pi r^2
  • The Pythagorean theorem: a2+b2=c2a^2 + b^2 = c^2
  • A simple limit: limx0sinxx=1\lim_{x \to 0} \frac{\sin x}{x} = 1

Block Math

For larger or more complex equations, you can use block math by wrapping them in double dollar signs. This will center the equation on its own line.

Here is the quadratic formula:

x=b±b24ac2ax = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}

Calculus

Let’s look at some calculus examples:

Derivative:

f(x)=limh0f(x+h)f(x)hf'(x) = \lim_{h \to 0} \frac{f(x+h) - f(x)}{h}

Integral:

abx2dx=[x33]ab=b3a33\int_{a}^{b} x^2 dx = \left[ \frac{x^3}{3} \right]_{a}^{b} = \frac{b^3 - a^3}{3}

Matrices

You can also render matrices:

[123456789]\begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{bmatrix}

Summation and Products

i=1ni=n(n+1)2\sum_{i=1}^{n} i = \frac{n(n+1)}{2} i=1ni=n!\prod_{i=1}^{n} i = n!

Enjoy writing beautiful math equations in your blog posts!