Fix LaTeX ColorV2 Extension - Greg Bernhardt

  • Context: LaTeX 
  • Thread starter Thread starter pbuk
  • Start date Start date
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
6 replies · 2K views
Messages
5,016
Reaction score
3,263
@Greg Bernhardt: the ## \LaTeX ## color extension doesn't seem to be working. MathJax is downloading the colorv2 extension but in check-for-tex.js you have
JavaScript:
autoload: {
  color: [],
  colorV2: ['color'],
}
I'm not sure if this will fix it* but I think it shoud be
JavaScript:
autoload: {
  color: [],
  colorv2: ['color'],
}
(note the lower case "v" in line 3).

* Edit: experiments elsewhere indicate that this will fix it.

* Edit2: you could of course delete both the color and colorv2 keys to use the 'proper' MathJax V3 color module which works the same way ## \TeX ## does, but this would break colors in old posts under MathJax V2 (if there are any).
 
Last edited:
  • Like
Likes   Reactions: Greg Bernhardt and robphy
Physics news on Phys.org
pbuk said:
## \color{red}{x} + \color{blue}{y} ##
I'm still getting the old https://www.physicsforums.com/check-for-tex.js file with colorV2:

JavaScript:
(function(){var body=document.body.textContent;if(body.match(/(\$\$|##|\[tex\]|\[itex\])/)){if(!window.MathJax){window.MathJax={loader:{load:["ui/lazy"],source:{"ui/lazy":"https://www.physicsforums.com/insights/lazy.js"}},tex:{inlineMath:[["[itex]","[/itex]"],["##","##"]],displayMath:[["[tex]","[/tex]"],["$$","$$"]],processEscapes:true,macros:{href:"{}"},tags:"ams",autoload:{color:[],colorV2:["color"]}},options:{skipHtmlTags:["script","noscript","style","textarea","pre","code"],ignoreHtmlClass:"tex2jax_ignore|dno",processHtmlClass:"tex2jax_process"}};}
var script=document.createElement("script");script.src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js";script.async=true;document.head.appendChild(script);}})();
even after a force refresh - may need a cache invalidation?