This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
var newMathJax = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js'; | |
var oldMathJax = 'https://path.to/MathJax.j'; | |
var n = oldMathJax.length; | |
var scripts = document.getElementsByTagName('script'); | |
for (var i = 0; i < scripts.length; i++) { | |
var script = scripts[i]; | |
var src = script.getAttribute('src') || ''; | |
if (src.substr(0, n) === oldMathJax) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html > | |
<head> | |
<meta charset="UTF-8"> | |
<link rel="shortcut icon" type="image/x-icon" href="https://production-assets.codepen.io/assets/favicon/favicon-8ea04875e70c4b0bb41da869e81236e54394d63638a1ef12fa558a4a835f1164.ico" /> | |
<link rel="mask-icon" type="" href="https://production-assets.codepen.io/assets/favicon/logo-pin-f2d2b6d2c61838f7e76325261b7195c27224080bc099486ddd6dccb469b8e8e6.svg" color="#111" /> | |
<title>CodePen - Deep labels</title> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// via https://github.com/mathjax/MathJax/issues/1029#issuecomment-72348069 and http://c.utz.cc/mathjax/render.js | |
var webpage = require('webpage'); | |
var capture = function (page, pageUrl, callback) { | |
page.open(pageUrl, function (status) { | |
var interval, allDone; | |
if (status !== 'success') { | |
callback(new Error('Error rendering page')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){ var s=document.createElement('script');s.setAttribute('src','ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"');document.getElementsByTagName('body')[0].appendChild(s); $('img.tex').wrap('<span class="MathJax_Preview" />');$('.MathJax_Preview').after(function() { tex = $(this).find('img').attr("alt"); return " <script type='math/tex'>" + tex + "</" + "script>" ;});$.getScript('https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML');})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mathjax = require('mathjax-node'); | |
const typeset = mathjax.typeset; | |
process.on('message', function(m) { | |
if (m === 'exit') { | |
// empty typeset to push exit on MathJax's queue (else we'd terminate too soon) | |
typeset({"math": "", "format": "TeX", "mml":true}, function(result) { | |
process.send('exit'); | |
}) | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
var images = document.querySelectorAll('img.latex'); | |
for (var i = 0; i < images.length; i++){ | |
var image = images[i]; | |
tex = image.getAttribute('alt'); | |
var preview = document.createElement('span'); | |
preview.setAttribute('class','MathJax_Preview'); | |
image.parentNode.insertBefore(preview, image); | |
preview.appendChild(image); | |
var script = document.createElement('script'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
var images = document.getElementsByTagName('img'); | |
var hasMath = false; | |
for (var i = 0; i < images.length; i++){ | |
var image = images[i]; | |
tex = image.getAttribute('alt'); | |
if (tex && tex[0] === '$'){ // TODO a class for TeX images would be cleaner, also to differentiate inline and display math | |
hasMath = true; | |
var preview = document.createElement('span'); | |
preview.setAttribute('class','MathJax_Preview'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>MathJax even more basic pen</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
var mjAPI = require("../lib/main.js"); | |
mjAPI.start(); | |
var jsdom = require('jsdom').jsdom; | |
var serializeDocument = require("jsdom").serializeDocument; | |
var input = "<!DOCTYPE html><p> When <math> <mi>a</mi><mo>≠</mo><mn>0</mn> </math>, there are two solutions to <math> <mi>a</mi><msup><mi>x</mi><mn>2</mn></msup> <mo>+</mo> <mi>b</mi><mi>x</mi> <mo>+</mo> <mi>c</mi> <mo>=</mo> <mn>0</mn> </math></p>"; | |
var document = jsdom(input); | |
var window = document.defaultView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(grunt) { | |
grunt.initConfig({ | |
'json-minify': { | |
build: { | |
files: 'dist/mathmaps/**/*.json' | |
} | |
}, | |
gitclone: { | |
'speech-rule-engine': { |