mirror of
https://github.com/Pomax/BezierInfo-2.git
synced 2025-08-11 19:24:07 +02:00
.
This commit is contained in:
@@ -32,7 +32,7 @@ function escapeBlockLaTeX(source) {
|
|||||||
latex = source.substring(curr, term + ed.length);
|
latex = source.substring(curr, term + ed.length);
|
||||||
|
|
||||||
// convert this LaTeX code into an SVG file in ./images/latex,
|
// 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 hash = sha1(latex);
|
||||||
var filename = "images/latex/" + hash + ".svg";
|
var filename = "images/latex/" + hash + ".svg";
|
||||||
var destination = __dirname + "/../" + filename;
|
var destination = __dirname + "/../" + filename;
|
||||||
|
@@ -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('\\]','');
|
latex = latex.replace(/^'/,'').replace(/'$/,'').replace('\\[','').replace('\\]','');
|
||||||
|
|
||||||
|
|
||||||
// set up the MathJax processor
|
// set up the MathJax processor
|
||||||
var API = require("mathjax-node/lib/mj-single");
|
var API = require("mathjax-node/lib/mj-single");
|
||||||
API.config({
|
API.config({
|
||||||
@@ -76,7 +78,6 @@ var toReactStyle = function(input) {
|
|||||||
var fs = require("fs");
|
var fs = require("fs");
|
||||||
var filename = "images/latex/" + hash + ".svg";
|
var filename = "images/latex/" + hash + ".svg";
|
||||||
var destination = __dirname + "/../" + filename;
|
var destination = __dirname + "/../" + filename;
|
||||||
|
|
||||||
var className="LaTeX SVG";
|
var className="LaTeX SVG";
|
||||||
|
|
||||||
// convert the passed LaTeX to SVG form
|
// convert the passed LaTeX to SVG form
|
||||||
|
Reference in New Issue
Block a user