Test file for rendering TeX math within Markdown files

Silberengel

npub1l5sga6xg72phsz5422ykujprejwud075ggrr3z2hwyrfgr7eylqstegx9z

hex

4d63b58829706a7ea86ee982146f8b8b894e2e34d210e46b1c16f240dc41ed8c

nevent

nevent1qqsy6ca43q5hq6n74phwnqs5d79chz2w9c6dyy8ydvwpdujqm3q7mrqprpmhxue69uhhyetvv9ujuem4d36kwatvw5hx6mm9qgs06gywary09qmcp2249ztwfq3ue8wxhl2yyp3c39thzp55plvj0sg47djfp

naddr

naddr1qqgk6ctjddjx7amw946x27pdw3jhxaqprpmhxue69uhhyetvv9ujuem4d36kwatvw5hx6mm9qgs06gywary09qmcp2249ztwfq3ue8wxhl2yyp3c39thzp55plvj0sgrqsqqqa284mnkp5

Kind-30023 (Article)

2026-04-01T14:43:51Z

TeX Test

Simple Math Rendering Test

This is a minimal test note for TeX math rendering.

1) Inline Math

  • $E=mc^2$
  • $\sqrt{x^2+1}$
  • $\frac{a}{b}$
  • $\Psi, \psi, \Phi, \phi$

2) Display Math

$$E=mc^2$$

$$\sum_{i=1}^{n} i = \frac{n(n+1)}{2}$$

$$\begin{pmatrix}1 & 2 \\ 3 & 4\end{pmatrix}$$

3) Mixed Text + Math

The roots of $x^2-6x+4=0$ are:

$$x=\frac{6\pm\sqrt{36-16}}{2}$$

So approximately $x\approx 0.8$ or $x\approx 5.2$.

4) TeX in a fenced block

$$
f(x)=
\begin{cases}
x^2, & x \ge 0 \\
-x, & x < 0
\end{cases}
$$

5) Edge cases (should stay as plain text)

  • The price is $10.50
  • echo "Price: $100"
  • ``const price = `$${amount}```
  • color: $primary-color

Advanced TeX + Markdown Stress Test

This note mixes inline math, display math, aligned equations, matrices, piecewise functions, integrals, sums, limits, and edge-case text.

1) Inline Math

  • Energy relation: $E=mc^2$
  • Euler identity: $e^{i\pi}+1=0$
  • Binomial coefficient: $\binom{n}{k}=\frac{n!}{k!(n-k)!}$
  • Vector norm: $\lVert x\rVert_2=\sqrt{\sum_{i=1}^n x_i^2}$
  • Conditional probability: $P(A\mid B)=\frac{P(A\cap B)}{P(B)}$
  • Greek + operators: $\alpha,\beta,\gamma,\Gamma,\Delta,\Omega,\nabla,\partial,\infty,\pm,\times,\cdot$

2) Display Math

$$\sum_{k=1}^{n}k=\frac{n(n+1)}{2}$$

$$\int_0^1 x^2\,dx=\frac{1}{3}$$

$$\lim_{x\to 0}\frac{\sin x}{x}=1$$

$$\prod_{i=1}^{m}\prod_{j=1}^{n} a_{ij}$$

3) Multi-line / Aligned

$$
\begin{aligned}
(a+b)^2 &= a^2 + 2ab + b^2 \\
(a-b)^2 &= a^2 - 2ab + b^2 \\
a^2-b^2 &= (a-b)(a+b)
\end{aligned}
$$

4) Piecewise + Text

$$ f(x)= \begin{cases} x^2, & x \ge 0 \ -x, & x < 0 \end{cases} \qquad \text{and}\qquad g(x)= \begin{cases} \sin x, & |x|\le \pi \ 0, & \text{otherwise} \end{cases} $$

5) Matrices + Determinants

$$A=\begin{bmatrix}1&2&3\0&1&4\5&6&0\end{bmatrix}$$

$$B=\begin{pmatrix}a&b\c&d\end{pmatrix},\quad \det(B)=\begin{vmatrix}a&b\c&d\end{vmatrix}=ad-bc$$

