This is a test file for writing mathematical formulas in #NostrMarkup

Silberengel

npub1l5sga6xg72phsz5422ykujprejwud075ggrr3z2hwyrfgr7eylqstegx9z

hex

2c42571d3bd3c2225ca2fa333ede2d0cf63b629904d0ba2d7091e7a0d8b088a2

nevent

nevent1qqszcsjhr5aa8s3ztj305ve7mcksea3mv2vsf59694cfreaqmzcg3gsprpmhxue69uhhyetvv9ujuem4d36kwatvw5hx6mm9qgs06gywary09qmcp2249ztwfq3ue8wxhl2yyp3c39thzp55plvj0sg4lvc06

naddr

naddr1qpz8g6rfwvkkjuedvykhgetnwskkv6tvv5kkvmmj94mhy6t5d9hxwttdv96xsetdv96xjcmpdskkvmmjd46kcctn945kuttwdaehgundv9exkatsqyv8wumn8ghj7un9d3shjtn8w4k82em4d36jumt0v5pzplfq3m5v3u5r0q9f255fdeyz8nyac6lagssx8zy4wugxjs8ajf7pqvzqqqr4gun7qtz2

Kind-30023 (Article)

2026-04-01T12:04:36Z

This is a test file for writing mathematical formulas in #NostrMarkup

This document demonstrates rendering formulas in TeX/LaTeX notation. It is intended for clients that render TeX with KaTeX/MathJax-style delimiters. If you want the entire document to be treated as math, put it in a dedicated math/code block. In general, it is better to keep prose as prose and only mark formulas as math. The general rule is:

  • Inline math: $...$
  • Display math: $$...$$ (on its own line)

TeX Examples

Inline equation: $E=mc^2$ Same equation in display mode: $$E=mc^2$$ Something more complex, inline: $\sqrt{x^2+1}$ and $\sqrt[3]{27}$ Something complex, in display mode: $$P \left( A=2 \,\middle|\, \dfrac{A^2}{B}>4 \right)$$ Another example: $$\prod_{i=1}^{n} x_i - 1$$ Function example:

$$
f(x)=
\begin{cases}
\frac{1}{d_{ij}} & \quad \text{when } d_{ij} \leq 160 \\
0 & \quad \text{otherwise}
\end{cases}
$$
And a matrix:

$$
M =
\begin{bmatrix}
\frac{5}{6} & \frac{1}{6} & 0 \\[0.3em]
\frac{5}{6} & 0 & \frac{1}{6} \\[0.3em]
0 & \frac{5}{6} & \frac{1}{6}
\end{bmatrix}
$$
Greek letters are a snap: $\Psi$, $\psi$, $\Phi$, $\phi$.

Equations within text are easy — a well-known Maxwell thermodynamic relation is $\left.\frac{\partial T}{\partial P}\right|_{s} = \left.\frac{\partial v}{\partial s}\right|_{P}$.

Using the quadratic formula, the roots of $x^2-6x+4=0$ are:

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

$$x = \frac{6 \pm \sqrt{20}}{2}$$

$$x \approx 0.8 \text{ or } 5.2$$

to 1 decimal place: $$x \approx 0.8 \text{ or } 5.2$$.

Advanced alignment and matrices:

A $3 \times 3$ matrix:

$$\begin{pmatrix}1&2&3\\4&5&6\\7&8&9\end{pmatrix}$$

and a $2 \times 1$ vector:

$$\begin{pmatrix}1\\0\end{pmatrix}$$

Determinant example:

$$\begin{vmatrix}a&b\\c&d\end{vmatrix}=ad-bc$$

A general $m \times n$ matrix:

$$\begin{pmatrix} a_{11} & \cdots & a_{1n}\\ \vdots & \ddots & \vdots\\ a_{m1} & \cdots & a_{mn} \end{pmatrix}$$

Mixed Examples
LaTeX inline: $\frac{1}{2}$
LaTeX display: $$\sum_{i=1}^n x_i$$
LaTeX matrix: $$\begin{pmatrix} a & b \\ c & d \end{pmatrix}$$
Edge Cases
Empty math: $$
Just delimiters: $ $
Dollar signs in text: The price is $10.50
Currency: $19.99
Shell command: echo "Price: $100"
JavaScript template: ``const price = `$${amount}```
CSS with dollar signs: color: $primary-color
This document demonstrates that LaTeX is processed correctly with standard math delimiters.

原始 JSON

