HP Forums

Full Version: Playing with Colors
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
It's possible to add color to LaTex expressions by including the color extensions with "\require{color}" at the start of an equation.

\[

\require{color}

\left(
\color{red}

\begin{array}{cc}
a & \color{green}
\left(
\begin{array}{cc}
\color{blue} \colorbox{yellow}{1} \color{green} & 2 \\
3 & 4
\end{array}
\right) \\
c & d
\end{array}
\right)
\]
Is it possible to request a list of supported packages? (It appears the \require{} command is similar to \usepackage{}.) Let's try:

\[ \require{pst-plot}
\psset{xunit=8mm,yunit=8mm}
\begin{pspicture}(-1.5,-2.5)(4,6)
\psaxes[labels=none,ticks=none](0,0)(-1.5,-2.5)(4,5.5)
\psplot[linecolor=red, linewidth=1pt]%
{-1.5}{3.5}{x x mul 2 x mul sub}
\psdot(-1,3) \uput[r](-1,3){$P=(-1,\hspace{5mm})$}
\psdot(1,-1) \uput[r](1,-1){$Q=(\hspace{5mm},-1)$}
\uput[u](2,-2.5){$f(x)=x^2-2x$}
\end{pspicture}
\]

Oh well, was worth the shot Smile
Take a look at the MathJax extension page. Some of these work, but not all of the ones I've tested so far. Also right click on any formatted expressions below (or eleswhere) and you'll see a bunch of useful display options. The MathJax package is pretty cool.

enclose seems to work, for example:
\[
\require{enclose}
\enclose{circle}[mathcolor="red"]{x}
\enclose{circle}[mathcolor="red"]{\color{black}{x}}
\enclose{circle,box}{x}
\enclose{circle}{\enclose{box}{x}}
\]

cancel seem to work, for example:
\[
\require{cancel}
\cancel{lower left to upper right}
\bcancel{upper left to lower right}
\]

html seems to work, for example:
\[
\require{html}
calculator ^ \href{http://www.wass.net/manuals}{manuals}

\]
Black
Gray
Silver
White
Yellow
Lime
Aqua
Fuchsia
Red
Green
Blue
Purple
Maroon
Olive
Navy
Teal

More, by groups: https://www.w3schools.com/colors/colors_groups.asp
Reference URL's