Nested Public Modules

# npm

## eleventy-plugin-mathjax

2.0.4 • Public • Published

# eleventy-plugin-mathjax

Eleventy plugin for server-side MathJax rendering.

## Installation

npm install eleventy-plugin-mathjax --save-dev
const mathjaxPlugin = require("eleventy-plugin-mathjax");

module.exports = function (eleventyConfig) {
};

## Usage

Use $...$ for inline equations, $$...$$ for block equations, and \$ for escaping the dollar sign. MathJax-style $$...$$ and $...$ are also supported, but see below for caveat. ### Caveat In Markdown files, $$, $ and \ need to be written as \\\(, \\\[ and \\ respectively. This is due to that the plugin operates on the generated HTML, not directly on the source file. Latex commands which start with a symbol (e.g. \_, \,, \{, \<) also need to be escaped. Alternatively, wrapping the latex code inside a html tag will stop the Markdown engine from processing the text, eliminating the need for extra escaping. ### Example This is a \TeX example. 1 + 1 = 2 Equivalent to: This is a \\\( \TeX \\$$ example. \\\[ 1 + 1 = 2 \\$ Alternatively, write <p> This is a $$\TeX$$ example. $1 + 1 = 2$ </p> This is a dollar sign \\$.

<p>This is also a dollar sign \$.</p> ## Options Optionally pass in an options object as the second argument to addPlugin to further customize this plugin. For example, to use the CommonHTML output format instead of SVG: eleventyConfig.addPlugin(mathjaxPlugin, { output: "chtml", chtml: { fontURL: "https://cdn.jsdelivr.net/npm/mathjax@3/es5/output/chtml/fonts/woff-v2", }, }); ### Supported Fields #### output Output format for math equations. Supports "svg" and "chtml". Defaults to "svg". #### tex Options for MathJaX's TeX input processor. Defaults to: { packages: /* all packages */, inlineMath: [ ["$", "\$"],
["\$$", "\$$"],
],
}

See here for full options.

#### svg

Options for MathJaX's SVG output processor.

Defaults to:

{
fontCache: "global",
}

See here for full options.

#### chtml

Options for MathJaX's CommonHTML output processor. Defaults to {}.

See here for full options.

Options for MathJaX's lite DOM adaptor. Useful for passing size hints to MathJaX, e.g. { fontSize: 18 }. Defaults to {}.

See here for full options.

## Keywords

### Install

npm i eleventy-plugin-mathjax

### Repository

github.com/tsung-ju/eleventy-plugin-mathjax

8

2.0.4
{"ft_lang_label":"__label__en","ft_lang_prob":0.56759816,"math_prob":0.6095676,"size":2139,"snap":"2022-27-2022-33","text_gpt3_token_len":581,"char_repetition_ratio":0.12037471,"word_repetition_ratio":0.04587156,"special_character_ratio":0.2912576,"punctuation_ratio":0.22921914,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.96374327,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-07-05T09:24:55Z\",\"WARC-Record-ID\":\"<urn:uuid:8d053424-f723-4776-9f85-5df1b14c7720>\",\"Content-Length\":\"67155\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:b34f2db7-1b90-47a6-a4a4-0817f793d4c1>\",\"WARC-Concurrent-To\":\"<urn:uuid:0fb1c915-5932-4fb2-89b6-2beb9b19e54e>\",\"WARC-IP-Address\":\"104.16.93.83\",\"WARC-Target-URI\":\"https://www.npmjs.com/package/eleventy-plugin-mathjax\",\"WARC-Payload-Digest\":\"sha1:FJVDO2ZGCQZ77ME3ZMQIE4LVRBHGN6T5\",\"WARC-Block-Digest\":\"sha1:TPLT3CSBNZRX7PVAVPJ5P7G4UH2IJCUV\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-27/CC-MAIN-2022-27_segments_1656104542759.82_warc_CC-MAIN-20220705083545-20220705113545-00622.warc.gz\"}"}