Maintainer: Wataru Shito


  • JSweave 0.2 is released. (2006/03/01)
    Stangle feature and internationalization support are added. Use '-stangle' command option to tangle the document (to extract the R code). Use '-encoding' option to specify the character encoding.

What is JSweave?

JSweave is a free Java program (Apache License) that produces a LaTeX document combined with the output from R, the statistical package. By embedding R source code into a LaTeX document with a markup tag, JSweave will insert an R output and create a new LaTeX document. The graphs are inserted automatically as well. JSweave can also be used to extract R source code from the document.

The combination of a documentation and programming code for readability is called literate programming named by Donald Knuth in his book. The statistical package R provides a literate programming tool for S language called Sweave. JSweave is just a superset of Sweave and provides additional features. A summary of the extended features are:

  1. flexible code reuse,
  2. presenting the source style without input prompt,
  3. compact verbatim format,
  4. internationalization support.

See JSweave Manual for more details.

Because JSweave is just an extention of Sweave, you can process the original Sweave document and see the difference in the output if you are familiar with Sweave.


To run JSweave, you need a shell (sh) and a Java run time environment later than 1.5.0 as well as a version of R later than 2.1.0.

At the moment, JSweave only provides the final TeX document under UNIX style environment (including MacOS X) since JSweave requires a shell program (I have not checked with cigwin under Windows.).

To build the binary from the source you need Java SDK and Jakarta Ant. The latest official build is done under Java SDK 1.5.0 with Jakarta Ant 1.6.2. It should be no problem if the environment has newer versions of those.

If you find any bugs, please report them to me.