Skip to content

Prevent the color extension from auto-loading #175

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

Closed
pkra opened this issue Feb 18, 2016 · 5 comments
Closed

Prevent the color extension from auto-loading #175

pkra opened this issue Feb 18, 2016 · 5 comments

Comments

@pkra
Copy link
Contributor

pkra commented Feb 18, 2016

From #143 (comment).

You are right to point out the autoload-all extension, and I was going to say that because \color is already defined in MathJax's TeX input jax by default, that autoload-all would not redefine it, but I checked the code and I am wrong; \color is set to autoload the color extension. I'm not sure that is the desired behavior for MathJax-node, since that means it will operate differently from default MathJax in the browser.

@pkra pkra added the Accepted label Feb 18, 2016
@pkra pkra added this to the What comes next milestone Feb 18, 2016
@pkra pkra mentioned this issue Feb 18, 2016
@pkra
Copy link
Contributor Author

pkra commented May 25, 2016

Question: Do we want to drop the autoload extension entirely or do we want to load all extensions except the color extension?

@dpvc
Copy link
Member

dpvc commented May 27, 2016

I think it is OK to use autoload-all, but perhaps we should put back the original definition for color once it loads. That would be easy enough to add.

@pkra
Copy link
Contributor Author

pkra commented Oct 11, 2016

I think it is OK to use autoload-all, but perhaps we should put back the original definition for color once it loads. That would be easy enough to add.

Do you mean just copy&paste https://github.com/mathjax/MathJax/blob/master/unpacked/jax/input/TeX/jax.js#L1320-L1326?

@pkra
Copy link
Contributor Author

pkra commented Oct 11, 2016

In other words: I don't think I know how to fix this ☹️

@dpvc
Copy link
Member

dpvc commented Oct 17, 2016

You should add

      if (MathJax.AuthorConfig.extensions.indexOf("TeX/color.js") == -1) {
        MathJax.Hub.Register.StartupHook("TeX autoload-all Ready",function () {
          var macros = MathJax.InputJax.TeX.Definitions.macros;
          macros.color = "Color";
          delete macros.textcolor;
          delete macros.colorbox;
          delete macros.fcolorbox;
          delete macros.definecolor;
        });
      }

at line 425 of main.js to get back the original \color functionality. One can then use the --extensions "TeX/color" option to force the LaTeX-compatible color functions.

pkra added a commit that referenced this issue Oct 27, 2016
pkra added a commit that referenced this issue Oct 31, 2016
* check if \color is not a switch
@pkra pkra added the Fixed label Nov 2, 2016
@pkra pkra closed this as completed Nov 2, 2016
pkra added a commit that referenced this issue Mar 13, 2017
pkra added a commit that referenced this issue Mar 13, 2017
* check if \color is not a switch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants