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 🙏

© 2026 – Pkg Stats / Ryan Hefner

xmmath

v1.0.9

Published

## 简介(introduction)

Readme

xmmath

简介(introduction)

苦 $\LaTeX$ 久矣!

Bitter $\LaTeX$ for a long time!

使用 $\LaTeX$ 输入数学公式,需要键入太多的\{}\frac{}{}。符号命名各种各样。

Using $\LaTeX$ to enter mathematical formulas, you need to type too many \, {} and \frac{}{}. There are all kinds of symbol names.

大家说,要有光,于是typst出现了!尽管他还很新,并且还没那么好,但他的数学输入还是很舒服的。

people said, "Let there be light," so typst appeared! Although he is still new and not that good, his math input is still very comfortable.

千呼万唤使出来,Chrome(>=109) 终于勉强支持部分在 Firefox 中早已支持的MathMl

After thousands of calls, Chrome (> = 109) finally reluctantly supported some of the MathMl already supported in Firefox.

为了在我的笔记软件xlinkote上更好地书写数学公式,我构建了这个 typst 数学语法转 MathMl 的库,并允许引用。

In order to better write mathematical formulas on my note-taking software xlinkote, I built this library of typst mathematical syntax to MathMl and allowed references.

安装(installation)

npm i xmmath
import * as xmmath from xmmath
console.log(xmmath.toMMLHTML("e^(i pi)=-1"))
<script src="./dist/xmmath.umd.js"></script>
<script>
    let div = document.createElement("div");
    div.innerHTML = xmmath.toMMLHTML("e^(i pi)=-1");
    document.body.append(div);
</script>

语法简介(introduction to Syntax)

详细语法请前往typst docs查看。很遗憾由于个人能力有限,只能实现部分语法,并且存在某些表现与 typst 不同。

For more details, please go to typst docs for more information. Unfortunately, due to the limited personal ability, only part of the grammar can be implemented, and some performance is different from that of typst.

  • 数学变量为单个英文字母

  • 函数为多个字母串,可包含.,后可接括号传递参数:sum gt.eq(显示符号) sqrt(2) root(2,4)

  • 字符串使用"包裹,可用\"转义

  • ^_为上下标,数字可连在一起:2^10/为除法,可用函数frac(1,2)。他们可用()消除歧义。

  • Mathematical variables are a single English letter.

  • the function is a string of letters and can contain ., followed by parentheses to pass the parameter: sum gt.eq (display symbol sqrt(2) root(2,4)).

  • string is wrapped with ", and can be escaped with \".

  • ^_is the superscript, and the numbers can be linked together: 2^10. / is division, and the function frac(1,2)is available. They can use ()to disambiguate.

实现的函数(Realized function)

  • [x] accent (不支持 size)
  • [x] attach
  • [x] cancel (仅支持 inverted 和 cross 参数)
  • [x] cases
  • [ ] class
  • [ ] equation
  • [x] frac
  • [x] lr
  • [x] mat
  • [x] primes
  • [x] op
  • [x] roots
  • [x] sizes
  • [x] styles
  • [x] underover
  • [x] variants
  • [x] vec
  • [x] \换行
  • [x] &
  • [x] Symbols
  • [x] 注释
  • [x] 对齐(mat 带逗号暂时不支持)
  • [ ] 变量 (不打算支持)

使用(use)

xmmath.toMMLHTML("e^(i pi)=-1"); // 输出html
xmmath.toMML("e^(i pi)=-1"); // 输出mathml元素
xmmath.init({
    emoji: true, // 默认false false:🇺🇳=>🇺 🇳 true:性能会降低slow 字符类型(string)不影响
});