Is it possible to show syntax highlighting in the "Insert TeX code" boxes in LyX?

This would be very handy when one wants to input something longer using code.

1 Answer 1


No, not at the moment.

According to the LyX bug tracker (http://www.lyx.org/trac/ticket/4343) this has been a longly requested feature and the LyX developers are still on it – with recent changes giving some hope that this might be available in a next major release.

For larger parts of ERT (evil red text = LyXism for inserted (La)TeX code) I generally employ an external editor and use Copy & Paste to move the code between LyX and my Editor. Instead of Copy & Paste one can also maintain the the TeX code in an external .tex file inserted with File > Insert > Child Document (Include Type = Input), which is useful during development or for maintaining larger parts of code.

  • Thank you. I have found I can use File > Insert > Child Document then set Include Type to Input and then use a .tex document with only the code I would have inserted in the ERT field -- that's another workaround.
    – Rasmus
    Aug 20, 2012 at 21:02
  • @Rasmus: Good point! I have edited it into the answer.
    – Daniel
    Aug 21, 2012 at 5:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .