Fix LaTeX ColorV2 Extension - Greg Bernhardt

  • Context: LaTeX 
  • Thread starter Thread starter pbuk
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around issues with the LaTeX colorV2 extension in MathJax, specifically its functionality and integration within the Physics Forums platform. Participants explore potential fixes and adjustments to the code related to the extension's autoload configuration.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant suggests that the autoload configuration for the colorV2 extension should use a lowercase "v" based on their observations, indicating that this change might resolve the issue.
  • Another participant confirms that a fix has been implemented but does not specify the details of the changes made.
  • A participant reports ongoing issues with the old check-for-tex.js file still referencing colorV2, suggesting that a cache invalidation may be necessary for the changes to take effect.
  • One participant points out that the problem may originate from MathJax itself, referencing discrepancies in the documentation between different versions of the colorV2 extension.
  • A later reply indicates that the issue has been resolved after purging from Cloudflare, suggesting that the fix was successful.

Areas of Agreement / Disagreement

Participants express differing views on the source of the problem and the effectiveness of the proposed fixes. While one participant believes the issue is related to MathJax, another suggests that the configuration change should resolve it. The discussion reflects a lack of consensus on the root cause prior to the final resolution.

Contextual Notes

There are references to potential issues with caching that may affect the visibility of changes made to the MathJax configuration. The discussion also highlights the differences in documentation between MathJax versions, which may contribute to confusion regarding the extension's functionality.

pbuk
Science Advisor
Homework Helper
Gold Member
Messages
4,973
Reaction score
3,224
@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
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?
 
I purged from Cloudflare, try in 30 seconds.
 
  • Love
Likes   Reactions: pbuk
All good now :biggrin:
 
  • Love
Likes   Reactions: Greg Bernhardt

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
5K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 5 ·
Replies
5
Views
3K
  • Sticky
  • · Replies 2 ·
Replies
2
Views
504K