diff --git a/README.md b/README.md index ff750ad..a804fe3 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/lib/filter.js b/lib/filter.js index 4b12129..155874e 100644 --- a/lib/filter.js +++ b/lib/filter.js @@ -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) { @@ -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,