I am trying to include python code in my lyx document by inserting a file. I began by trying to use listings but this was causing code to overflow pages. Now I'm using pygments setting it up as described in this tutorial, http://wiki.lyx.org/Examples/IncludeExternalProgramListingUsingPygments. This appears to work fairly well but the code highlighting is off. for instance def and elif keywords are not highlighted and docstrings do not highlight if they are split over multiple lines. I have tried changing the style to a few different built in ones but this hasn't worked. Has anyone got a/ knows of a good way to highlight python code in the same way as idle does. Thanks.
Asked
Active
Viewed 2,162 times