Permalink
Browse files

check formals()$encoding instead of knitr version, per JMarc's sugges…

…tion
  • Loading branch information...
1 parent b97fc95 commit 98f120fe437c4a32a7af828346b8a3880c893b4d @yihui committed Jan 17, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 scripts/lyxknitr.R
View
2 scripts/lyxknitr.R
@@ -30,7 +30,7 @@ setwd(.cmdargs[4])
opts_knit$set(root.dir = getwd())
## run knit() to get .tex or .R
-if (packageVersion('knitr') < '1.0') {
+if (is.null(formals(knit)$encoding)) {
.orig.enc = getOption("encoding")
options(encoding = .cmdargs[3])
knit(.cmdargs[1], output = .cmdargs[2], tangle = 'tangle' %in% .cmdargs)

0 comments on commit 98f120f

Please sign in to comment.