1
0
mirror of https://github.com/Pomax/BezierInfo-2.git synced 2025-08-01 06:20:52 +02:00
This commit is contained in:
Pomax
2015-12-31 16:32:30 -08:00
parent 46922ab752
commit a3a01fe0a3
2 changed files with 4 additions and 3 deletions

View File

@@ -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;

View File

@@ -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