How to color comment in Program Listing ?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to color comment in Program Listing ?

nikhilmallela
Hello,

I am a newbie to Lyx & Latex. For now, I have wasted a lot time in trying to make my text look like this but was unsuccessful. Hope you could give me some tips on how to achieve the look as you see in the attachment figure.

1) How to paste the console output into lyx without loosing the indentation ?
2) How to get those green comments beside the code ?
3) How to get that blue box with blue text inside ?

Thanks a lot,
Nikhil.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to color comment in Program Listing ?

DavGar
You can do this with various LaTeX packages for example Listings.

However for SAS or R the best bet is the SASandRDisplay package.
See http://ctan.org/pkg/sasnrdisplay

It has lots of options but works well (for examples of it in use see 'Reprogramming a Many-to-Many Merge with Hash Objects' http://www.phusewiki.org/docs/2012/PAPERS/CS/CS05.pdf)

If you are using R you might want to consider using Knitr instead of LyX.


Loading...