diff --git a/README.md b/README.md index ed0e11c8..63a398fc 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ of calling the MathJax API. Use - npm install https://github.com/mathjax/MathJax-node/tarball/master + npm install MathJax-node to install MathJax-node and its dependencies. diff --git a/batik/README.md b/batik/README.md index e4ea519a..31eef190 100644 --- a/batik/README.md +++ b/batik/README.md @@ -2,4 +2,6 @@ If you intend to use MathJax-node's ability to create PNG images, you should install [batik](http://xmlgraphics.apache.org/batik/download.html) in this directory. Just download it and unpack it here. You need `batik-rasterizer.jar` and the `lib` directory to be in the top level -of this directory. +of this directory. Since Batik v1.8 you have to either create a symlink +to `batik-rasterizer-1.8.jar` or change `mj-page.js` and `mj-single.js` +to point to the version-specific file name. diff --git a/bin/am2mml b/bin/am2mml index 1ebcc0ec..71bcd43c 100755 --- a/bin/am2mml +++ b/bin/am2mml @@ -43,6 +43,10 @@ var argv = require("yargs") semantics: { boolean: true, describe: "add AsciiMath code in tag" + }, + extensions: { + default: "", + describe: "extra MathJax extensions e.g. 'Safe,TeX/noUndefined'" } }) .argv; @@ -52,7 +56,8 @@ mjAPI.config({ menuSettings: { semantics: argv.semantics } - } + }, + extensions: argv.extensions }); mjAPI.start(); diff --git a/bin/am2png b/bin/am2png index 43324ff7..0328d6c4 100755 --- a/bin/am2png +++ b/bin/am2png @@ -34,8 +34,8 @@ var argv = require("yargs") describe: "perform automatic line-breaking" }, dpi: { - default: 144, - describe: "dpi for image" + default: 0, + describe: "dpi for image (0 = calculate automatically)" }, font: { default: "TeX", @@ -48,14 +48,20 @@ var argv = require("yargs") width: { default: 100, describe: "width of container in ex" + }, + extensions: { + default: "", + describe: "extra MathJax extensions e.g. 'Safe,TeX/noUndefined'" } }) .argv; if (argv.font === "STIX") argv.font = "STIX-Web"; -mjAPI.config({MathJax: {SVG: {font: argv.font}}}); +mjAPI.config({MathJax: {SVG: {font: argv.font}}, extensions: argv.extensions}); mjAPI.start(); +if (argv.dpi === 0) {argv.dpi = argv.ex * 16} // pixels properly sized + mjAPI.typeset({ math: argv._[0], format: "AsciiMath", diff --git a/bin/am2svg b/bin/am2svg index 25916f67..e9f7b7dc 100755 --- a/bin/am2svg +++ b/bin/am2svg @@ -55,12 +55,16 @@ var argv = require("yargs") width: { default: 100, describe: "width of container in ex" + }, + extensions: { + default: "", + describe: "extra MathJax extensions e.g. 'Safe,TeX/noUndefined'" } }) .argv; if (argv.font === "STIX") argv.font = "STIX-Web"; -mjAPI.config({MathJax: {SVG: {font: argv.font}}}); +mjAPI.config({MathJax: {SVG: {font: argv.font}}, extensions: argv.extensions}); mjAPI.start(); mjAPI.typeset({ diff --git a/bin/mml2mml b/bin/mml2mml index 45e6d794..33daeb0d 100755 --- a/bin/mml2mml +++ b/bin/mml2mml @@ -40,11 +40,15 @@ var argv = require("yargs") speechstyle: { default: "default", describe: "style to use for speech text (default, brief, sbrief)" + }, + extensions: { + default: "", + describe: "extra MathJax extensions e.g. 'Safe,TeX/noUndefined'" } }) .argv; -mjAPI.config({}); +mjAPI.config({extensions: argv.extensions}); mjAPI.start(); mjAPI.typeset({ diff --git a/bin/mml2png b/bin/mml2png index b65c36b7..d97471db 100755 --- a/bin/mml2png +++ b/bin/mml2png @@ -33,8 +33,8 @@ var argv = require("yargs") describe: "perform automatic line-breaking" }, dpi: { - default: 144, - describe: "dpi for image" + default: 0, + describe: "dpi for image (0 = calculate automatically)" }, font: { default: "TeX", @@ -47,14 +47,20 @@ var argv = require("yargs") width: { default: 100, describe: "width of container in ex" + }, + extensions: { + default: "", + describe: "extra MathJax extensions e.g. 'Safe,TeX/noUndefined'" } }) .argv; if (argv.font === "STIX") argv.font = "STIX-Web"; -mjAPI.config({MathJax: {SVG: {font: argv.font}}}); +mjAPI.config({MathJax: {SVG: {font: argv.font}}, extensions: argv.extensions}); mjAPI.start(); +if (argv.dpi === 0) {argv.dpi = argv.ex * 16} // pixels properly sized + mjAPI.typeset({ math: argv._[0], format: "MathML", diff --git a/bin/mml2svg b/bin/mml2svg index ee7e2af6..fd7348b9 100755 --- a/bin/mml2svg +++ b/bin/mml2svg @@ -55,12 +55,16 @@ var argv = require("yargs") width: { default: 100, describe: "width of container in ex" + }, + extensions: { + default: "", + describe: "extra MathJax extensions e.g. 'Safe,TeX/noUndefined'" } }) .argv; if (argv.font === "STIX") argv.font = "STIX-Web"; -mjAPI.config({MathJax: {SVG: {font: argv.font}}}); +mjAPI.config({MathJax: {SVG: {font: argv.font}}, extensions: argv.extensions}); mjAPI.start(); mjAPI.typeset({ diff --git a/bin/mml2svg-html5 b/bin/mml2svg-html5 index 7592631c..6788d7aa 100755 --- a/bin/mml2svg-html5 +++ b/bin/mml2svg-html5 @@ -63,12 +63,16 @@ var argv = require("yargs") width: { default: 100, describe: "width of container in ex" + }, + extensions: { + default: "", + describe: "extra MathJax extensions e.g. 'Safe,TeX/noUndefined'" } }) .argv; if (argv.font === "STIX") argv.font = "STIX-Web"; -mjAPI.config({MathJax: {SVG: {font: argv.font}}}); +mjAPI.config({MathJax: {SVG: {font: argv.font}}, extensions: argv.extensions}); mjAPI.start(); // diff --git a/bin/page2mml b/bin/page2mml index 7ae0d359..3ceec26c 100755 --- a/bin/page2mml +++ b/bin/page2mml @@ -71,20 +71,24 @@ var argv = require("yargs") width: { default: 100, describe: "width of container in ex" + }, + extensions: { + default: "", + describe: "extra MathJax extensions e.g. 'Safe,TeX/noUndefined'" } }) .argv; argv.format = argv.format.split(/ *, */); -mjAPI.config({MathJax: {menuSettings: {semantics: argv.semantics}}}); +mjAPI.config({MathJax: {menuSettings: {semantics: argv.semantics}}, extensions: argv.extensions}); mjAPI.start(); // // Process an HTML file: // function processHTML(html,callback) { - var document = jsdom(html,null,{features:{FetchExternalResources: false}}); + var document = jsdom(html,{features:{FetchExternalResources: false}}); var xmlns = getXMLNS(document); mjAPI.typeset({ html:document.body.innerHTML, diff --git a/bin/page2png b/bin/page2png index f3c7d7cd..4b526d2a 100755 --- a/bin/page2png +++ b/bin/page2png @@ -65,12 +65,12 @@ var argv = require("yargs") describe: "equation number style (none, AMS, or all)" }, img: { - default: "", - describe: "make external svg images with this name prefix" + default: "", + describe: "make external svg images with this name prefix" }, dpi: { - default: "144", - describe: "the dpi for the PNG images" + default: 0, + describe: "dpi for image (0 = calculate automatically)" }, font: { default: "TeX", @@ -83,20 +83,26 @@ var argv = require("yargs") width: { default: 100, describe: "width of container in ex" + }, + extensions: { + default: "", + describe: "extra MathJax extensions e.g. 'Safe,TeX/noUndefined'" } }) .argv; argv.format = argv.format.split(/ *, */); if (argv.font === "STIX") argv.font = "STIX-Web"; -mjAPI.config({MathJax: {SVG: {font: argv.font}}}); +mjAPI.config({MathJax: {SVG: {font: argv.font}}, extensions: argv.extensions}); mjAPI.start(); +if (argv.dpi === 0) {argv.dpi = argv.ex * 16} // pixels properly sized + // // Process an HTML file: // function processHTML(html,callback) { - var document = jsdom(html,null,{features:{FetchExternalResources: false}}); + var document = jsdom(html,{features:{FetchExternalResources: false}}); var xmlns = getXMLNS(document); mjAPI.typeset({ html: document.body.innerHTML, diff --git a/bin/page2svg b/bin/page2svg index 16cf55b5..95de942f 100755 --- a/bin/page2svg +++ b/bin/page2svg @@ -87,20 +87,24 @@ var argv = require("yargs") width: { default: 100, describe: "width of container in ex" + }, + extensions: { + default: "", + describe: "extra MathJax extensions e.g. 'Safe,TeX/noUndefined'" } }) .argv; argv.format = argv.format.split(/ *, */); if (argv.font === "STIX") argv.font = "STIX-Web"; -mjAPI.config({MathJax: {SVG: {font: argv.font}}}); +mjAPI.config({MathJax: {SVG: {font: argv.font}}, extensions: argv.extensions}); mjAPI.start(); // // Process an HTML file: // function processHTML(html,callback) { - var document = jsdom(html,null,{features:{FetchExternalResources: false}}); + var document = jsdom(html,{features:{FetchExternalResources: false}}); var xmlns = getXMLNS(document); mjAPI.typeset({ html: document.body.innerHTML, diff --git a/bin/tex2mml b/bin/tex2mml index 029265bd..e6a3f597 100755 --- a/bin/tex2mml +++ b/bin/tex2mml @@ -51,6 +51,10 @@ var argv = require("yargs") notexhints: { boolean: true, describe: "don't add TeX-specific classes" + }, + extensions: { + default: "", + describe: "extra MathJax extensions e.g. 'Safe,TeX/noUndefined'" } }) .argv; @@ -61,7 +65,8 @@ mjAPI.config({ semantics: argv.semantics, texHints: !argv.notexhints } - } + }, + extensions: argv.extensions }); mjAPI.start(); diff --git a/bin/tex2png b/bin/tex2png index 8770ee20..1129d4ad 100755 --- a/bin/tex2png +++ b/bin/tex2png @@ -38,8 +38,8 @@ var argv = require("yargs") describe: "perform automatic line-breaking" }, dpi: { - default: 144, - describe: "dpi for image" + default: 0, + describe: "dpi for image (0 = calculate automatically)" }, font: { default: "TeX", @@ -52,14 +52,20 @@ var argv = require("yargs") width: { default: 100, describe: "width of container in ex" + }, + extensions: { + default: "", + describe: "extra MathJax extensions e.g. 'Safe,TeX/noUndefined'" } }) .argv; if (argv.font === "STIX") argv.font = "STIX-Web"; -mjAPI.config({MathJax: {SVG: {font: argv.font}}}); +mjAPI.config({MathJax: {SVG: {font: argv.font}}, extensions: argv.extensions}); mjAPI.start(); +if (argv.dpi === 0) {argv.dpi = argv.ex * 16} // pixels properly sized + mjAPI.typeset({ math: argv._[0], format: (argv.inline ? "inline-TeX" : "TeX"), diff --git a/bin/tex2svg b/bin/tex2svg index de69e79c..30475576 100755 --- a/bin/tex2svg +++ b/bin/tex2svg @@ -59,12 +59,16 @@ var argv = require("yargs") width: { default: 100, describe: "width of container in ex" + }, + extensions: { + default: "", + describe: "extra MathJax extensions e.g. 'Safe,TeX/noUndefined'" } }) .argv; if (argv.font === "STIX") argv.font = "STIX-Web"; -mjAPI.config({MathJax: {SVG: {font: argv.font}}}); +mjAPI.config({MathJax: {SVG: {font: argv.font}}, extensions: argv.extensions}); mjAPI.start(); mjAPI.typeset({ diff --git a/bin/tex2svg-filter b/bin/tex2svg-filter index e103475a..19c6db46 100755 --- a/bin/tex2svg-filter +++ b/bin/tex2svg-filter @@ -63,12 +63,16 @@ var argv = require("yargs") width: { default: 100, describe: "width of container in ex" + }, + extensions: { + default: "", + describe: "extra MathJax extensions e.g. 'Safe,TeX/noUndefined'" } }) .argv; if (argv.font === "STIX") argv.font = "STIX-Web"; -mjAPI.config({MathJax: {SVG: {font: argv.font}}}); +mjAPI.config({MathJax: {SVG: {font: argv.font}}, extensions: argv.extensions}); mjAPI.start(); var prefix = argv._[0]; // the file prefix diff --git a/lib/mj-page.js b/lib/mj-page.js index c877aba2..4356d991 100644 --- a/lib/mj-page.js +++ b/lib/mj-page.js @@ -28,14 +28,17 @@ var http = require('http'); var fs = require('fs'); var path = require('path'); +var url = require('url'); var fmt = require('util').format; var jsdom = require("jsdom").jsdom; -var exec = require('child_process').exec; +var execFile = require('child_process').execFile; var speech = require('speech-rule-engine'); +var os = require('os'); var displayMessages = false; // don't log Message.Set() calls var displayErrors = true; // show error messages on the console var undefinedChar = false; // unknown characters are not saved in the error array +var extensions = ''; // no additional extensions used var defaults = { ex: 6, // ex-size in pixels @@ -74,14 +77,17 @@ var STATE = { BUSY: 4 // MathJax currently processing math }; -var MathJaxPath = "file://"+require.resolve('MathJax/unpacked/MathJax'); +// +// The MathJaxPath is normaized against file:/// so that Windows paths are correct +// +var MathJaxPath = url.resolve("file:///","file:"+require.resolve('MathJax/unpacked/MathJax')); var BatikRasterizerPath = path.resolve(__dirname,'..','batik/batik-rasterizer.jar'); var MathJaxConfig; // configuration for when starting MathJax var MathJax; // filled in once MathJax is loaded var serverState = STATE.STOPPED; // nothing loaded yet var timer; // used to reset MathJax if it runs too long -var tmpfile = "/tmp/mj-single-svg"; // file name prefix to use for temp files +var tmpfile = os.tmpdir() + "/mj-single-svg"; // file name prefix to use for temp files var document, window, content, html; // the DOM elements @@ -116,6 +122,12 @@ function GetWindow() { content = document.body.appendChild(document.createElement("div")); content.id = "MathJax_Content"; content.innerHTML = "$x$ `x` x"; + // + // Node's url.resolve() has a problem with resolving a file:// URL when + // the base URL is "about:blank", so force it to be something else (HACK) + // since jsdom 3.x sets the base to "about:blank". + // + if (document._URL === "about:blank") document._URL = "file:///blank.html"; } // @@ -146,6 +158,10 @@ function ConfigureMathJax() { delete MathJax.Hub.config.styles; // don't need any styles MathJax.Hub.Startup.MenuZoom = function () {}; // don't load menu or zoom code + MathJax.Extension.MathEvents = { + Event:{}, Touch:{}, Hover:{} // fake structure to avid errors + }; + MathJax.Ajax.loaded[MathJax.Ajax.fileURL("[MathJax]/extensions/MathEvents.js")] = true; // // When creating stylesheets, no need to wait for them @@ -264,9 +280,10 @@ function ConfigureMathJax() { // // Set SVG data for jax // - jax.SVG.ex = ex = (data||defaults).ex; jax.SVG.cwidth = width; + jax.SVG.ex = ex = (data||defaults).ex; jax.SVG.em = em = ex / SVG.TeX.x_height * 1000; // scale ex to x_height - jax.SVG.lineWidth = (linebreak ? width / em : 1000000); + jax.SVG.cwidth = width / em * 1000; + jax.SVG.lineWidth = (linebreak ? width / em *1000 : 1000000); } // // Set state variables used for displaying equations in chunks @@ -334,6 +351,16 @@ function ConfigureMathJax() { } }; + if (extensions) { + // + // Parse added extensions list and add to standard ones + // + var extensionList = extensions.split(/s*,\s*/); + for (var i = 0; i < extensionList.length; i++) { + var matches = extensionList[i].match(/^(.*?)(\.js)?$/); + window.MathJax.extensions.push(matches[1] + '.js'); + } + } if (MathJaxConfig) {Insert(window.MathJax,MathJaxConfig)} } @@ -358,6 +385,7 @@ function StartMathJax() { serverState = STATE.STARTED; var script = document.createElement("script"); script.src = MathJaxPath; + script.onerror = function () {AddError("Can't load MathJax.js from "+MathJaxPath)} document.head.appendChild(script); } @@ -375,9 +403,15 @@ function ReportError(message,currentCallback) { // Add an error to the error list and display it on the console // function AddError(prefix,message,nopush) { - var n = MathJax.ElementJax.ID + 1; - if (prefix !== "") {prefix += " ("+n+"): "} - message = prefix+message; + if (message != null) { + if (MathJax && MathJax.ElementJax) { + var n = MathJax.ElementJax.ID + 1; + if (prefix !== "") {prefix += " ("+n+"): "} + } + message = prefix+message; + } else { + message = prefix; + } if (displayErrors) console.error(message); if (!nopush) errors.push(message); } @@ -645,7 +679,7 @@ function MakeIMG() { function MakePNG() { if (data.renderer === "PNG") { var synch = MathJax.Callback(function () {}); // for synchronization with MathJax - var batikCommand = fmt("java -jar %s -dpi %d '%s.svg'",BatikRasterizerPath,data.dpi,tmpfile); + var batikCommands = ['-jar', BatikRasterizerPath, '-dpi', data.dpi, tmpfile + '.svg']; var tmpSVG = tmpfile+".svg", tmpPNG = tmpfile+".png"; var nodes = document.getElementsByClassName("MathJax_SVG"); var check = function (err) {if (err) {AddError(err.message); return true}} @@ -663,7 +697,7 @@ function MakePNG() { ].join("\n"); fs.writeFile(tmpSVG,svg,function (err) { if (check(err)) return PNG(i-1); - exec(batikCommand, function (err,stdout,stderr) { + execFile('java', batikCommands, function (err,stdout,stderr) { if (check(err)) {fs.unlinkSync(tmpSVG); return PNG(i-1)} fs.readFile(tmpPNG,null,function (err,buffer) { if (!check(err)) { @@ -783,17 +817,20 @@ exports.start = function () {RestartMathJax()} // Configure MathJax and the API // You can pass additional configuration options to MathJax using the // MathJax property, and can set displayErrors and displayMessages -// that control the display of error messages +// that control the display of error messages, and extensions to add +// additional MathJax extensions to the base or to sub-categories. // // E.g. -// mjAPI.congif({ +// mjAPI.config({ // MathJax: {SVG: {font: "STIX-Web"}}, // displayErrors: false +// extensions: 'Safe,TeX/noUndefined' // }); // exports.config = function (config) { if (config.displayMessages != null) {displayMessages = config.displayMessages} if (config.displayErrors != null) {displayErrors = config.displayErrors} if (config.undefinedCharError != null) {undefinedChar = config.undefinedCharError} + if (config.extensions != null) {extensions = config.extensions} if (config.MathJax) {MathJaxConfig = config.MathJax} } diff --git a/lib/mj-single.js b/lib/mj-single.js index fe8c22d5..87293420 100644 --- a/lib/mj-single.js +++ b/lib/mj-single.js @@ -29,14 +29,17 @@ var http = require('http'); var fs = require('fs'); var path = require('path'); +var url = require('url'); var fmt = require('util').format; var jsdom = require('jsdom').jsdom; -var exec = require('child_process').exec; +var execFile = require('child_process').execFile; var speech = require('speech-rule-engine'); +var os = require('os'); var displayMessages = false; // don't log Message.Set() calls var displayErrors = true; // show error messages on the console var undefinedChar = false; // unknown characters are not saved in the error array +var extensions = ''; // no additional extensions used var defaults = { ex: 6, // ex-size in pixels @@ -73,13 +76,16 @@ var STATE = { BUSY: 4 // MathJax currently processing math }; -var MathJaxPath = "file://"+require.resolve('MathJax/unpacked/MathJax'); +// +// The MathJaxPath is normaized against file:/// so that Windows paths are correct +// +var MathJaxPath = url.resolve("file:///","file:"+require.resolve('MathJax/unpacked/MathJax')); var BatikRasterizerPath = path.resolve(__dirname,'..','batik/batik-rasterizer.jar'); var MathJaxConfig; // configuration for when starting MathJax var MathJax; // filled in once MathJax is loaded var serverState = STATE.STOPPED; // nothing loaded yet var timer; // used to reset MathJax if it runs too long -var tmpfile = "/tmp/mj-single-svg"; // file name prefix to use for temp files +var tmpfile = os.tmpdir() + "/mj-single-svg"; // file name prefix to use for temp files var document, window, content, html; // the DOM elements @@ -117,6 +123,12 @@ function GetWindow() { content = document.body.appendChild(document.createElement("div")); content.id = "MathJax_Content"; content.innerHTML = "$x$ `x` x"; + // + // Node's url.resolve() has a problem with resolving a file:// URL when + // the base URL is "about:blank", so force it to be something else (HACK) + // since jsdom 3.x sets the base to "about:blank". + // + if (document._URL === "about:blank") document._URL = "file:///blank.html"; } // @@ -147,6 +159,10 @@ function ConfigureMathJax() { delete MathJax.Hub.config.styles; // don't need any styles MathJax.Hub.Startup.MenuZoom = function () {}; // don't load menu or zoom code + MathJax.Extension.MathEvents = { + Event:{}, Touch:{}, Hover:{} // fake structure to avid errors + }; + MathJax.Ajax.loaded[MathJax.Ajax.fileURL("[MathJax]/extensions/MathEvents.js")] = true; // // When creating stylesheets, no need to wait for them @@ -259,9 +275,10 @@ function ConfigureMathJax() { // // Set SVG data for jax // - jax.SVG.ex = ex = (data||defaults).ex; jax.SVG.cwidth = width; + jax.SVG.ex = ex = (data||defaults).ex; jax.SVG.em = em = ex / SVG.TeX.x_height * 1000; // scale ex to x_height - jax.SVG.lineWidth = (linebreak ? width / em : 1000000); + jax.SVG.cwidth = width / em * 1000; + jax.SVG.lineWidth = (linebreak ? width / em * 1000 : 1000000); } // // Set state variables used for displaying equations in chunks @@ -308,6 +325,16 @@ function ConfigureMathJax() { } }; + if (extensions) { + // + // Parse added extensions list and add to standard ones + // + var extensionList = extensions.split(/s*,\s*/); + for (var i = 0; i < extensionList.length; i++) { + var matches = extensionList[i].match(/^(.*?)(\.js)?$/); + window.MathJax.extensions.push(matches[1] + '.js'); + } + } if (MathJaxConfig) {Insert(window.MathJax,MathJaxConfig)} } @@ -331,6 +358,7 @@ function StartMathJax() { serverState = STATE.STARTED; var script = document.createElement("script"); script.src = MathJaxPath; + script.onerror = function () {AddError("Can't load MathJax.js from "+MathJaxPath)} document.head.appendChild(script); } @@ -448,13 +476,13 @@ function GetSVG(result) { function GetPNG(result) { var svgfile = result.svgfile; delete result.svgfile; if (data.png) { - var batikCommand = fmt("java -jar %s -dpi %d '%s.svg'",BatikRasterizerPath,data.dpi,tmpfile); + var batikCommands = ['-jar', BatikRasterizerPath, '-dpi', data.dpi, tmpfile + '.svg']; var synch = MathJax.Callback(function () {}); // for synchronization with MathJax var check = function (err) {if (err) {AddError(err.message); synch(); return true}} var tmpSVG = tmpfile+".svg", tmpPNG = tmpfile+".png"; fs.writeFile(tmpSVG,svgfile,function (err) { if (check(err)) return; - exec(batikCommand, function (err,stdout,stderr) { + execFile('java', batikCommands, function (err,stdout,stderr) { if (check(err)) {fs.unlinkSync(tmpSVG); return} fs.readFile(tmpPNG,null,function (err,buffer) { result.png = "data:image/png;base64,"+(buffer||"").toString('base64'); @@ -652,17 +680,20 @@ exports.start = function () {RestartMathJax()} // Configure MathJax and the API // You can pass additional configuration options to MathJax using the // MathJax property, and can set displayErrors and displayMessages -// that control the display of error messages +// that control the display of error messages, and extensions to add +// additional MathJax extensions to the base or to sub-categories. // // E.g. -// mjAPI.congif({ +// mjAPI.config({ // MathJax: {SVG: {font: "STIX-Web"}}, -// displayErrors: false +// displayErrors: false, +// extensions: 'Safe,TeX/noUndefined' // }); // exports.config = function (config) { if (config.displayMessages != null) {displayMessages = config.displayMessages} if (config.displayErrors != null) {displayErrors = config.displayErrors} if (config.undefinedCharError != null) {undefinedChar = config.undefinedCharError} + if (config.extensions != null) {extensions = config.extensions} if (config.MathJax) {MathJaxConfig = config.MathJax} } diff --git a/package.json b/package.json index 30393d50..a24e4034 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,12 @@ { "name": "MathJax-node", - "version": "0.2.0", + "version": "0.3.0", "description": "API's for calling MathJax from node.js", "keywords": ["MathJax","math","svg","MathML","TeX","AsciiMath"], "maintainers": [ - "Davide P. Cervone (http://www.math.union.edu/locate/Cervone/)" + "MathJax Consortium (http://www.mathjax.org)" ], "bugs": { - "email": "dpvc@union.edu", "url": "http://github.com/mathjax/MathJax-node/issues" }, "license": { @@ -19,10 +18,10 @@ "url": "git://github.com/mathjax/MathJax-node.git" }, "dependencies": { - "jsdom": "1.0.2", - "speech-rule-engine": "*", - "yargs": "*", - "MathJax": "https://github.com/mathjax/MathJax/tarball/mathjax-node" + "jsdom": "3.1.1", + "speech-rule-engine": "*", + "yargs": "*", + "MathJax": "https://github.com/mathjax/MathJax/tarball/mathjax-node-2.5.1" }, "main": "./lib/mj-page.js" }