Skip to main content

Sweave2knitr is a simple Python script that helps to convert Sweave LaTeX documents to be instead compatible with Yihui Xie’s knitr package. It is based on and inspired by Jeromy Anglim’s blog entry, “Converting Sweave LaTeX to knitr LaTeX: A case study.”

Warning: This conversion is not an exact science. While this catches some of the most common issues faced when converting from Sweave to LaTeX, there are a virtually infinite number of special cases that will have to be handled. Furthermore, this is a very early version that has been tested on only a few documents. Try it on your own Sweave documents: contributions are strongly encouraged!

USAGE

If infile.Rnw is your Sweave LaTeX file, use

Sweave2knitr infile.Rnw outfile.nw

You can then use

Rscript -e “library(knitr); knit(‘outfile.nw’, ‘outfile.tex’)” pdflatex outfile.tex

To create the .tex file and turn it into a PDF.

Metadata

Release files for Sweave2knitr 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Sweave2knitr 0.1.4
File Size Uploaded
Sweave2knitr-0.1.4.tar.gz 3.6 kB Details

Release files / Sweave2knitr-0.1.4.tar.gz

Download URL Sweave2knitr-0.1.4.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d9fa0138e136941d084688282c8106ad3d3abc64911c7eec063449b8b2483461
BLAKE2b-256 checksum
How to use checksums
6b7cee7a7512d9b10b0ac89c53aa92933f914110401bf56e4a58204e71085935
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.4 This release

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page