Skip to content

Commit

Permalink
no need to restore opts_knit and opts_chunk on my side; fixed #105
Browse files Browse the repository at this point in the history
the old approach of restoring options is buggy due to some NULL items in the list
  • Loading branch information
yihui committed Jan 25, 2012
1 parent 7c1e371 commit 9f36873
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions R/output.R
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,8 @@ knit = function(input, output, tangle = FALSE, text = NULL) {
}

owd = setwd(dirname(input)); on.exit(setwd(owd), add = TRUE)
optk = opts_knit$get(); on.exit(opts_knit$set(optk), add = TRUE)
optc = opts_chunk$get(); on.exit(opts_chunk$set(optc), add = TRUE)
opts_knit$set(input.dir = getwd()) # record current working dir
if (is.null(optk$out.format)) {
if (is.null(opts_knit$get('out.format'))) {
fmt =
switch(ext, rnw = 'latex', tex = 'latex', html = 'html', md = 'jekyll',
brew = 'brew',
Expand Down

0 comments on commit 9f36873

Please sign in to comment.