LaTeX Fix LaTeX ColorV2 Extension - Greg Bernhardt

  • Thread starter Thread starter pbuk
  • Start date Start date
AI Thread Summary
The LaTeX color extension issue was identified, with a suggestion to change the autoload key from "colorV2" to "colorv2" (noting the lowercase "v"). Experiments indicated this adjustment would resolve the problem. Users were also informed that deleting both color keys would enable the MathJax V3 color module, but this could disrupt colors in older posts. After purging the cache from Cloudflare, the issue was resolved, and functionality was restored. The discussion highlights the importance of proper configuration in MathJax for LaTeX color rendering.
pbuk
Science Advisor
Homework Helper
Gold Member
Messages
4,966
Reaction score
3,217
@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 Greg Bernhardt and robphy
Physics news on Phys.org
Greg Bernhardt said:
ok fixed, try now

## \color{red}{x} + \color{blue}{y} ##
 
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?
 
All good now :biggrin:
 
  • Love
Likes Greg Bernhardt
Back
Top