Skip to content

Commit e69475e

Browse files
committed
Merge pull request #71 from mathjax/develop
Release 0.3
2 parents abda209 + 09f85fc commit e69475e

File tree

19 files changed

+193
-58
lines changed

19 files changed

+193
-58
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ of calling the MathJax API.
1414

1515
Use
1616

17-
npm install https://github.com/mathjax/MathJax-node/tarball/master
17+
npm install MathJax-node
1818

1919
to install MathJax-node and its dependencies.
2020

batik/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ If you intend to use MathJax-node's ability to create PNG images, you
22
should install [batik](http://xmlgraphics.apache.org/batik/download.html)
33
in this directory. Just download it and unpack it here. You need
44
`batik-rasterizer.jar` and the `lib` directory to be in the top level
5-
of this directory.
5+
of this directory. Since Batik v1.8 you have to either create a symlink
6+
to `batik-rasterizer-1.8.jar` or change `mj-page.js` and `mj-single.js`
7+
to point to the version-specific file name.

bin/am2mml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ var argv = require("yargs")
4343
semantics: {
4444
boolean: true,
4545
describe: "add AsciiMath code in <semantics> tag"
46+
},
47+
extensions: {
48+
default: "",
49+
describe: "extra MathJax extensions e.g. 'Safe,TeX/noUndefined'"
4650
}
4751
})
4852
.argv;
@@ -52,7 +56,8 @@ mjAPI.config({
5256
menuSettings: {
5357
semantics: argv.semantics
5458
}
55-
}
59+
},
60+
extensions: argv.extensions
5661
});
5762
mjAPI.start();
5863

bin/am2png

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ var argv = require("yargs")
3434
describe: "perform automatic line-breaking"
3535
},
3636
dpi: {
37-
default: 144,
38-
describe: "dpi for image"
37+
default: 0,
38+
describe: "dpi for image (0 = calculate automatically)"
3939
},
4040
font: {
4141
default: "TeX",
@@ -48,14 +48,20 @@ var argv = require("yargs")
4848
width: {
4949
default: 100,
5050
describe: "width of container in ex"
51+
},
52+
extensions: {
53+
default: "",
54+
describe: "extra MathJax extensions e.g. 'Safe,TeX/noUndefined'"
5155
}
5256
})
5357
.argv;
5458

5559
if (argv.font === "STIX") argv.font = "STIX-Web";
56-
mjAPI.config({MathJax: {SVG: {font: argv.font}}});
60+
mjAPI.config({MathJax: {SVG: {font: argv.font}}, extensions: argv.extensions});
5761
mjAPI.start();
5862

63+
if (argv.dpi === 0) {argv.dpi = argv.ex * 16} // pixels properly sized
64+
5965
mjAPI.typeset({
6066
math: argv._[0],
6167
format: "AsciiMath",

bin/am2svg

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,16 @@ var argv = require("yargs")
5555
width: {
5656
default: 100,
5757
describe: "width of container in ex"
58+
},
59+
extensions: {
60+
default: "",
61+
describe: "extra MathJax extensions e.g. 'Safe,TeX/noUndefined'"
5862
}
5963
})
6064
.argv;
6165

6266
if (argv.font === "STIX") argv.font = "STIX-Web";
63-
mjAPI.config({MathJax: {SVG: {font: argv.font}}});
67+
mjAPI.config({MathJax: {SVG: {font: argv.font}}, extensions: argv.extensions});
6468
mjAPI.start();
6569

6670
mjAPI.typeset({

bin/mml2mml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,15 @@ var argv = require("yargs")
4040
speechstyle: {
4141
default: "default",
4242
describe: "style to use for speech text (default, brief, sbrief)"
43+
},
44+
extensions: {
45+
default: "",
46+
describe: "extra MathJax extensions e.g. 'Safe,TeX/noUndefined'"
4347
}
4448
})
4549
.argv;
4650

47-
mjAPI.config({});
51+
mjAPI.config({extensions: argv.extensions});
4852
mjAPI.start();
4953

5054
mjAPI.typeset({

bin/mml2png

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ var argv = require("yargs")
3333
describe: "perform automatic line-breaking"
3434
},
3535
dpi: {
36-
default: 144,
37-
describe: "dpi for image"
36+
default: 0,
37+
describe: "dpi for image (0 = calculate automatically)"
3838
},
3939
font: {
4040
default: "TeX",
@@ -47,14 +47,20 @@ var argv = require("yargs")
4747
width: {
4848
default: 100,
4949
describe: "width of container in ex"
50+
},
51+
extensions: {
52+
default: "",
53+
describe: "extra MathJax extensions e.g. 'Safe,TeX/noUndefined'"
5054
}
5155
})
5256
.argv;
5357

5458
if (argv.font === "STIX") argv.font = "STIX-Web";
55-
mjAPI.config({MathJax: {SVG: {font: argv.font}}});
59+
mjAPI.config({MathJax: {SVG: {font: argv.font}}, extensions: argv.extensions});
5660
mjAPI.start();
5761

62+
if (argv.dpi === 0) {argv.dpi = argv.ex * 16} // pixels properly sized
63+
5864
mjAPI.typeset({
5965
math: argv._[0],
6066
format: "MathML",

bin/mml2svg

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,16 @@ var argv = require("yargs")
5555
width: {
5656
default: 100,
5757
describe: "width of container in ex"
58+
},
59+
extensions: {
60+
default: "",
61+
describe: "extra MathJax extensions e.g. 'Safe,TeX/noUndefined'"
5862
}
5963
})
6064
.argv;
6165

6266
if (argv.font === "STIX") argv.font = "STIX-Web";
63-
mjAPI.config({MathJax: {SVG: {font: argv.font}}});
67+
mjAPI.config({MathJax: {SVG: {font: argv.font}}, extensions: argv.extensions});
6468
mjAPI.start();
6569

6670
mjAPI.typeset({

bin/mml2svg-html5

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,16 @@ var argv = require("yargs")
6363
width: {
6464
default: 100,
6565
describe: "width of container in ex"
66+
},
67+
extensions: {
68+
default: "",
69+
describe: "extra MathJax extensions e.g. 'Safe,TeX/noUndefined'"
6670
}
6771
})
6872
.argv;
6973

7074
if (argv.font === "STIX") argv.font = "STIX-Web";
71-
mjAPI.config({MathJax: {SVG: {font: argv.font}}});
75+
mjAPI.config({MathJax: {SVG: {font: argv.font}}, extensions: argv.extensions});
7276
mjAPI.start();
7377

7478
//

bin/page2mml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,24 @@ var argv = require("yargs")
7171
width: {
7272
default: 100,
7373
describe: "width of container in ex"
74+
},
75+
extensions: {
76+
default: "",
77+
describe: "extra MathJax extensions e.g. 'Safe,TeX/noUndefined'"
7478
}
7579
})
7680
.argv;
7781

7882
argv.format = argv.format.split(/ *, */);
7983

80-
mjAPI.config({MathJax: {menuSettings: {semantics: argv.semantics}}});
84+
mjAPI.config({MathJax: {menuSettings: {semantics: argv.semantics}}, extensions: argv.extensions});
8185
mjAPI.start();
8286

8387
//
8488
// Process an HTML file:
8589
//
8690
function processHTML(html,callback) {
87-
var document = jsdom(html,null,{features:{FetchExternalResources: false}});
91+
var document = jsdom(html,{features:{FetchExternalResources: false}});
8892
var xmlns = getXMLNS(document);
8993
mjAPI.typeset({
9094
html:document.body.innerHTML,

0 commit comments

Comments
 (0)