npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

math-in-markdown-test

v1.1.5

Published

Tests math expression support in Markdown documents

Readme

Math in Markdown - rendering tests

NPM package MIT license

This document tests math expression support in the Markdown renderers of VS Code, GitHub, and npmjs.com.

Simple Unicode

  • Normal font (√(x²+1)) ⟶ √(x²+1)
  • Italic (_√(x²+1)_) ⟶ √(x²+1)
  • Bold (**√(x²+1)**) ⟶ √(x²+1)
  • Code (`√(x²+1)`) ⟶ √(x²+1)

Conclusion: Works everywhere.

HTML superscript

  • √(x<sup>2</sup>+1) ⟶ √(x2+1)

Conclusion: Works everywhere.

R Markdown superscript

https://rmarkdown.rstudio.com/authoring_basics.html

  • √(x^2^+1) ⟶ √(x^2^+1)

Conclusion: Proprietary syntax; unsupported by VS Code, GitHub, and npmjs.

Inline equations ($...$)

  • $√(x²+1)$ ⟶ $√(x²+1)$
  • $\sqrt{x^2+1}$ ⟶ $\sqrt{x^2+1}$
  • $\frac{1}{2}$ ⟶ $\frac{1}{2}$
  • $ℚ \subset \mathbb{R}$ ⟶ $ℚ \subset \mathbb{R}$
  • $\begin{bmatrix}1 & 3\end{bmatrix}^T$ ⟶ $\begin{bmatrix}1 & 3\end{bmatrix}^T$

Conclusion: Simple expressions work in VS Code and GitHub with minor vertical alignment issues on the latter. The way GitHub renders \mathbb works in Safari but not in Chrome. It fails to parse matrices unless they're between $` `$ delimiters.

Discussion: Stack Overflow

Inline equations, GitHub style ($`...`$)

https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/writing-mathematical-expressions

  • $`\sqrt{x²+1}`$ ⟶ $\sqrt{x²+1}$
  • $`ℚ \subset \mathbb{R}`$ ⟶ $ℚ \subset \mathbb{R}$
  • $`\begin{bmatrix}1 & 3\end{bmatrix}^T`$ ⟶ $\begin{bmatrix}1 & 3\end{bmatrix}^T$

Conclusion: Works only on GitHub. VS Code renders the backticks literally. npmjs does not support it at all.

Block equations ($$...$$)

$$\frac{x+1}{2}$$

$$\frac{x+1}{2}$$

$$ \frac{x+1}{2} $$

$$ \frac{x+1}{2} $$

$$\frac{x+1}{2}$$ (no blank line before expression) $$\frac{x+1}{2}$$

Conclusion: Works in VS Code. On GitHub, a blank line is required before the equation. Not supported on npmjs.

Math blocks (```math)

```math
\sqrt{x^2+1}
```
\sqrt{x^2+1}

Aligned equations

```math
\begin{aligned}
  x+1 &= y \\
  x &= y-1
\end{aligned}
```
\begin{aligned}
  x+1 &= y \\
  x &= y-1
\end{aligned}

Conclusion: Simple expressions render correctly in both VS Code and GitHub. GitHub struggles with aligned equations.

MathML

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
  <mi>x</mi>
  <mo>=</mo>
  <mfrac>
    <mrow>
      <mrow>
        <mo>-</mo>
        <mi>b</mi>
      </mrow>
      <mo>±</mo>
      <msqrt>
        <mrow>
          <msup>
            <mi>b</mi>
            <mn>2</mn>
          </msup>
          <mo>-</mo>
          <mrow>
            <mn>4</mn>
            <mo>⁢</mo>
            <mi>a</mi>
            <mo>⁢</mo>
            <mi>c</mi>
          </mrow>
        </mrow>
      </msqrt>
    </mrow>
    <mrow>
      <mn>2</mn>
      <mo>⁢</mo>
      <mi>a</mi>
    </mrow>
  </mfrac>
</mrow>
</math>

Conclusion: Only works in VS Code.

CodeCogs

The expressions below are SVGs created with the CodeCogs equation editor and embedded from latex.codecogs.com.

  • Inline formula: inline formula
  • Inline fraction: inline fraction
  • Vertical centering with <span style="vertical-align: middle">: inline fraction

Conclusion: Works, but vertical alignment is often off. GitHub and npmjs don’t allow fine-tuning with CSS.