Socket
Book a DemoInstallSign in
Socket

@amermathsoc/mathjax-href

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@amermathsoc/mathjax-href

A custom href extension for MathJax's TeX input

5.1.1
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

mathjax-xhref

A custom href extension for MathJax's TeX input

MathJax Extension: xhref.js

This extension implements a TeX macro \xhref.

\xhref[type]{url}{content}

In the output, this will generate <a href="url" data-ams-ref="type">content</a> with 5px padding.

This macro integrates with AmerMathSoc/texml-to-html; see its documentation for more information on data-ams-ref.

Using NodeJS

For example, install @mathjax/src and @amermathsoc/mathjax-xhref and use something like

import { TeX } from "@mathjax/src/js/input/tex.js";
import { configuration as xhref } from "mathjax-xhref";
const tex = new TeX({
  packages: [xhref.name],
  textmacros: {
    packages: { "[+]": [xhref.name] },
  },
});

Note: the textmacros part allows the use of this macro in text-mode.

Using a browser

For client-side use, you need load browser/xhref.js, e.g., from a CDN.

Follow the instructions from the MathJax documentation on loading a third-party extensions, e.g.,

MathJax = {
  loader: {
    load: ["[xhref]/xhref.js"],
    paths: {
      xhref:
        "https://cdn.jsdelivr.net/npm/@amermathsoc/mathjax-xhref@3/browser",
    },
  },
  tex: {
    packages: { "[+]": ["xhref"] },
    textmacros: {
      packages: { "[+]": ["xhref"] },
    },
  },
};

Keywords

MathJax

FAQs

Package last updated on 18 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.