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

textlint-rule-punctuation-end-of-equation

v1.1.0

Published

Textlint rule to enforce punctuation at the end of LaTeX math environments

Readme

textlint-rule-punctuation-end-of-equation

A textlint rule to enforce punctuation at the end of LaTeX math environments in academic writing.

Installation

From npm (when published)

npm install textlint-rule-punctuation-end-of-equation

Local development/usage

  1. Clone and build the rule:

    git clone <this-repo>
    cd period-endof-equation
    pnpm install
    pnpm run build
  2. Install textlint globally:

    npm install -g textlint
  3. Link the rule locally:

    # In the rule directory
    npm link
       
    # In your document directory
    npm link textlint-rule-punctuation-end-of-equation
  4. Create a .textlintrc file in your document directory:

    {
      "plugins": ["@textlint/markdown"],
      "rules": {
        "punctuation-end-of-equation": true
      }
    }
  5. Run textlint on your documents:

    # Check a single file
    textlint your-document.md
       
    # Check and auto-fix
    textlint --fix your-document.md
       
    # Check all markdown files
    textlint "**/*.md"

Configuration Options

You can customize which math environments and punctuation marks to check:

{
  "rules": {
    "punctuation-end-of-equation": {
      "allowedMathEnvironments": ["equation", "align", "gather", "multline"],
      "allowedPunctuation": [".", ",", ";", "!", "?"]
    }
  }
}

Options

  • allowedMathEnvironments (default: ["equation", "align", "gather", "multline", "split", "eqnarray"]): LaTeX math environments to check
  • allowedPunctuation (default: [".", ",", ";", "!", "?"]): Punctuation marks considered valid at the end of equations

Alternative: Direct usage without global installation

If you prefer not to install textlint globally:

  1. Install textlint locally in your document project:

    # In your document directory
    npm init -y
    npm install textlint @textlint/textlint-plugin-markdown
    npm link textlint-rule-punctuation-end-of-equation
  2. Add scripts to your package.json:

    {
      "scripts": {
        "lint": "textlint *.md",
        "lint:fix": "textlint --fix *.md"
      }
    }
  3. Run with npm:

    npm run lint
    npm run lint:fix

What it checks

This rule enforces punctuation at the end of LaTeX math environments:

  • Display math: $$...$$
  • Display math: \[...\]
  • Environment-based math: \begin{equation}...\end{equation}, \begin{align}...\end{align}, etc.

Valid examples

This is correct: $$x = y + z.$$

With comma: $$f(x) = x^2,$$

With semicolon: \[a = b + c;\]

\begin{equation}
E = mc^2.
\end{equation}

\begin{align}
x &= y + z, \\
a &= b + c.
\end{align}

Invalid examples

This is wrong: $$x = y + z$$

Another wrong example: \[a = b + c\]

\begin{equation}
E = mc^2
\end{equation}

Development

# Install dependencies
npm install

# Build
npm run build

# Run tests
npm test

# Lint
npm run lint

License

MIT