Hi Daniel Where and how do I get this 'listings' package? I looked on the LyX homepage and on the Wiki but couldn't find it.
The 'highlight' approach from Gunnar Lindholm is quite separate though, right -- no connection at all? Cheers JP Daniel Lohmann wrote: > John Pye wrote: > >> Hi all >> >> I know that this has 'been done' but I'm not sure how to go about it >> myself. I would like to link to an external source code file and 'pull >> it in' to my compiled document when I use pdflatex. I would like to >> apply source code highlighting, although that's not essential (the >> language I'm using is not one that is supported by any of the tools). >> >> I worked out how to import external code, but not how to maintain a >> link. Do I need to use ERT? Can LyX be set to use 'highlight' on-the-fly >> as for graphics formats, or must I prepare the latex by hand? >> > > > Hi John, > > I strongly recommend the listings package for this purpose, which > provides excellent means to print and format listings, highlight your > own identifiers, refer to line number etc. And it comes with a very good > documentation. > > You need to do that in ERT, though. However, this is very simple. Take a > look at the attached example. > > > Daniel > >