Math formatting "Pro Tips" edition: Adding color to your answers! - "?"

3 Answers
Mar 21, 2015

I was playing around with mathjax the other day and I stumbled upon a way of adding color to a text.

I don't know if this could actually be useful or not, but I already know where I'll use color - stoichiometric coefficients, mole ratios, stuff like that.

The syntax looks like this

color(whatever color you want)(whatever text or math you want)

Here are some examples

  • without the hashtags

color(red)(2 + 2 + 2)

  • with the hashtags

2+2+2

  • without the hashtags

color(blue)(2 + 2 + 2)

  • with the hashtags

2+2+2

Other examples:

ax2+bx+c

2C2H6+7O24CO2+6H2O

If you use color(black)(whatever), it will act as a regular bold text

Testing, testing...

Addendum

You can use color(white)(text) to write invisible characters. This is very useful for spacing issues

  • without the hashtags

color(white)(222)

  • with the hashtags

222 you can't see it, but it's there! Highlight it using your mouse!

Jun 18, 2015

Put hashtags around the following:

(color)("the type of color you want")("text you want to color")

Explanation:

For example, if I wanted to color the equation x2+1

hashtag (color)(blue)(x^2+1) hashtag

x2+1

hashtag (color)(green)(x^2+1) hashtag

x2+1

hashtag (color)(red)(x^2+1) hashtag

x2+1

Press the edit answer button for this question if you want to take a look at the code.

Sep 27, 2016

This is an old (but still useful) answer; here are the possible values for "color" that can be used. Obviously many of these are too light to be useful. (Thanks to Tony B for suggesting these).

Explanation:

aliceblue: aliceblue

antiquewhite: antiquewhite

aqua: aqua

aquamarine: aquamarine

azure: azure

beige: beige

bisque: bisque

black: black

blanchedalmond: blanchedalmond

blue: blue

blueviolet: blueviolet

brown: brown

burlywood: burlywood

cadetblue: cadetblue

chartreuse: chartreuse

chocolate: chocolate

coral: coral

cornflowerblue: cornflowerblue

cornsilk: cornsilk

crimson: crimson

cyan: cyan

darkblue: darkblue

darkcyan: darkcyan

darkgoldenrod: darkgoldenrod

darkgray: darkgray

darkgreen: darkgreen

darkkhaki: darkkhaki

darkmagenta: darkmagenta

darkolivegreen: darkolivegreen

darkorange: darkorange

darkorchid: darkorchid

darkred: darkred

darksalmon: darksalmon

darkseagreen: darkseagreen

darkslateblue: darkslateblue

darkslategray: darkslategray

darkturquoise: darkturquoise

darkviolet: darkviolet

deeppink: deeppink

deepskyblue: deepskyblue

dimgray: dimgray

dodgerblue: dodgerblue

firebrick: firebrick

floralwhite: floralwhite

forestgreen: forestgreen

fuchsia: fuchsia

gainsboro: gainsboro

ghostwhite: ghostwhite

gold: gold

goldenrod: goldenrod

gray: gray

green: green

greenyellow: greenyellow

honeydew: honeydew

hotpink: hotpink

indianred: indianred

indigo: indigo

ivory: ivory

khaki: khaki

lavender: lavender

lavenderblush: lavenderblush

lawngreen: lawngreen

lemonchiffon: lemonchiffon

lightblue: lightblue

lightcoral: lightcoral

lightcyan: lightcyan

lightgoldenrodyellow: lightgoldenrodyellow

lightgreen: lightgreen

lightgray: lightgray

lightmagenta: lightmagenta

lightpink: lightpink

lightsalmon: lightsalmon

lightseagreen: lightseagreen

lightskyblue: lightskyblue

lightslategray: lightslategray

lightsteelblue: lightsteelblue

lightyellow: lightyellow

lime: lime

limegreen: limegreen

linen: linen

magenta: magenta

maroon: maroon

mediumaquamarine: mediumaquamarine

mediumblue: mediumblue

mediumorchid: mediumorchid

mediumpurple: mediumpurple

mediumseagreen: mediumseagreen

mediumslateblue: mediumslateblue

mediumspringgreen: mediumspringgreen

mediumturquoise: mediumturquoise

mediumvioletred: color(mediumvioletred)("mediumvioletred")mediumvioletred

midnightblue: color(midnightblue)("midnightblue")midnightblue

mintcream: color(mintcream)("mintcream")mintcream

mistyrose: color(mistyrose)("mistyrose")mistyrose

moccasin: color(moccasin)("moccasin")moccasin

navajowhite: color(navajowhite)("navajowhite")navajowhite

navy: color(navy)("navy")navy

oldlace: color(oldlace)("oldlace")oldlace

olive: color(olive)("olive")olive

olivedrab: color(olivedrab)("olivedrab")olivedrab

orange: color(orange)("orange")orange

orangered: color(orangered)("orangered")orangered

orchid: color(orchid)("orchid")orchid

palegoldenrod: color(palegoldenrod)("palegoldenrod")palegoldenrod

palegreen: color(palegreen)("palegreen")palegreen

paleturquoise: color(paleturquoise)("paleturquoise")paleturquoise

palevioletred: color(palevioletred)("palevioletred")palevioletred

papayawhip: color(papayawhip)("papayawhip")papayawhip

peachpuff: color(peachpuff)("peachpuff")peachpuff

peru: color(peru)("peru")peru

pink: color(pink)("pink")pink

plum: color(plum)("plum")plum

powderblue: color(powderblue)("powderblue")powderblue

purple: color(purple)("purple")purple

red: color(red)("red")red

rosybrown: color(rosybrown)("rosybrown")rosybrown

royalblue: color(royalblue)("royalblue")royalblue

saddlebrown: color(saddlebrown)("saddlebrown")saddlebrown

salmon: color(salmon)("salmon")salmon

sandybrown: color(sandybrown)("sandybrown")sandybrown

seagreen: color(seagreen)("seagreen")seagreen

seashell: color(seashell)("seashell")seashell

sienna: color(sienna)("sienna")sienna

silver: color(silver)("silver")silver

skyblue: color(skyblue)("skyblue")skyblue

slateblue: color(slateblue)("slateblue")slateblue

slategray: color(slategray)("slategray")slategray

snow: color(snow)("snow")snow

springgreen: color(springgreen)("springgreen")springgreen

steelblue: color(steelblue)("steelblue")steelblue

tan: color(tan)("tan")tan

teal: color(teal)("teal")teal

thistle: color(thistle)("thistle")thistle

tomato: color(tomato)("tomato")tomato

turquoise: color(turquoise)("turquoise")turquoise

violet: color(violet)("violet")violet

wheat: color(wheat)("wheat")wheat

white: color(white)("white")white

whitesmoke: color(whitesmoke)("whitesmoke")whitesmoke

yellow: color(yellow)("yellow")yellow

yellowgreen: color(yellowgreen)("yellowgreen")yellowgreen