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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@zenml/zotica

v1.1.0

Published

Web rendering engine for mathematical formulae

Downloads

8

Readme

Overview

Zotica (named after the Greek word “ζωτικά”) is a markup language that can describe mathematical expressions in a ZenML-like syntax. By passing mathematical markups through a processor, they are converted into HTML elements, which can be rendered on a web page using special CSS and JavaScript. It aims to provide the same quality of mathematical expressions as TeX, and to prevent the output HTML from becoming obfuscated.

There are already several engines for displaying mathematical expressions in the browser, such as MathJax and KaTeX. The main differences to these engines are the following three points:

  • The font is inherited from the outer text (except for symbols) so that mathematical expressions are not unnecessarily conspicuous from the main text
  • The structure of the output HTML is relatively simple
  • The spacing between elements can be easily adjuste dby simply overriding CSS

If you are interested in how mathematical expressions are rendered, see the rendering test page.

This package provides a Zotica processor and a plugin for a ZenML parser that allows you to embed Zotica expressions in your ZenML documents.

This is a part of the ZenML infrastructure.

Installation

Install via npm.

npm i @zenml/zotica

About the math font

The math font used in Zotica is a modified version of STIX Two Math (version 2.00 b137) for use in HTML. It is available here and you are free to use it under the SIL Open Font License. You can also obtain the same font by making the following modifications to the original font:

First, in order to give special codepoints to the additionally registered glyphs (.notdefzeroinferior.per), copy these glyphs to U+F0000–U+F04DB. The codepoints mentioned below will be those after the copy.

As some of the large operators are displayed slightly higher without modification, move the glyphs at U+F0187–U+F018A and U+F0214–U+F021D downward by 540.

In order to display the radical symbols correctly without CSS adjustment, it is necessary to change the position of the glyphs for radical symbols. Move the glyphs at U+F011D, U+F011E, U+F011F downward by 667, 1183, 1704 respectively.

To save the repositioned accent symbols to different codepoints, first copy the glyphs U+0300–U+036F and U+20D0–U+20FF to U+F0500–U+F056F and U+F0570–U+F059F respectively. Then for each glyph copied, set the X coordinate of the left edge of the glyph to 0, and set the character width to match the glyph width. For example, move the whole glyph at U+F0500 to the right by 338 and set the character width to 162.

Implementation notes (for my future self)

builder.tsdata.ts の型定義部分に | string が書かれている箇所がいくつかありますが、これは厳密な型チェックの実装を後回しにしてとりあえずコンパイルが通るようにするための暫定的な記述です。 将来的には、厳密な型チェックを実装するなり、設計を見直すなりして、| string は削除すべきです。