disabling HTML extension

21 views
Skip to first unread message

mal.m...@gmail.com

unread,
May 20, 2013, 10:26:20 AM5/20/13
to mathja...@googlegroups.com
I tried disabling macros defined in the TeX input jax that would automatically load the HTML extension by using

  MathJax.Hub.Register.StartupHook("End Extensions", function() {
    var MACROS = MathJax.InputJax.TeX.Definitions.macros;
    delete MACROS.href;
    delete MACROS.'class';
    delete MACROS.cssId;
    delete MACROS.style;
  });

but I am obviously missing something since it doesn't work. I am aware of Safe.js but instead of including both HTML.js and Safe.js and then not using them I'd prefer simply removing support for these commands. How can I do this?

Thanks!

Davide P. Cervone

unread,
May 20, 2013, 6:40:06 PM5/20/13
to mathja...@googlegroups.com
You are listening to the wrong signal.  You probably should use "TeX Jax Ready" instead.  The TeX input jax is not loaded as an extension, so probably isn't available when the "End Extensions" signal is triggered.

Note that your solution doesn't prevent anyone from using `\require{HTML}` to load the HTML extension at runtime anyway.  So you might want to remove the \require macro as well.  (Issues like this is one reason to use the Safe extension, since we have covered more of the bases, though you are free to handle it however you feel best.)

Davide


--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

mal.m...@gmail.com

unread,
May 21, 2013, 7:43:37 AM5/21/13
to mathja...@googlegroups.com, dp...@union.edu
Using "TeX Jax Ready" doesn't work either. I wonder why the signal should matter... the TeX input jax and its macros seem accessible, and I can confirm that the deleted macros become undefined in MathJax.InputJax.TeX.Definitions.macros, still the extension is being loaded whenever I use any of them.

Yes, I am aware that I need to delete \require as well, I was just grepping from the HTML.js extension and hacking up a test case.

Thanks

Davide P. Cervone

unread,
May 24, 2013, 9:09:18 AM5/24/13
to mathja...@googlegroups.com
I have to change 

    delete MACROS.'class';

to 

    delete MACROS['class'];

to get it to compile for me, and when I change the "End Extensions" to "TeX Jax Ready" in the startup hook, it works for me:  using \href causes an undefined macro error.  So I'm not sure what is going wrong for you.  Can you post a complete example file that fails?

Davide



On May 20, 2013, at 10:26 AM, <mal.m...@gmail.com> <mal.m...@gmail.com> wrote:

mal.m...@gmail.com

unread,
May 25, 2013, 7:54:09 AM5/25/13
to mathja...@googlegroups.com, dp...@union.edu
I'm sorry, everything works fine after all, after stepping in with Firebug I realized that it was just a stupid caching issue in the MediaWiki software that I didn't get.

Thanks for your help after all!
Reply all
Reply to author
Forward
0 new messages