Edit: how to colour an edited formula

AI Thread Summary
The discussion focuses on how to color specific parts of LaTeX equations in a forum context, particularly using the equation F=ma as an example. Users explore methods to apply color to certain elements within equations, such as using the color extension in MathJax. It is noted that to colorize parts of an equation embedded in a sentence, the sentence may need to be split into separate LaTeX parts. Various formatting options are discussed, including the use of commands like \color and \require to achieve the desired effects. The conversation also touches on recent updates in MathJax that have simplified the process, eliminating the need for certain workarounds. Overall, the thread emphasizes the importance of proper syntax and the potential for enhanced visual representation in mathematical expressions.
mcastillo356
Gold Member
Messages
634
Reaction score
342
TL;DR Summary
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:
 
Back
Top