Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.0.1 release #316

Merged
merged 3 commits into from
Apr 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ The `start` method start (and restarts) mathjax-node. This allows reconfiguratio

**Note.** This is done automatically when `typeset` is first called (see below).

### `typset(options, callback)`
### `typeset(options, callback)`

The `typeset` method is the main method of mathjax-node. It expects a configuration object `input` and a `callback`.

Expand Down Expand Up @@ -140,6 +140,7 @@ The `result` object will contain (at most) the following structure:

```javascript
{
errors: // an array of MathJax error messages if any errors occurred
mml: // a string of MathML markup if requested
mmlNode: // a jsdom node of MathML markup if requested
html: // a string of HTML markup if requested
Expand All @@ -148,6 +149,8 @@ The `result` object will contain (at most) the following structure:
svg: // a string of SVG markup if requested
svgNode: // a jsdom node of SVG markup if requested
style: // a string of CSS inline style if SVG requested
height: // a string containing the height of the SVG output if SVG was requested
width: // a string containing the width of the SVG output if SVG was requested
speakText: // a string of speech text if requested

state: { // the state object (if useGlobalCache or equationNumbers is set)
Expand Down
2 changes: 1 addition & 1 deletion lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ function ConfigureMathJax() {
//
// Reset the color extension after `autoload-all`
//
if (MathJax.AuthorConfig.extensions.indexOf("TeX/color.js") == -1) {
if (MathJax.AuthorConfig.extensions.indexOf("TeX/color.js") == -1 && MathJax.AuthorConfig.extensions.indexOf("TeX/autoload-all.js") == -1) {
MathJax.Hub.Register.StartupHook("TeX autoload-all Ready",function () {
var macros = MathJax.InputJax.TeX.Definitions.macros;
macros.color = "Color";
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mathjax-node",
"version": "1.0.0",
"version": "1.0.1",
"description": "API's for calling MathJax from node.js",
"keywords": [
"MathJax",
Expand Down
20 changes: 20 additions & 0 deletions test/userconfig-autoload.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
var tape = require('tape');
var mjAPI = require("../lib/main.js");

tape('User config: autoload-all should enable color extension', function(t) {
t.plan(1);

var tex = '\\definecolor{myorange}{RGB}{255,165,100}\\color{myorange}e^{i \\pi}\\color{Black} = -1';
mjAPI.config( {
extensions: 'TeX/autoload-all', // a convenience option to add MathJax extensions
});
mjAPI.start();

mjAPI.typeset({
math: tex,
format: "inline-TeX",
mml: true
}, function(data) {
t.ok(!data.errors, 'definecolor should be a known function');
});
});