Blog Formatting Guide
This post demonstrates all the formatting options available for PySimHub blog posts.
Text Formatting
You can write bold text, italic text, and bold italic text. You can also use inline code for technical terms or short code snippets.
Blockquotes are great for highlighting important information or quoting sources. They stand out with an accent-colored left border.
Here’s a link to the PySimHub homepage and an external link to GitHub.
Headings
The heading above is an H2. Below are examples of other heading levels:
This is an H3 Heading
This is an H4 Heading
Lists
Unordered Lists
- First item
- Second item
- Nested item
- Another nested item
- Third item
Ordered Lists
- First step
- Second step
- Third step
- Sub-step A
- Sub-step B
Code Blocks
Inline code looks like this. For longer code, use fenced code blocks:
import numpy as np
from scipy.integrate import odeint
def lorenz(state, t, sigma=10, rho=28, beta=8/3):
"""The Lorenz system of differential equations."""
x, y, z = state
return [
sigma * (y - x),
x * (rho - z) - y,
x * y - beta * z
]
# Initial conditions and time span
initial_state = [1.0, 1.0, 1.0]
t = np.linspace(0, 50, 10000)
# Solve the system
solution = odeint(lorenz, initial_state, t) // JavaScript example
const simulate = async (model, params) => {
const results = await model.run(params);
return results.map(r => r.value);
}; Mathematics
PySimHub blog posts support LaTeX math rendering via KaTeX.
Inline Math
The famous equation shows the equivalence of mass and energy. The Reynolds number characterizes flow regimes.
Display Math
The Gaussian integral:
A simple differential equation solution:
Summation example:
Matrix notation:
The Navier-Stokes equations:
Tables
| Method | Accuracy | Speed | Use Case |
|---|---|---|---|
| Euler | Low | Fast | Quick estimates |
| RK4 | High | Medium | General purpose |
| Adams-Bashforth | High | Fast | Long simulations |
| Implicit | Very High | Slow | Stiff systems |
Images
Standard markdown images:
For more control, use HTML figure elements:
Combining Elements
Here’s an example combining text, math, and code to explain a concept:
The Euler method is the simplest numerical integration technique. Given an ODE , we approximate the solution at discrete time steps:
where h is the step size. Implementation in Python:
def euler_step(f, t, y, h):
"""Perform one Euler integration step."""
return y + h * f(t, y) Note: While simple, the Euler method has local error, making it less accurate than higher-order methods like RK4.
Summary
This guide covered:
- Text formatting - bold, italic, links, blockquotes
- Structure - headings, lists, horizontal rules
- Code - inline and fenced code blocks
- Math - inline and display LaTeX equations via the Math component
- Media - images and figures with captions
- Data - tables for structured information
Happy writing!