scriptsdir = $(pkgdatadir)/scripts
dist_scripts_DATA = \
scripts/bash_completion \
+ scripts/lyxstangle.R \
scripts/lyxsweave.R
# Note that we "chmod 755" manually these files in install-data-hook.
dist_scripts_PYTHON = \
\Format platex tex "LaTeX (pLaTeX)" "" "" "%%" "document,menu=export"
\Format literate nw NoWeb N "" "%%" "document,menu=export"
\Format sweave Rnw "Sweave" S "" "%%" "document,menu=export"
+\Format r R "R/S code" "" "" "%%" "document,menu=export"
\Format lilypond ly "LilyPond music" "" "" "%%" "vector"
\Format lilypond-book lytex "LilyPond book (LaTeX)" "" "" "%%" "document,menu=export"
\Format latex tex "LaTeX (plain)" L "" "%%" "document,menu=export"
\converter sweave xetex "%%" ""
\converter sweave luatex "%%" ""'''])
#
+ checkProg('a Sweave -> R/S code converter', ['Rscript --verbose --no-save --no-restore $$s/scripts/lyxstangle.R $$i $$e $$r'],
+ rc_entry = [ r'\converter sweave r "%%" ""' ])
+ #
checkProg('an HTML -> LaTeX converter', ['html2latex $$i', 'gnuhtml2latex $$i', \
'htmltolatex -input $$i -output $$o', 'java -jar htmltolatex.jar -input $$i -output $$o'],
rc_entry = [ r'\converter html latex "%%" ""' ])
--- /dev/null
+## file lyxstangle.R
+## This file is part of LyX, the document processor.
+## Licence details can be found in the file COPYING.
+
+## author Yihui Xie
+
+## Full author contact details are available in file CREDITS
+
+## Rscript $$s/scripts/lyxstangle.R $$i $$e $$r
+
+.cmdargs = commandArgs(TRUE)
+
+options(encoding = .cmdargs[2])
+
+## run Stangle to extract R code
+Stangle(.cmdargs[1])