#\DeclareLyXModule[graphicx.sty,fancyvrb.sty,tikz.sty,pgfsweave->latex]{pgfSweave} #DescriptionBegin #Allows to use the R language as a literate programming tool via the pgfSweave package. Major differences with Sweave: pgfSweave supports cache for both R objects (the cacheSweave package) and graphics (tikz externalization); it uses tikz graphics by default which has consistent styles with the LaTeX document; R code highlighted by default (the highlight package); chunk option 'tidy' to reformat R code (the formatR package). #See pgfsweave.lyx in examples. #DescriptionEnd #Category: literate #Excludes: lilypond | sweave Format 35 OutputType literate OutputFormat pgfsweave ClassOptions Other "noae" End Preamble %\usepackage{Sweave} \ifdefined\Sinput \else \IfFileExists{Sweave.sty}{ \usepackage{Sweave} }{ \usepackage{graphicx,fancyvrb} \DefineVerbatimEnvironment{Sinput}{Verbatim}{fontshape=sl} \DefineVerbatimEnvironment{Soutput}{Verbatim}{} \DefineVerbatimEnvironment{Scode}{Verbatim}{fontshape=sl} \newenvironment{Schunk}{}{} \newcommand{\Sconcordance}[1]{% \ifx\pdfoutput\undefined% \csname newcount\endcsname\pdfoutput\fi% \ifcase\pdfoutput\special{##1}% \else% \begingroup% \pdfcompresslevel=0% \immediate\pdfobj stream{##1}% \pdfcatalog{/SweaveConcordance \the\pdflastobj\space 0 R}% \endgroup% \fi} } \fi \usepackage{tikz} EndPreamble Style Chunk Category Sweave LatexType Paragraph LatexName dummy AlignPossible Block, Left, Right, Center TopSep 0.7 BottomSep 0.7 NewLine 0 FreeSpacing 1 PassThru 1 ParbreakIsNewline 1 Spellcheck 0 TextFont Color latex Family Typewriter EndFont End Style Scrap ObsoletedBy Chunk End InsetLayout "Flex:Sweave Options" LabelString "Sweave opts" LatexType Command LaTexName SweaveOpts LyXType Custom Decoration Classic Font Color latex Family typewriter EndFont LabelFont Color latex Size Small EndFont MultiPar false PassThru 1 ParbreakIsNewline 1 Spellcheck 0 FreeSpacing true ForceLTR true End InsetLayout "Flex:S/R expression" LabelString "S/R expr" LatexType Command LaTexName Sexpr LyXType Custom Decoration Conglomerate Font Color latex Family typewriter EndFont LabelFont Color latex Size Small EndFont MultiPar false PassThru 1 ParbreakIsNewline 1 Spellcheck 0 FreeSpacing true ForceLTR true End InsetLayout "Flex:Sweave Input File" LabelString "Sweave Input File" LatexType Command LaTexName SweaveInput LyXType Custom Decoration Classic Font Color latex Family typewriter EndFont LabelFont Color latex Size Small EndFont MultiPar false PassThru 1 ParbreakIsNewline 1 Spellcheck 0 FreeSpacing true ForceLTR true End