benjorino
April 30th, 2009, 08:50 AM
Hi,
I've got a load of C++ and C code that I need to put in a lyx document, does anybody know how to do this, while preserving syntax highlighting and indentation?
I have tried:
K-develop --> HTML --> copy/paste to odt --> open odt with lyx
the above, but using writer2latex and then opening the tex file
I've tried http://cpp2latex.geodar.com/ but it wouldnt preserve the highlighting. I can't get the command line version to work for some reason.
I've tried various other things like copying/pasting the raw tex into an ERT box in lyx instead of importing etc... without luck so far.
The closest I've come to success is to get the syntax highlighting without indentation. There's too much code to put it in manually.
Does anybody know an easy way to do this? Its getting frustrating. I'm running out of time to do this report and this has already taken a lot of my time. I don't have time to learn to write much actual latex code unless its pretty simple stuff.
Hope this is in the right forum
Thanks,
Ben
I've got a load of C++ and C code that I need to put in a lyx document, does anybody know how to do this, while preserving syntax highlighting and indentation?
I have tried:
K-develop --> HTML --> copy/paste to odt --> open odt with lyx
the above, but using writer2latex and then opening the tex file
I've tried http://cpp2latex.geodar.com/ but it wouldnt preserve the highlighting. I can't get the command line version to work for some reason.
I've tried various other things like copying/pasting the raw tex into an ERT box in lyx instead of importing etc... without luck so far.
The closest I've come to success is to get the syntax highlighting without indentation. There's too much code to put it in manually.
Does anybody know an easy way to do this? Its getting frustrating. I'm running out of time to do this report and this has already taken a lot of my time. I don't have time to learn to write much actual latex code unless its pretty simple stuff.
Hope this is in the right forum
Thanks,
Ben