Markdown Syntax Showcase

This post demonstrates the Markdown and KaTeX syntax rendering capabilities of the blog.

Basic Formatting

Bold text and italic text work as expected. You can also use strikethrough and inline code.

Headings

Headings use the standard Markdown syntax with hash symbols. They render with proper hierarchy and spacing.

Lists

Unordered lists:

  • First item
  • Second item
    • Nested item
    • Another nested item
  • Third item

Ordered lists:

  1. Step one
  2. Step two
  3. Step three

Code Blocks

Fenced code blocks with syntax highlighting:

def hello_world
  puts "Hello, world!"
end

Blockquotes

This is a blockquote. It can span multiple lines and contain other formatting.

Horizontal Rules


Link text goes to external sites. Internal links work too.

Images

Images can be embedded with alt text:

Sample image with alt text

Tables

Header 1 Header 2 Header 3
Cell 1 Cell 2 Cell 3
Cell 4 Cell 5 Cell 6

Math with KaTeX

Inline math: $E = mc^2$

Block math:

[\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}]</p>

More complex expressions:

[\sum_{i=1}^{n} x_i = x_1 + x_2 + \cdots + x_n]</p>

[\begin{pmatrix} a & b \ c & d \end{pmatrix}]</p>

Combined Example

Here's a quadratic formula solution:

[x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}]</p>

And the code to calculate it:

import math

def solve_quadratic(a, b, c):
    discriminant = b**2 - 4*a*c
    if discriminant < 0:
        return None
    x1 = (-b + math.sqrt(discriminant)) / (2*a)
    x2 = (-b - math.sqrt(discriminant)) / (2*a)
    return (x1, x2)

Conclusion

This covers most of the syntax you'll need for writing rich blog posts with mathematical content.