Skip to content

FurqanSoftware/goldmark-katex

Repository files navigation

Goldmark Katex

Go Reference

Goldmark Katex is a Goldmark extension providing math and equation support through KaTeX.

Usage

// Default, errors are highlighted in red in the output
goldmark.New(goldmark.WithExtensions(&katex.Extender{})).Convert(src, dst)

// With ThrowOnError set to true
goldmark.New(goldmark.WithExtensions(&katex.Extender{
    ThrowOnError: true,
})).Convert(src, dst)

Wrap inline math with a pair of single $:

$A$

Wrap block math with a pair of double $:

$$
A = \pi \times r^2
$$

Example

Given the radius $r$ of a circle, the area $A$ is:

$$
A = \pi \times r^2
$$

And the circumference $C$ is:

$$
C = 2 \pi r
$$

More Goldmark Extensions

  • D2: diagram support through D2

About

Goldmark extension for math and equations

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors