Created
May 25, 2012 20:21
-
-
Save yihui/2790354 to your computer and use it in GitHub Desktop.
I love Sweave
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass{article} | |
\DefineVerbatimEnvironment{Sinput}{Verbatim}{xleftmargin=2em, | |
fontsize=\footnotesize, fontshape=sl} | |
\DefineVerbatimEnvironment{Soutput}{Verbatim}{xleftmargin=2em, | |
fontsize=\footnotesize} | |
\fvset{listparameters={\setlength{\topsep}{0pt}}} | |
\renewenvironment{Schunk}{\vspace{\topsep}}{\vspace{\topsep}} | |
\begin{document} | |
<<setup, include=FALSE>>= | |
render_sweave() | |
@ | |
The quick brown fox jumps over the lazy dog the quick brown fox jumps over the | |
lazy dog the quick brown fox jumps over the lazy dog. | |
<<test>>= | |
1+1 | |
rnorm(30) | |
@ | |
The quick brown fox jumps over the lazy dog the quick brown fox jumps over the | |
lazy dog the quick brown fox jumps over the lazy dog. | |
\end{document} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass{article} | |
\usepackage{Sweave} | |
\begin{document} | |
This is how knitr looks like: | |
<<knitr-block, foo=render_latex()>>= | |
1+1 | |
rnorm(5) | |
@ | |
This is how Sweave looks like: | |
<<sweave-block, foo=render_sweave()>>= | |
<<knitr-block>> | |
@ | |
<<setup-preamble, include=FALSE>>= | |
render_latex() | |
set_header(highlight = knitr:::.header.hi.tex) | |
@ | |
\end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment