diff --git a/lib/latex-loader.js b/lib/latex-loader.js index 317a2987..9dd4afc4 100644 --- a/lib/latex-loader.js +++ b/lib/latex-loader.js @@ -32,7 +32,7 @@ function escapeBlockLaTeX(source) { latex = source.substring(curr, term + ed.length); // convert this LaTeX code into an SVG file in ./images/latex, - // using mathjax-node in the ./tools directory + // using mathjax-node in the ./tools directory. var hash = sha1(latex); var filename = "images/latex/" + hash + ".svg"; var destination = __dirname + "/../" + filename; diff --git a/tools/mathjax.js b/tools/mathjax.js index eb8e4cc9..48622802 100644 --- a/tools/mathjax.js +++ b/tools/mathjax.js @@ -37,9 +37,11 @@ if (latex === -1) { } } -// strip any \[ and \], which is an block-level LaTeX markup indicator for MathJax + +// strip any \[ and \], which is an block-level LaTeX markup indicator for MathJax: latex = latex.replace(/^'/,'').replace(/'$/,'').replace('\\[','').replace('\\]',''); + // set up the MathJax processor var API = require("mathjax-node/lib/mj-single"); API.config({ @@ -76,7 +78,6 @@ var toReactStyle = function(input) { var fs = require("fs"); var filename = "images/latex/" + hash + ".svg"; var destination = __dirname + "/../" + filename; - var className="LaTeX SVG"; // convert the passed LaTeX to SVG form