From mboxrd@z Thu Jan 1 00:00:00 1970 From: Austin Frank Subject: org-export-sweave Date: Mon, 01 Sep 2008 09:19:03 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1743354101==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ka9JM-0002Is-Mm for emacs-orgmode@gnu.org; Mon, 01 Sep 2008 09:19:16 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ka9JI-0002IY-6s for emacs-orgmode@gnu.org; Mon, 01 Sep 2008 09:19:15 -0400 Received: from [199.232.76.173] (port=46118 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ka9JH-0002IV-TY for emacs-orgmode@gnu.org; Mon, 01 Sep 2008 09:19:12 -0400 Received: from main.gmane.org ([80.91.229.2]:56792 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ka9JH-0000dO-Iu for emacs-orgmode@gnu.org; Mon, 01 Sep 2008 09:19:12 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Ka9J9-0006VM-1k for emacs-orgmode@gnu.org; Mon, 01 Sep 2008 13:19:03 +0000 Received: from cpe-74-69-93-157.rochester.res.rr.com ([74.69.93.157]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 01 Sep 2008 13:19:03 +0000 Received: from austin.frank by cpe-74-69-93-157.rochester.res.rr.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 01 Sep 2008 13:19:03 +0000 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --===============1743354101== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --=-=-= Content-Transfer-Encoding: quoted-printable Hello! Sweave is a preprocessing step that can be applied to LaTeX files that contain code written in the S or R programming languages. Sweave allows authors to embed their statistical analyses in body of their LaTeX articles, enabling what I find to be a very nice style of literate programming. It seems to me like org currently has all of the functionality needed to be a top-notch Sweave authoring environment, but I can't get the pieces to work correctly together. So this is both a feature request and a request for implementation advice. I'm hoping that it will be possible to add an option for exporting Sweave blocks from org mode. A Sweave block in LaTeX looks like % NB: options are comma separated, spaces are optional \begin{Scode}{opt1=3Dfoo, opt2=3Dbar,opt3=3Dbaz} a <- 3 a \end{Scode} Right now I can easily get this exported using #+LATEX: \begin{Scode}{opt1=3Dfoo, opt2=3Dbar,opt3=3Dbaz} a <- 3 a #+LATEX: \end{Scode} But I would also like to be able to use the native editing mode for writing the code, as happens in #+BEGIN_SRC blocks. I can't currently get a combination of #+BEGIN_SRC and #+LATEX blocks to work. Would it be possible to have something like #+BEGIN_SWEAVE: language opt1=3Dfoo, opt2=3Dbar, opt3=3Dbaz a <- 3 a #+END_SWEAVE where the code inside the SWEAVE block is edited in the appropriate major mode for the language argument? An actual use, then, would look like #+BEGIN_SWEAVE: r fig=3DTRUE, echo=3DFALSE,keep.source=3DTRUE x <- runif(100, 0, 100) y <- runif(100, 0, 100) plot(x ~ y) #+END_SWEAVE C-c ' inside the block would call out to r-mode from the package ESS. LaTeX export would result in \begin{Scode}{fig=3DTRUE, echo=3DFALSE,keep.source=3DTRUE} x <- runif(100, 0, 100) y <- runif(100, 0, 100) plot(x ~ y) \end{Scode} The file output by export to LaTeX should have the extension .Rtex. The author can then run Sweave on the file to generate a .tex file, and then the normal LaTeX compilation process continues. I've started trying to put this together myself, but haven't gotten very far. Some of the existing behavior for exporting source code relies on prefixing the code inside the block with a ':' at the beginning of the line, which then results in a verbatim environment in LaTeX. I can't figure out how to override this selectively for Sweave blocks, while retaining the major-mode switching with C-c '. Thanks for any implementations tips or (even better!) working implementations ;) /au =2D-=20 Austin Frank http://aufrank.net GPG Public Key (D7398C2F): http://aufrank.net/personal.asc --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Darwin) iEYEARECAAYFAki768cACgkQlHMl2/XbR4GewgCfY60cYcc3HwkI/nuKQEEKgGzd xPgAoN+RxK5R40nyeAbqQpuE/fS1qpYT =rB+V -----END PGP SIGNATURE----- --=-=-=-- --===============1743354101== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============1743354101==--