$$\operatorname{tr}(A)=1+1+0=2$$

6) Calculus / Differential Equations

$$\frac{d}{dx}\left(e^{x^2}\right)=2x e^{x^2}$$

$$\frac{\partial u}{\partial t}=\kappa \frac{\partial^2 u}{\partial x^2}$$

7) Number Theory / Logic

Congruence: $a\equiv b\pmod n$

Prime set: $\mathbb{P}={p\in\mathbb{N}:p\text{ is prime}}$

Quantifiers: $\forall x\in\mathbb{R}\ \exists y\in\mathbb{R}: y>x$

8) Markdown + Math in same paragraph

For $x>0$, define $h(x)=\ln x$.

Then $h'(x)=\frac{1}{x}$, and by Taylor expansion near $x=1$: $$\ln(1+u)=u-\frac{u^2}{2}+\frac{u^3}{3}-\cdots,\quad |u|<1$$.

9) TeX in fenced block (language tag only)

$$\left.\frac{\partial T}{\partial P}\right|_s=\left.\frac{\partial v}{\partial s}\right|_P$$

10) Edge Cases (should remain plain text)

The price is $19.99 echo "Price: $100" ``const tpl = `$${amount}``` color: $primary-color literal $$ not a closed block literal $x+1 without closing delimiter

原始 JSON

