File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -422,7 +422,7 @@ function ConfigureMathJax() {
422422 //
423423 // Reset the color extension after `autoload-all`
424424 //
425- if ( MathJax . AuthorConfig . extensions . indexOf ( "TeX/color.js" ) == - 1 ) {
425+ if ( MathJax . AuthorConfig . extensions . indexOf ( "TeX/color.js" ) == - 1 && MathJax . AuthorConfig . extensions . indexOf ( "TeX/autoload-all.js" ) == - 1 ) {
426426 MathJax . Hub . Register . StartupHook ( "TeX autoload-all Ready" , function ( ) {
427427 var macros = MathJax . InputJax . TeX . Definitions . macros ;
428428 macros . color = "Color" ;
Original file line number Diff line number Diff line change 1+ var tape = require ( 'tape' ) ;
2+ var mjAPI = require ( "../lib/main.js" ) ;
3+
4+ tape ( 'User config: autoload-all should enable color extension' , function ( t ) {
5+ t . plan ( 1 ) ;
6+
7+ var tex = '\\definecolor{myorange}{RGB}{255,165,100}\\color{myorange}e^{i \\pi}\\color{Black} = -1' ;
8+ mjAPI . config ( {
9+ extensions : 'TeX/autoload-all' , // a convenience option to add MathJax extensions
10+ } ) ;
11+ mjAPI . start ( ) ;
12+
13+ mjAPI . typeset ( {
14+ math : tex ,
15+ format : "inline-TeX" ,
16+ mml : true
17+ } , function ( data ) {
18+ t . ok ( ! data . errors , 'definecolor should be a known function' ) ;
19+ } ) ;
20+ } ) ;
You can’t perform that action at this time.
0 commit comments