Latex Bug: Colors Not Showing for Some Users?

  • Context: LaTeX 
  • Thread starter Thread starter jack action
  • Start date Start date
Click For Summary
SUMMARY

The forum discussion centers on a bug in LaTeX rendering, specifically with color and boldface text not displaying correctly for some users. Users reported inconsistent results across different browsers, including Chrome, Opera, and Safari, with MathJax implementations affecting the output. The issue appears to be related to browser versions and potentially cached JavaScript files. A suggested solution is to refresh the cache, which resolved the issue for some users.

PREREQUISITES
  • Understanding of LaTeX syntax, particularly color and boldface commands.
  • Familiarity with MathJax and its role in rendering LaTeX in web browsers.
  • Knowledge of browser caching mechanisms and how they affect web content display.
  • Basic troubleshooting skills for web applications, including clearing browser cache.
NEXT STEPS
  • Investigate the differences in MathJax implementations across various browser versions.
  • Learn how to effectively clear browser cache and manage cached files.
  • Explore LaTeX rendering issues specific to different operating systems and browsers.
  • Review updates and changes made to MathJax and their impact on rendering LaTeX.
USEFUL FOR

Web developers, educators using LaTeX for online content, and anyone troubleshooting LaTeX rendering issues in web applications.

jack action
Science Advisor
Insights Author
Messages
3,553
Reaction score
9,897
I wrote this post where I used "{\color{red}{text}}" in the Latex. I see it correctly (as in the screenshots at the end of the post), but @hutchphd didn't (next post).

Anyone else has this problem? Don't we have all the same javascript file to decode Latex? @Greg Bernhardt
 
Physics news on Phys.org
Color and MathJax don't render very well. This is also true for boldface, italic, or other typesetting codes. They should be avoided. And not only because of that.
 
  • Like
Likes   Reactions: Bystander
For me this works, i.e., \color{red}{\text{Test}} in double dollars:
$$\color{red}{\text{Test}}$$
Also boldface works, \boldsymbol{x} gives
$$\boldsymbol{x}$$
 
  • Like
Likes   Reactions: benorin
Not so for me.
1645293031783.png
 
  • Like
Likes   Reactions: DaveE
Strange. Is it somehow dependent on the web browser you use? I use firefox under linux and it works. I just checked that it also works with the chrome browser...
 
vanhees71 said:
Strange. Is it somehow dependent on the web browser you use? I use firefox under linux and it works. I just checked that it also works with the chrome browser...
I use Chrome and get the same negative result with Opera.
 
Probably browser dependent (or rather, the MathJax implementation in the browser). The boldsymbol seems to work on iOS Safari but the color doesn’t.
 
Orodruin said:
Probably browser dependent (or rather, the MathJax implementation in the browser). The boldsymbol seems to work on iOS Safari but the color doesn’t.
My Safari displays ‚Text‘ in red. Guess we can rule out the browsers.
 
@vanhees71 's test works for me too. But shouldn't all of this depend only on a javascript file? Aren't all "conversions" done in that file? The HTML code I have for \color{red}{v_{wv}} is:
HTML:
<mjx-mstyle style="color: red;">
    <mjx-msub><mjx-mi class="mjx-i">
        <mjx-c class="mjx-c1D463 TEX-I"></mjx-c>
    </mjx-mi>
    <mjx-script style="vertical-align: -0.15em;">
        <mjx-texatom size="s" texclass="ORD">
            <mjx-mi class="mjx-i">
                <mjx-c class="mjx-c1D464 TEX-I"></mjx-c>
            </mjx-mi>
            <mjx-mi class="mjx-i">
                <mjx-c class="mjx-c1D463 TEX-I">
                </mjx-c></mjx-mi></mjx-texatom>
        </mjx-script>
    </mjx-msub>
</mjx-mstyle>
How come it doesn't convert to style="color: red;" for everyone within javascript?
 
  • #10
