Skip to content

Commit

Permalink
Add support for extra packages
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang committed Jul 28, 2022
1 parent 8809c8a commit c752ffa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ mathjax:
normal_width: 0.6 # relative normal (monospace) width
append_css: true # add CSS to pages rendered by MathJax
every_page: false # if true, every page will be rendered by MathJax regardless the `mathjax` setting in Front-matter
packages: # extra packages to load
extension_options: {}
# you can put your extension options here
# see http://docs.mathjax.org/en/latest/options/input/tex.html#tex-extension-options for more detail
Expand Down
5 changes: 4 additions & 1 deletion lib/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const { SVG } = require('mathjax-full/js/output/svg.js');
const { LiteAdaptor } = require('mathjax-full/js/adaptors/liteAdaptor.js');
const { RegisterHTMLHandler } = require('mathjax-full/js/handlers/html.js');

const { AllPackages } = require('mathjax-full/js/input/tex/AllPackages.js');
let { AllPackages } = require('mathjax-full/js/input/tex/AllPackages.js');

module.exports = function(config) {

Expand All @@ -26,6 +26,9 @@ module.exports = function(config) {
//
// Create input and output jax and a document using them on the content from the HTML file
//
if (Array.isArray(config.packages)) {
AllPackages = AllPackages.concat(config.packages);
}
const tex = new TeX(Object.assign({
packages : AllPackages,
tags : config.tags,
Expand Down

0 comments on commit c752ffa

Please sign in to comment.