Edit: how to colour an edited formula

Click For Summary
SUMMARY

This discussion focuses on coloring edited formulas in LaTeX using MathJax, specifically addressing how to apply color to specific parts of equations. Users shared methods such as using the \color command and the \require{colorv2} extension to achieve this. The conversation highlighted the challenges of integrating colored LaTeX within sentences and provided examples of successful implementations. The recent changes in MathJax 3.1 were noted as a factor affecting the configuration for coloring equations.

PREREQUISITES
  • Familiarity with LaTeX syntax and commands
  • Understanding of MathJax configuration and extensions
  • Basic knowledge of color commands in LaTeX
  • Experience with embedding LaTeX in web applications
NEXT STEPS
  • Research the MathJax 3.1 documentation for updated configuration settings
  • Explore the \require{colorv2} extension for advanced coloring techniques
  • Learn how to integrate LaTeX with HTML for dynamic content
  • Investigate interactive JavaScript libraries for enhanced mathematical visualizations
USEFUL FOR

Mathematicians, educators, web developers, and anyone looking to enhance the presentation of mathematical formulas using LaTeX and MathJax.

mcastillo356
Gold Member
Messages
655
Reaction score
359
TL;DR
I've needed to edit a formula, and wanted to colour it. No way. LaTeX command "\color{red}" doesn't work. Whch should be the typing?
Hi PF
How to colour the edited formula?
Greetings!
 
Physics news on Phys.org
In what application?
\vec F_{net}=m\vec a
... but this seems tedious to do for specific items in an equation.
Quote this post to see the tags COLOR tags surrounding the tex tags.

You could use \bf ...
\bf \vec F_{net}=m\vec a
or \Large
\Large \vec F_{net}=m\vec a
 
  • Informative
Likes mcastillo356
robphy said:
In what application?
\vec F_{net}=m\vec a
... but this seems tedious to do for specific items in an equation.
Quote this post to see the tags COLOR tags surrounding the tex tags.

You could use \bf ...
\bf \vec F_{net}=m\vec a
or \Large
\Large \vec F_{net}=m\vec a
Fine. I'll give a try... Suppose I want to colour only ma in F=ma in this sentence: "The formula ##\vec F=m\vec a## is one of the most importants in physics", written inside a paragraph... How?
Thanks!
 
Indeed, \vec F=m\vec a is an important equation.

[CODE title="LaTeX in color on PF"]\vec F=m\vec a[/CODE]
 
  • Love
Likes mcastillo356
Hi, @robphy , PF
What about if the LaTeX inside a sentence is
\dfrac{|f(u)-f(v)|}{|u-v|}=\dfrac{||u|-|v||}{|u-v|}\leq 1
and I want to colour
\dfrac{||u|-|v||}{|u-v|}
 
A little bit mind-blowing, I will take it easy, ie, read and write down #2

Love
 
Experimenting:

V3 ## { \color{red} x } + { \color{blue} y }##

V2 ## \color{red}{x} + \color{blue}{y} ##

$$ \color{red}{x} + \color{blue}{y} $$
 
Last edited:
  • #10
\require{colorv2} { \color{red} {\vec F_{net}}}=m {\color{blue}{\vec a}}
 
  • #11
pbuk said:
Experimenting:

V3 ## \require{colorv2} { \color{red} x } + { \color{blue} y }##

V2 ## \color{red}{x} + \color{blue}{y} ##

$$ \color{red}{x} + \color{blue}{y} $$
\require{colorv2}
 
  • Like
Likes pbuk
  • #12
robphy said:
\require{colorv2}
Ah yes that forces it but it would be better to fix the broken configuration.
 
  • #13
\require{color}<br /> \colorbox{yellow}{1+1=10}

<br /> \color{red}1+1=10
 
  • #14
pbuk said:
Ah yes that forces it but it would be better to fix the broken configuration.
.. which Greg has now done (it was a breaking change in MathJax 3.1) so no need for \require.
 
  • #15
\colorbox{yellow}{Joy!}

<br /> \fcolorbox{black}{yellow}{$\vec F_{net}$} =m\color{blue}{\vec a}

Now if we could only get some interactive javascript [like Desmos or trinket/Glowscript embeded]. :wink:
 

Similar threads

  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 22 ·
Replies
22
Views
1K
  • · Replies 27 ·
Replies
27
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
3
Views
4K
  • · Replies 5 ·
Replies
5
Views
560
  • · Replies 7 ·
Replies
7
Views
2K