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.


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 '12 at 21:02
  • @Rasmus: Good point! I have edited it into the answer. – Daniel Aug 21 '12 at 5:42

Your Answer

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

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