From c538c151c7462ad0395ff2c15c5e11e89e362aa8 Mon Sep 17 00:00:00 2001
From: Striven <sg.striven@cutecat.club>
Date: Sat, 04 Apr 2026 19:47:16 +0000
Subject: [PATCH] Initial commit

---
 docs/features/Latex.md |   29 ++++++++++++++++++++++++-----
 1 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/docs/features/Latex.md b/docs/features/Latex.md
index 3c8f6ff..fdc9d27 100644
--- a/docs/features/Latex.md
+++ b/docs/features/Latex.md
@@ -1,6 +1,7 @@
 ---
+title: LaTeX
 tags:
-  - plugin/transformer
+  - feature/transformer
 ---
 
 Quartz uses [Katex](https://katex.org/) by default to typeset both inline and block math expressions at build time.
@@ -38,6 +39,20 @@
 \end{bmatrix}
 $$
 
+$$
+\begin{array}{rll}
+E \psi &= H\psi & \text{Expanding the Hamiltonian Operator} \\
+&= -\frac{\hbar^2}{2m}\frac{\partial^2}{\partial x^2} \psi + \frac{1}{2}m\omega x^2 \psi & \text{Using the ansatz $\psi(x) = e^{-kx^2}f(x)$, hoping to cancel the $x^2$ term} \\
+&= -\frac{\hbar^2}{2m} [4k^2x^2f(x)+2(-2kx)f'(x) + f''(x)]e^{-kx^2} + \frac{1}{2}m\omega x^2 f(x)e^{-kx^2} &\text{Removing the $e^{-kx^2}$ term from both sides} \\
+& \Downarrow \\
+Ef(x) &= -\frac{\hbar^2}{2m} [4k^2x^2f(x)-4kxf'(x) + f''(x)] + \frac{1}{2}m\omega x^2 f(x) & \text{Choosing $k=\frac{im}{2}\sqrt{\frac{\omega}{\hbar}}$ to cancel the $x^2$ term, via $-\frac{\hbar^2}{2m}4k^2=\frac{1}{2}m \omega$} \\
+&= -\frac{\hbar^2}{2m} [-4kxf'(x) + f''(x)] \\
+\end{array}
+$$
+
+> [!warn]
+> Due to limitations in the [underlying parsing library](https://github.com/remarkjs/remark-math), block math in Quartz requires the `$$` delimiters to be on newlines like above.
+
 ### Inline Math
 
 Similarly, inline math can be rendered by delimiting math expression with a single `$`. For example, `$e^{i\pi} = -1$` produces $e^{i\pi} = -1$
@@ -53,11 +68,15 @@
 - Incorrect: `I have $1 and you have $2` produces I have $1 and you have $2
 - Correct: `I have \$1 and you have \$2` produces I have \$1 and you have \$2
 
-## MathJax
+### Using mhchem
 
-In `quartz.config.ts`, you can configure Quartz to use [MathJax SVG rendering](https://docs.mathjax.org/en/latest/output/svg.html) by replacing `Plugin.Latex({ renderEngine: 'katex' })` with `Plugin.Latex({ renderEngine: 'mathjax' })`
+Add the following import to the top of `quartz/plugins/transformers/latex.ts` (before all the other
+imports):
+
+```ts title="quartz/plugins/transformers/latex.ts"
+import "katex/contrib/mhchem"
+```
 
 ## Customization
 
-- Removing Latex support: remove all instances of `Plugin.Latex()` from `quartz.config.ts`.
-- Plugin: `quartz/plugins/transformers/latex.ts`
+Latex parsing is a functionality of the [[plugins/Latex|Latex]] plugin. See the plugin page for customization options.

--
Gitblit v1.10.0