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

@pretextbook/latex-style-pretext

v0.5.0

Published

Editor intelligence (completions + validation) for LaTeX-style PreTeXt documents

Downloads

961

Readme

@pretextbook/latex-style-pretext

Editor intelligence for LaTeX-style PreTeXt — LaTeX source that converts to PreTeXt via @pretextbook/unified-latex-to-pretext.

This package is platform-agnostic and returns LSP-shaped values (vscode-languageserver-types), so it can be consumed both by the VS Code extension's LSP server (Node) and by the Monaco editor in pretext-plus-editor (browser). It ships raw TypeScript with no build step, following the @pretextbook/completions precedent.

What's here

| Module | Purpose | | -------------- | ------------------------------------------------------------------------------- | | data/ | Curated tables of the environments and macros the PreTeXt conversion supports | | scan/ | Lightweight linear document scanner (math regions, env stack, labels, comments) | | completions/ | Completion engine (Phase 2) | | lint/ | Diagnostics engine (Phase 3) | | clean/ | Legacy-LaTeX cleanup rules, shared with @pretextbook/import |

Keeping the tables in sync with the converter

The curated tables in data/ mirror what @pretextbook/unified-latex-to-pretext will actually convert. Two guards keep them honest, in opposite directions:

  • converter-drift.spec.ts converts a usage of every curated entry and fails if the converter no longer recognizes it — this catches support being removed or renamed.
  • converter-coverage.spec.ts compares the tables against data/converter-support.json and fails if the converter supports something the tables lack — this catches support being added.

converter-support.json is generated, never hand-edited:

npm run refresh:latex-support     # regenerate from the installed converter
npm run check:latex-support       # fail if it is stale (CI runs this)

The snapshot has two halves, because the converter only exports half its surface:

  • environments / macros / plusMacros / plusTypes come from the records the converter exports, complete with argument signatures.
  • probedMacros / probedEnvironments are discovered by converting \name{x} and \begin{name}…\end{name} for every PreTeXt element name in the schema, because ordinary LaTeX and PreTeXt inline markup (\alert, \q, …) are handled through internal tables the converter does not export.

To update after bumping the converter: run npm run refresh:latex-support, then npm run test -w @pretextbook/latex-style-pretext. The coverage spec names every entry that needs adding; the drift spec names every entry that needs removing or promoting out of KNOWN_UNCONVERTED.