Skip to main content

Built and signed on GitHub Actions

Adds support for TeX (math) syntax to Eleventy projects

This package works with Node.js, Deno, Bun
This package works with Node.js
This package works with Deno
This package works with Bun
JSR Score
100%
Published
3 weeks ago (0.1.2)
type alias KaTeXOptions

An options object for parsing & rendering KaTeX. See the KaTeX docs for more info.

Properties

Whether or not to render in display mode. Defaults to false.

optional
output:
"html"
| "mathml"
| "htmlAndMathml"

Defines the output language, defaults to mathml; this differs from the default KaTeX has!

optional
leqno: boolean

Stands for "left equation numbers". Puts the label on the left when using numbered equations. Off by default.

optional
fleqn: boolean

"Flush left equations": renders display math left-aligned.

When parsing, throw instead of rendering an errored-out equation. Off by default; note that this differs from the KaTeX default!

A hex color (either three or six digits) to use when rendering an error. Defaults to #cc0000.

optional
macros: Record<string, string>

A collection of custom macros. Note that this object can be modifier by documents using e.g. \gdef. Does not come with macros by default.

A minimum thickness for "rules", e.g. the line in a fraction.

optional
maxSize: number

Caps user-specified sizes. Infinity by default, meaning there is no limit.

Limits the number of macro expansions to prevent infinite loops. Set to Infinity if you dare. Defaults to 1000.

optional
strict:
boolean
| string
| ((...args: unknown[]) => unknown)

Defines what should throw errors. Defaults to "warn", meaning it tries to help you conform to LaTeX-style TeX.

optional
trust: boolean | ((...args: unknown[]) => unknown)

Whether or not to trust user input. false by default.

Run KaTeX code in the global group. false by default, to align with LaTeX.

Add Package

deno add jsr:@vrugtehagel/eleventy-tex

Import symbol

import { type KaTeXOptions } from "@vrugtehagel/eleventy-tex";

---- OR ----

Import directly with a jsr specifier

import { type KaTeXOptions } from "jsr:@vrugtehagel/eleventy-tex";

Add Package

npx jsr add @vrugtehagel/eleventy-tex

Import symbol

import { type KaTeXOptions } from "@vrugtehagel/eleventy-tex";

Add Package

yarn dlx jsr add @vrugtehagel/eleventy-tex

Import symbol

import { type KaTeXOptions } from "@vrugtehagel/eleventy-tex";

Add Package

pnpm dlx jsr add @vrugtehagel/eleventy-tex

Import symbol

import { type KaTeXOptions } from "@vrugtehagel/eleventy-tex";

Add Package

bunx jsr add @vrugtehagel/eleventy-tex

Import symbol

import { type KaTeXOptions } from "@vrugtehagel/eleventy-tex";