Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dgrtwo/sweave2knitr
Convert Sweave LaTeX documents to work with knitr.
https://github.com/dgrtwo/sweave2knitr
Last synced: 2 months ago
JSON representation
Convert Sweave LaTeX documents to work with knitr.
- Host: GitHub
- URL: https://github.com/dgrtwo/sweave2knitr
- Owner: dgrtwo
- Created: 2012-07-27T19:18:23.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-04-08T19:23:55.000Z (over 10 years ago)
- Last Synced: 2024-10-09T22:05:40.796Z (3 months ago)
- Language: Python
- Size: 123 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
Sweave2knitr
============*ATTENTION*: This package is now **deprecated**- instead use the Sweave2knitr function built into knitr (described [here](http://yihui.name/knitr/demo/sweave/)).
Sweave2knitr is a simple Python script that helps to convert [Sweave](http://www.statistik.lmu.de/~leisch/Sweave/) LaTeX documents to be instead compatible with Yihui Xie's [knitr](http://yihui.name/knitr/) package. It is based on and inspired by Jeromy Anglim's blog entry [ Converting Sweave LaTeX to knitr LaTeX: A case study ](http://jeromyanglim.blogspot.com/2012/06/converting-sweave-latex-to-knitr-latex.html).
*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!
Installation
------------You can install Sweave2knitr from the [Python Package Index](http://pypi.python.org/pypi) using:
easy_install Sweave2knitr
or using pip:
pip install Sweave2knitr
(On Linux or Macs, you might need to add `sudo` to the start of each command). You can also install it from source:
python setup.py build
python setup.py installUsage
-----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.texTo create the .tex file and turn it into a PDF.