Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm writing a LaTeX document using Sweave (a Beamer presentation, really), which weaves R code and LaTeX. Is there a way to make my chunks of code and its output highlighted? I could use listings package but that would mean I would have to rummage through the .tex file and wrap all Schunks so I'm looking for perhaps more elegant solutions if currently available.

share|improve this question
add comment

1 Answer

up vote 12 down vote accepted

The SweaveListingUtils package contains additions to Sweave that enables pretty-printing input and output using the LaTeX listings package. Example usage can be found in the vignette.

Another alternative is to override the Schunk, Sinput and Soutput environments using \renewenvironment so that they do whatever you want them to.

share|improve this answer
    
"Continued" at Stackoverflow: stackoverflow.com/questions/4808052/… –  Roman Luštrik Jan 27 '11 at 10:32
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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