T. Zakharko wrote:
Dear all,
I post this here because I am unsure of who is the current maintainer of the Sweave bundle. The help files list Alan Schussman as author, but as the bundle has last been updated in 2006 I have no idea if he is still responsible for it.
To make the story short: it is sometimes desirable to run Sweave with a custom driver. I need it for literate programming documentation style where I want Sweave to skip the code parsing to allow for chunks containing incomplete R expressions (and I also developed a very simple driver that does just that). A probably more common usage would be invoking the pgfSweave driver instead of the vanilla one.
An option like
%!TEX SWeave= my_driver
would be very nice. I can hack something like this together on my own, but this is a feature which should probably be added to the official distribution.
Thank you,
-- Taras
P.S. I have patched the Sweave bundle's 'Sweave,Typeset and View' command with following:
# get the Sweave driver option DRIVER=`grep -e '^%!TEX Sweave' "$TM_FILEPATH" | sed 's/.*=//g'`
SW=${TM_SWEAVE_WD:=${TM_DIRECTORY}} if [ -n "$DRIVER" ]; then echo -e "setwd('$SW')\nSweave('$TM_FILEPATH', driver=$DRIVER)" | R --no-restore --no-save --quiet | pre else echo -e "setwd('$SW')\nSweave('$TM_FILEPATH')" | R --no-restore --no-save --quiet | pre fi
This replaces the previous R invocation and works reasonably well. Usage is:
%!TEX Sweave= my_driver
Maybe someone could patch it to the official repo...