1 # Wrapper around Sweave that sets up some things for LyX
2 # argument 1 is the file name
3 # argument 2 is the iconv name for the encoding of the file
5 ls.args <- commandArgs(trailingOnly=T)
7 # check whether Sweave.sty is seen by LaTeX
8 ls.sweavesty <- system("kpsewhich Sweave.sty", intern=T, ignore.stderr=T)
9 ls.sp <- (length(ls.sweavesty) == 0)
11 # set default encoding to the one of the file
12 options(encoding=ls.args[2])
15 Sweave(ls.args[1], stylepath=ls.sp)