Skip to content

Commit 6010adc

Browse files
committed
For debugging only.
1 parent acb2bbf commit 6010adc

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

speech/tex2svg-page

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,15 @@ const {mathjax} = require('mathjax-full/js/mathjax.js');
3030
const {TeX} = require('mathjax-full/js/input/tex.js');
3131
const {MathML} = require('mathjax-full/js/input/mathml.js');
3232
const {SVG} = require('mathjax-full/js/output/svg.js');
33-
const {jsdomAdaptor} = require('mathjax-full/js/adaptors/jsdomAdaptor.js');
33+
const {liteAdaptor} = require('mathjax-full/js/adaptors/liteAdaptor.js');
34+
// const {jsdomAdaptor} = require('mathjax-full/js/adaptors/jsdomAdaptor.js');
3435
const {RegisterHTMLHandler} = require('mathjax-full/js/handlers/html.js');
3536
const {EnrichHandler} = require('mathjax-full/js/a11y/semantic-enrich.js');
36-
const {Sre} = require('mathjax-full/js/a11y/sre.js');
37+
// const {Sre} = require('mathjax-full/js/a11y/sre.js');
3738

3839
const {AllPackages} = require('mathjax-full/js/input/tex/AllPackages.js');
3940

40-
const {JSDOM} = require('jsdom');
41+
// const {JSDOM} = require('jsdom');
4142

4243
require('mathjax-full/js/util/entities/all.js');
4344

@@ -68,7 +69,8 @@ const htmlfile = require('fs').readFileSync(argv._[0], 'utf8');
6869
//
6970
// Create DOM adaptor and register it for HTML documents
7071
//
71-
const adaptor = jsdomAdaptor(JSDOM);
72+
const adaptor = liteAdaptor({fontSize: argv.em});
73+
// const adaptor = jsdomAdaptor(JSDOM);
7274
EnrichHandler(RegisterHTMLHandler(adaptor), new MathML());
7375
// RegisterHTMLHandler(adaptor);
7476

@@ -81,6 +83,7 @@ const svg = new SVG({fontCache: argv.fontCache});
8183
const html = mathjax.document(htmlfile, {InputJax: tex, OutputJax: svg,
8284
enableEnrichment: true,
8385
sre: {
86+
json: '/home/sorge/git/MathJax/MathJax-src/es5/sre/mathmaps',
8487
speech: 'deep'
8588
},
8689
renderActions: require('./action.js').speechAction
@@ -108,3 +111,6 @@ if (Array.from(html.math).length === 0) {
108111
//
109112
console.log(adaptor.doctype(html.document));
110113
console.log(adaptor.outerHTML(adaptor.root(html.document)));
114+
// Sre.setupEngine({json: '/home/sorge/git/MathJax/MathJax-src/es5/sre/mathmaps'})
115+
// .then(() => Sre.sreReady())
116+
// .then(() => { });

0 commit comments

Comments
 (0)