You can insert the LaTeX command overset
:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
a \overset{p}{\to} b
\]
\end{document}
Just insert it as red text.
In your preamble you have the following:
\usepackage[breaklinks,colorlinks=true,linkcolor=red,
citecolor=red, urlcolor=blue]{hyperref}
This activates the hyperref
package, which creates clickable hyperlinks of table of contents entries, cross references and similar. With colorlinks=true
these links are given a colour, and as you've specified linkcolor=red
the ToC entries are red. Change the colours to black
, or use
\usepackage[breaklinks,hidelinks]{hyperref}
instead. hidelinks
causes all links to be printed black, as the surrounding text.
If you have activated hyperref
using the LyX interface you need to change this inside the Document --> Settings --> PDF Properties, where Use Hyperref Support will be checked.
There is a box for additional options at the bottom, in here you can add your details, for example
linkcolor=black,citecolor=black
So as my TOC and internal links are in black (rather than the default of red and green). If you have both activated this and added \usepackage{hyperref}
with other options to the LaTeX preamble, you may get errors when viewing the PDF.
Best Answer
Select the text you wish to change the colour of, right click on it, and choose Text style --> Customized. Here you can choose among other things the colour. See screenshots at the bottom.
Should you wish to use other colours, you can redefine the existing colours, by adding some code to the preamble. Go to Document --> Settings --> laTeX Preamble, and add for instance
to change the colour called "green" in the text style dialogue. You cannot add new colour names to the GUI, see http://wiki.lyx.org/Tips/Color
Should you want other colours, you would have to use LaTeX code. Load the
xcolor
package by adding\usepackage{xcolor}
to the preamble, add a code box in the text, by hitting Ctrl + L, and write\textcolor{<colourname>}{This is in colour.}
.<colourname>
can be a colour you have defined yourself using the syntax mentioned above, or one of colours defined byxcolor
– see thexcolor
manual.