Socket
Socket
Sign inDemoInstall

magicbook-katex

Package Overview
Dependencies
25
Maintainers
3
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    magicbook-katex

Katex plugin for magicbook


Version published
Weekly downloads
5
increased by400%
Maintainers
3
Created
Weekly downloads
 

Readme

Source

Magicbook katex

This plugin allows you to write math equations via latex math expressions and automatically render them in the browser with the Katex math library and in PDF as straight up MathML. We chose to use Katex over Mathjax as it's faster, smaller, and supports bundling alongside other libraries.

Using the plugin

First install the NPM package, either in your package.json file in your book repo, or by running the following.

npm i magicbook-katex

Just add the plugin to your config.

{
  "addPlugins" : ["magicbook-katex"]
}

Then write some content with math markup. Here's an example with an inline and block math equations in your markdown.

This is an inline equation: $$5 + 5$$. The following is a block equation:

$$
5 + 5
$$

If you're writing in HTML, the same file would look like this:

<p>This is an inline equation: <span data-type="equation">5 + 5</span>. The following is a block equation:</p>

<div data-type="equation">
5 + 5
</div>

The required JavaScript, stylesheets and fonts will automatically be added to the build assets during the build process.

Keywords

FAQs

Last updated on 12 Jul 2023

Did you know?

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc