1

My formulae (in mathmode) have a few terms, and I want to change the colour of each term so that I can see multiple colours in one single line. Are there any shortcut keys or easy ways to do this? Now, I will need to copy the part I want, paste it in the textmode so I can see the LaTeX code for that part, and then change it to, i.e. {\color{red} expression}, and finally paste it back to the mathmode so the expression can change colour itself. Are there simpler ways to do this?

  • I don't understand you mean, but {\color{red} x} works fine, e.g. \documentclass{article} \usepackage{xcolor} \begin{document} ${\color{red}x} + {\color{blue}y} = \color{green}z$ \end{document}. You can also use \textcolor{red}{x}. – Torbjørn T. Sep 9 '16 at 12:52
  • I mean now I have to type the code for colouring the text, which is a bit inconvenient. I wonder if lyx offers any 'efficient' ways to do this, like by just clicking a few buttons or shortcut keys (like in MS word). Just like when I want to insert a matrix, I can just click a few buttons to do that without having to know the code for that, unlike when I use some other more traditional latex editors. I want to know if changing colour is also something that can be done easily. – Physicist Sep 9 '16 at 13:00
  • 2
    I was suspecting that you were using LyX, but you didn't say so. It is a rather crucial piece of information. (Most people here don't use LyX.) – Torbjørn T. Sep 9 '16 at 13:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.