{
  "kind": 30023,
  "id": "2c42571d3bd3c2225ca2fa333ede2d0cf63b629904d0ba2d7091e7a0d8b088a2",
  "pubkey": "fd208ee8c8f283780a9552896e4823cc9dc6bfd442063889577106940fd927c1",
  "created_at": 1775045076,
  "tags": [
    [
      "t",
      "test"
    ],
    [
      "t",
      "TeX"
    ],
    [
      "t",
      "LaTeX"
    ],
    [
      "d",
      "this-is-a-test-file-for-writing-mathematical-formulas-in-nostrmarkup"
    ],
    [
      "title",
      "This is a test file for writing mathematical formulas in #NostrMarkup"
    ],
    [
      "client",
      "jumble"
    ],
    [
      "alt",
      "This event was published by https://jumble.imwald.eu."
    ]
  ],
  "content": "# This is a test file for writing mathematical formulas in #NostrMarkup\nThis document demonstrates rendering formulas in TeX/LaTeX notation. It is intended for clients that render TeX with KaTeX/MathJax-style delimiters.\nIf you want the entire document to be treated as math, put it in a dedicated math/code block. In general, it is better to keep prose as prose and only mark formulas as math.\nThe general rule is:\n- Inline math: `$...$`\n- Display math: `$$...$$` (on its own line)\n## TeX Examples\nInline equation: `$E=mc^2$`\nSame equation in display mode: `$$E=mc^2$$`\nSomething more complex, inline: `$\\sqrt{x^2+1}$` and `$\\sqrt[3]{27}$`\nSomething complex, in display mode: `$$P \\left( A=2 \\,\\middle|\\, \\dfrac{A^2}{B}\u003e4 \\right)$$`\nAnother example: `$$\\prod_{i=1}^{n} x_i - 1$$`\nFunction example:\n```latex\n$$\nf(x)=\n\\begin{cases}\n\\frac{1}{d_{ij}} \u0026 \\quad \\text{when } d_{ij} \\leq 160 \\\\\n0 \u0026 \\quad \\text{otherwise}\n\\end{cases}\n$$\nAnd a matrix:\n\n$$\nM =\n\\begin{bmatrix}\n\\frac{5}{6} \u0026 \\frac{1}{6} \u0026 0 \\\\[0.3em]\n\\frac{5}{6} \u0026 0 \u0026 \\frac{1}{6} \\\\[0.3em]\n0 \u0026 \\frac{5}{6} \u0026 \\frac{1}{6}\n\\end{bmatrix}\n$$\nGreek letters are a snap: $\\Psi$, $\\psi$, $\\Phi$, $\\phi$.\n\nEquations within text are easy — a well-known Maxwell thermodynamic relation is $\\left.\\frac{\\partial T}{\\partial P}\\right|_{s} = \\left.\\frac{\\partial v}{\\partial s}\\right|_{P}$.\n\nUsing the quadratic formula, the roots of $x^2-6x+4=0$ are:\n\n$$x = \\frac{6 \\pm \\sqrt{36-16}}{2}$$\n\n$$x = \\frac{6 \\pm \\sqrt{20}}{2}$$\n\n$$x \\approx 0.8 \\text{ or } 5.2$$\n\nto 1 decimal place: $$x \\approx 0.8 \\text{ or } 5.2$$.\n\nAdvanced alignment and matrices:\n\nA $3 \\times 3$ matrix:\n\n$$\\begin{pmatrix}1\u00262\u00263\\\\4\u00265\u00266\\\\7\u00268\u00269\\end{pmatrix}$$\n\nand a $2 \\times 1$ vector:\n\n$$\\begin{pmatrix}1\\\\0\\end{pmatrix}$$\n\nDeterminant example:\n\n$$\\begin{vmatrix}a\u0026b\\\\c\u0026d\\end{vmatrix}=ad-bc$$\n\nA general $m \\times n$ matrix:\n\n$$\\begin{pmatrix} a_{11} \u0026 \\cdots \u0026 a_{1n}\\\\ \\vdots \u0026 \\ddots \u0026 \\vdots\\\\ a_{m1} \u0026 \\cdots \u0026 a_{mn} \\end{pmatrix}$$\n\nMixed Examples\nLaTeX inline: $\\frac{1}{2}$\nLaTeX display: $$\\sum_{i=1}^n x_i$$\nLaTeX matrix: $$\\begin{pmatrix} a \u0026 b \\\\ c \u0026 d \\end{pmatrix}$$\nEdge Cases\nEmpty math: $$\nJust delimiters: $ $\nDollar signs in text: The price is $10.50\nCurrency: $19.99\nShell command: echo \"Price: $100\"\nJavaScript template: ``const price = `$${amount}```\nCSS with dollar signs: color: $primary-color\nThis document demonstrates that LaTeX is processed correctly with standard math delimiters.",
  "sig": "9cb32ddadae842eb8a43507c7881211443944778b443755d78fc620e8b17eced38b486e4e915507a3d3c23f4e936adf0a7751ec6035e04a64ca984c2f1229fb0"
}