Here are my test results:


Browser​
red​
bold​
Chrome​
0​
1​
Opera​
0​
1​
Safari​
1​
1​
 
  • #11
fresh_42 said:
My Safari displays ‚Text‘ in red. Guess we can rule out the browsers.
Different browser versions = different MathJax implementations perhaps?
 
  • #12
fresh_42 said:
Here are my test results:


Browser​
red​
bold​
Chrome​
0​
1​
Opera​
0​
1​
Safari​
1​
1​
What OS?
 
  • #14
Orodruin said:
What OS?
I don't see how this would help, and I had difficulties getting all information.
Browser​
Version​
OS​
Version​
Java​
Version​
red Text​
Chrome​
98.0.4758.102 / 64 Bit​
W10H​
21H1​
javax.inject​
2 / 2004​
0​
Opera​
83.0.4254.62 / 64 Bit​
W10H​
21H1​
JavaScript allowed​
?​
0​
Safari​
?​
iOS​
15.3.1​
?​
?​
1​
 
Last edited:
  • #15
This is why someone wrote the book:

Javascript: the Good Parts
 
  • #16
Orodruin said:
Probably browser dependent (or rather, the MathJax implementation in the browser). The boldsymbol seems to work on iOS Safari but the color doesn’t.
That's weird. Both rendered correctly on my iPad and iPhone just now.
 
  • Like
Likes   Reactions: vanhees71
  • #17
  • Like
Likes   Reactions: vanhees71
  • #19
vela said:
That's weird. Both rendered correctly on my iPad and iPhone just now.
Your iOS may be more up to date. I run iOS 12 and can’t update because my phone is relatively ancient.
 
  • Like
Likes   Reactions: vanhees71
  • #20
Orodruin said:
Your iOS may be more up to date. I run iOS 12 and can’t update because my phone is relatively ancient.
The sad reality of being a dedicated college prof unable to afford to upgrade his iPhone.

Hang in there @Orodruin !
 
  • #21
vela said:
Some people might have older versions cached.
I think this is the problem. A week ago PF made some changes.

To people who have errors, refresh your cache and see if it works!
 
  • Like
  • Informative
Likes   Reactions: vanhees71 and fresh_42
  • #22
jack action said:
I think this is the problem. A week ago PF made some changes.

To people who have errors, refresh your cache and see if it works!
How likely is it that two different browsers share the same cache?
 
  • #23
fresh_42 said:
How likely is it that two different browsers share the same cache?
None. But the same file version could be cached in both.
 
  • #24
jack action said:
None. But the same file version could be cached in both.
Yep. It worked for Chrome. Now I have to go through all the annoying logins, cookie acceptances etc. again ...
 
  • #25
fresh_42 said:
Yep. It worked for Chrome. Now I have to go through all the annoying logins, cookie acceptances etc. again ...
You can't clear cache separately from cookies/logins ??!
 
  • Like
Likes   Reactions: vanhees71
  • #26
PAllen said:
You can't clear cache separately from cookies/logins ??!
I could, at least in Chrome. Opera is less comfortable. But I do not know where is stored what and I didn't want to run the process and test the result on every single selection. So I only kept the passwords and the auto-fills.
 
  • #27
vanhees71 said:
For me this works, i.e., \color{red}{\text{Test}} in double dollars:
$$\color{red}{\text{Test}}$$
Also boldface works, \boldsymbol{x} gives
$$\boldsymbol{x}$$
I’m on the latest iOS version in Firefox browser and both the red text and boldface work for me.
 
  • Like
Likes   Reactions: vanhees71

Similar threads

  • · Replies 6 ·
Replies
6
Views
1K
  • · Replies 0 ·
Replies
0
Views
3K
  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 12 ·
Replies
12
Views
4K
  • · Replies 8 ·
Replies
8
Views
2K
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
1K
  • · Replies 16 ·
Replies
16
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K