Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm trying to color specific text in LyX, wondering how to do that with the graphical user interface (shortcut or something of sorts).

share|improve this question

migrated from stackoverflow.com Oct 31 '11 at 14:29

This question came from our site for professional and enthusiast programmers.

1 Answer 1

up vote 8 down vote accepted

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

\definecolor{green}{RGB}{0, 180, 0}

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 by xcolor – see the xcolor manual.

enter image description here enter image description here

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.