Edit: how to colour an edited formula

Click For Summary

Discussion Overview

The discussion revolves around how to color specific parts of LaTeX formulas within text, particularly in the context of using MathJax for rendering. Participants explore various methods and applications of coloring elements in equations, including challenges and solutions related to formatting.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • Some participants inquire about the specific applications for coloring LaTeX formulas.
  • One participant suggests using \bf or \Large to format equations, but notes it may be tedious for specific items.
  • A participant expresses a desire to color only certain parts of the formula F=ma within a sentence.
  • Another participant discusses the challenge of coloring a specific part of a more complex formula and suggests breaking the sentence into two LaTeX parts.
  • Experimentation with different LaTeX color commands is shared, including examples of colored variables.
  • One participant references a MathJax extension for coloring and provides examples of how it should work.
  • There are mentions of configuration issues with MathJax and suggestions for improvements.
  • Participants share examples of using color boxes and colored text in LaTeX, indicating various formatting options.

Areas of Agreement / Disagreement

Participants express various methods and challenges regarding coloring LaTeX formulas, with no clear consensus on the best approach or solution. Some agree on the need for configuration fixes, while others explore different formatting techniques.

Contextual Notes

There are unresolved issues regarding the use of MathJax extensions and potential configuration problems that affect the ability to color LaTeX effectively.

mcastillo356
Gold Member
Messages
658
Reaction score
361
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   Reactions: 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   Reactions: 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   Reactions: 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 6 ·
Replies
6
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 22 ·
Replies
22
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 27 ·
Replies
27
Views
3K
Replies
3
Views
4K
  • · Replies 5 ·
Replies
5
Views
741