Skip to content

LaTeX Support

BioX-markdown includes full KaTeX integration for rendering mathematical equations.

Overview

LaTeX is a typesetting system for scientific and technical documents. BioX-markdown uses KaTeX for fast, web-based LaTeX rendering.

Inline Math

Use single dollar signs $...$ for inline equations:

Input

markdown
The mass-energy equation: $E = mc^2$

Euler's identity: $e^{i\pi} + 1 = 0$

Output

Beautiful inline equations with proper spacing.

Block Math

Use double dollar signs $$...$$ for display equations:

Input

markdown
Sigmoid activation function:

$$
\sigma(x) = \frac{1}{1 + e^{-x}}
$$

Output

Large, centered equations with full formatting.

PhD-Level Equations

BioX-markdown supports advanced mathematics for academic and scientific use.

Neural Networks

Backpropagation

markdown
$$
\frac{\partial L}{\partial W} = \frac{\partial L}{\partial a} \cdot \frac{\partial a}{\partial z} \cdot \frac{\partial z}{\partial W}
$$

Gradient Descent Weight Update

markdown
$$
W_{t+1} = W_t - \eta \cdot \nabla L(W_t)
$$

Quantum Mechanics

Time-Dependent Schrödinger Equation

markdown
$$
i\hbar \frac{\partial}{\partial t} |\psi(t)\rangle = \hat{H} |\psi(t)\rangle
$$

Linear Algebra

Singular Value Decomposition

markdown
$$
A = U\Sigma V^T
$$

Matrix Multiplication

markdown
$$
(AB)_{ij} = \sum_{k} A_{ik} B_{kj}
$$

Information Theory

Shannon Entropy

markdown
$$
H(X) = -\sum_{i} P(x_i) \log_2 P(x_i)
$$

KL Divergence

markdown
$$
D_{KL}(P||Q) = \sum_{i} P(i) \log\left(\frac{P(i)}{Q(i)}\right)
$$

Advanced Machine Learning

Transformer Attention Mechanism

markdown
$$
\text{Attention}(Q, K, V) = \text{softmax}\left(\frac{QK^T}{\sqrt{d_k}}\right)V
$$

Cross-Entropy Loss

markdown
$$
L = -\sum_{i} y_i \log(\hat{y}_i)
$$

Supported LaTeX Commands

BioX-markdown supports all standard LaTeX commands through KaTeX:

  • Greek letters: \alpha, \beta, \pi, \sigma, \omega, etc.
  • Operators: \sum, \int, \partial, \nabla, \frac, etc.
  • Subscripts/Superscripts: x_i, x^2, \sum_{i=1}^{n}, etc.
  • Fractions: \frac{a}{b}
  • Matrices: \begin{matrix} ... \end{matrix}
  • Functions: \sin, \cos, \exp, \log, \max, etc.
  • And 1000+ more LaTeX commands!

See KaTeX Supported Functions for complete list.

CSS Styling

Add KaTeX CSS to your HTML head for proper rendering:

html
<!-- CDN -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css">

<!-- Or install locally -->
<link rel="stylesheet" href="/static/katex.min.css">

Custom Styling

KaTeX adds these classes:

  • .katex - All rendered equations
  • .katex-display - Display mode (block) equations
  • .katex-html - HTML rendering
  • .katex-mathml - MathML rendering

Example CSS:

css
.katex-display {
  margin: 1em 0;
  padding: 0.5em;
  overflow-x: auto;
}

.katex {
  font-size: 1.1em;
}

External Resources

Released under MIT License