{
  "kind": 30023,
  "id": "4d63b58829706a7ea86ee982146f8b8b894e2e34d210e46b1c16f240dc41ed8c",
  "pubkey": "fd208ee8c8f283780a9552896e4823cc9dc6bfd442063889577106940fd927c1",
  "created_at": 1775054631,
  "tags": [
    [
      "d",
      "markdown-tex-test"
    ],
    [
      "title",
      "Test file for rendering TeX math within Markdown files"
    ],
    [
      "summary",
      "test file"
    ],
    [
      "image",
      "https://upload.wikimedia.org/wikipedia/commons/thumb/6/68/TeX_logo.svg/3840px-TeX_logo.svg.png"
    ],
    [
      "t",
      "nostrmarkup"
    ],
    [
      "t",
      "tex"
    ],
    [
      "t",
      "latex"
    ],
    [
      "t",
      "math"
    ],
    [
      "client",
      "jumble"
    ],
    [
      "alt",
      "This event was published by https://jumble.imwald.eu."
    ]
  ],
  "content": "# TeX Test\n\n## Simple Math Rendering Test\n\nThis is a minimal test note for TeX math rendering.\n\n### 1) Inline Math\n\n- `$E=mc^2$`\n- `$\\sqrt{x^2+1}$`\n- `$\\frac{a}{b}$`\n- `$\\Psi, \\psi, \\Phi, \\phi$`\n\n### 2) Display Math\n\n`$$E=mc^2$$`\n\n`$$\\sum_{i=1}^{n} i = \\frac{n(n+1)}{2}$$`\n\n`$$\\begin{pmatrix}1 \u0026 2 \\\\ 3 \u0026 4\\end{pmatrix}$$`\n\n### 3) Mixed Text + Math\n\nThe roots of `$x^2-6x+4=0$` are:\n\n`$$x=\\frac{6\\pm\\sqrt{36-16}}{2}$$`\n\nSo approximately `$x\\approx 0.8$` or `$x\\approx 5.2$`.\n\n### 4) TeX in a fenced block\n\n```latex\n$$\nf(x)=\n\\begin{cases}\nx^2, \u0026 x \\ge 0 \\\\\n-x, \u0026 x \u003c 0\n\\end{cases}\n$$\n```\n\n### 5) Edge cases (should stay as plain text)\n\n* The price is $10.50\n* echo \"Price: $100\"\n* ``const price = `$${amount}```\n* color: $primary-color\n\n## Advanced TeX + Markdown Stress Test\n\nThis note mixes inline math, display math, aligned equations, matrices, piecewise functions, integrals, sums, limits, and edge-case text.\n\n### 1) Inline Math\n\n- Energy relation: `$E=mc^2$`\n- Euler identity: `$e^{i\\pi}+1=0$`\n- Binomial coefficient: `$\\binom{n}{k}=\\frac{n!}{k!(n-k)!}$`\n- Vector norm: `$\\lVert x\\rVert_2=\\sqrt{\\sum_{i=1}^n x_i^2}$`\n- Conditional probability: `$P(A\\mid B)=\\frac{P(A\\cap B)}{P(B)}$`\n- Greek + operators: `$\\alpha,\\beta,\\gamma,\\Gamma,\\Delta,\\Omega,\\nabla,\\partial,\\infty,\\pm,\\times,\\cdot$`\n\n### 2) Display Math\n\n`$$\\sum_{k=1}^{n}k=\\frac{n(n+1)}{2}$$`\n\n`$$\\int_0^1 x^2\\,dx=\\frac{1}{3}$$`\n\n`$$\\lim_{x\\to 0}\\frac{\\sin x}{x}=1$$`\n\n`$$\\prod_{i=1}^{m}\\prod_{j=1}^{n} a_{ij}$$`\n\n### 3) Multi-line / Aligned\n\n```latex\n$$\n\\begin{aligned}\n(a+b)^2 \u0026= a^2 + 2ab + b^2 \\\\\n(a-b)^2 \u0026= a^2 - 2ab + b^2 \\\\\na^2-b^2 \u0026= (a-b)(a+b)\n\\end{aligned}\n$$\n```\n\n### 4) Piecewise + Text\n\n$$\nf(x)=\n\\begin{cases}\nx^2, \u0026 x \\ge 0 \\\\\n-x, \u0026 x \u003c 0\n\\end{cases}\n\\qquad\n\\text{and}\\qquad\ng(x)=\n\\begin{cases}\n\\sin x, \u0026 |x|\\le \\pi \\\\\n0, \u0026 \\text{otherwise}\n\\end{cases}\n$$\n\n### 5) Matrices + Determinants\n\n$$A=\\begin{bmatrix}1\u00262\u00263\\\\0\u00261\u00264\\\\5\u00266\u00260\\end{bmatrix}$$\n\n$$B=\\begin{pmatrix}a\u0026b\\\\c\u0026d\\end{pmatrix},\\quad \\det(B)=\\begin{vmatrix}a\u0026b\\\\c\u0026d\\end{vmatrix}=ad-bc$$\n\n$$\\operatorname{tr}(A)=1+1+0=2$$\n\n### 6) Calculus / Differential Equations\n\n$$\\frac{d}{dx}\\left(e^{x^2}\\right)=2x e^{x^2}$$\n\n$$\\frac{\\partial u}{\\partial t}=\\kappa \\frac{\\partial^2 u}{\\partial x^2}$$\n\n### 7) Number Theory / Logic\n\nCongruence: $a\\equiv b\\pmod n$\n\nPrime set: $\\mathbb{P}=\\{p\\in\\mathbb{N}:p\\text{ is prime}\\}$\n\nQuantifiers: $\\forall x\\in\\mathbb{R}\\ \\exists y\\in\\mathbb{R}: y\u003ex$\n\n### 8) Markdown + Math in same paragraph\n\nFor $x\u003e0$, define $h(x)=\\ln x$.\n\nThen $h'(x)=\\frac{1}{x}$, and by Taylor expansion near $x=1$: $$\\ln(1+u)=u-\\frac{u^2}{2}+\\frac{u^3}{3}-\\cdots,\\quad |u|\u003c1$$.\n\n### 9) TeX in fenced block (language tag only)\n\n$$\\left.\\frac{\\partial T}{\\partial P}\\right|_s=\\left.\\frac{\\partial v}{\\partial s}\\right|_P$$\n\n### 10) Edge Cases (should remain plain text)\n\nThe price is $19.99\necho \"Price: $100\"\n``const tpl = `$${amount}```\ncolor: $primary-color\nliteral $$ not a closed block\nliteral $x+1 without closing delimiter",
  "sig": "f61c1cd490ba9b4543554b610d2806be7fcb7b2b3d9dd5a89da5ae5e3ed49b2fd705423cf0a4e6d1012da9118dde1bf7b658f98e96df2af49c5257125513e994"
}