@types/katex
- Version 0.16.7
- Published
- 10.1 kB
- No dependencies
- MIT license
Install
npm i @types/katexyarn add @types/katexpnpm add @types/katexOverview
TypeScript definitions for katex
Index
Functions
function render
render: (tex: string, element: HTMLElement, options?: KatexOptions) => void;Renders a TeX expression into the specified DOM element
Parameter tex
A TeX expression
Parameter element
The DOM element to render into
Parameter options
KaTeX options
function renderToString
renderToString: (tex: string, options?: KatexOptions) => string;Renders a TeX expression into an HTML string
Parameter tex
A TeX expression
Parameter options
KaTeX options
Classes
class ParseError
class ParseError implements Error {}KaTeX error, usually during parsing.
constructor
constructor(message: string, lexer: any, position: number);property message
message: string;property name
name: string;property position
position: number;Interfaces
interface KatexOptions
interface KatexOptions {}Documentation: https://katex.org/docs/options.html
property colorIsTextColor
colorIsTextColor?: boolean | undefined;If
true,\colorwill work like LaTeX's\textcolorand takes 2 argumentsIf
false,\colorwill work like LaTeX's\colorand takes 1 argumentIn both cases,
\textcolorworks as in LaTeXfalse
property displayMode
displayMode?: boolean | undefined;If
true, math will be rendered in display mode (math in display style and center math on page)If
false, math will be rendered in inline mode false
property errorColor
errorColor?: string | undefined;A Color string given in format
#XXXor#XXXXXX
property fleqn
fleqn?: boolean | undefined;If
true, display math renders flush left with a 2em left margin, like \documentclass[fleqn] in LaTeX with the amsmath package.false
property globalGroup
globalGroup?: boolean | undefined;Place KaTeX code in the global group.
false
property leqno
leqno?: boolean | undefined;If
true, display math has \tags rendered on the left instead of the right, like \usepackage[leqno]{amsmath} in LaTeX.false
property macros
macros?: any;A collection of custom macros.
See
src/macros.jsfor its usage
property maxExpand
maxExpand?: number | undefined;Limit the number of macro expansions to specified number
If set to
Infinity, marco expander will try to fully expand as in LaTex1000
property maxSize
maxSize?: number | undefined;All user-specified sizes will be caped to
maxSizeemsIf set to Infinity, users can make elements and space arbitrarily large
Infinity
property minRuleThickness
minRuleThickness?: number | undefined;Specifies a minimum thickness, in ems, for fraction lines, \sqrt top lines, {array} vertical lines, \hline, \hdashline, \underline, \overline, and the borders of \fbox, \boxed, and \fcolorbox.
property output
output?: 'html' | 'mathml' | 'htmlAndMathml' | undefined;Determines the markup language of the output. The valid choices are: -
html: Outputs KaTeX in HTML only. -mathml: Outputs KaTeX in MathML only. -htmlAndMathml: Outputs HTML for visual rendering and includes MathML for accessibility.'htmlAndMathml'
property strict
strict?: boolean | string | Function | undefined;If
falseor"ignore", allow features that make writing in LaTex convenient but not supported by LaTexIf
trueor"error", throw an error for such transgressionsIf
"warn", warn about behavior viaconsole.warn"warn"
property throwOnError
throwOnError?: boolean | undefined;If
true, KaTeX will throw aParseErrorwhen it encounters an unsupported command or invalid LaTexIf
false, KaTeX will render unsupported commands as text, and render invalid LaTeX as its source code with hover text giving the error, in color given by errorColor true
property trust
trust?: boolean | ((context: TrustContext) => boolean) | undefined;If
false(do not trust input), prevent any commands that could enable adverse behavior, rendering them instead in errorColor.If
true(trust input), allow all such commands.false
interface TrustContext
interface TrustContext {}Package Files (1)
Dependencies (0)
No dependencies.
Dev Dependencies (0)
No dev dependencies.
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/katex.
- Markdown[](https://www.jsdocs.io/package/@types/katex)
- HTML<a href="https://www.jsdocs.io/package/@types/katex"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 3009 ms. - Missing or incorrect documentation? Open an issue for this package.
