Skip to content

CHANGES IN knitr VERSION 0.6.3 and 0.6

Compare
Choose a tag to compare
@yihui yihui released this 25 May 21:32
· 5107 commits to master since this release

CHANGES IN knitr VERSION 0.6.3

MAJOR CHANGES

  • this is a urgent patch version for CRAN: the dependencies on highlight and parser were removed because these two package were orphaned on CRAN; now knitr uses a naive syntax highlighter for LateX and HTML output if highlight is not available, which has a similar appearance with highlight; when the parser package is not available, users should be careful with the chunk option tidy=TRUE: replace.assign may not work as expected; see the NEWS of formatR for details: https://github.com/yihui/formatR/blob/master/NEWS; you are welcome to improve the naive highlighter: https://github.com/yihui/knitr/tree/master/R/highlight.R

NEW FEATURES

  • spin() gained a new argument report for Rnw/Rtex/Rmd documents to be compiled to PDF/HTML respectively (#287) (thanks, kohske takahashi)

BUG FIXES

  • stitch() and spin() should use parent.frame() to evaluate code by default; in 0.6, the default parent frame for the inner knit() was a wrong environment to use (thanks, Michael Nelson)
  • use unnamed-chunk-i as the label when chunk label == '' (#280) (thanks, Josh Paulson)
  • fixed #279 and #281, both of which are about concordance
  • '\\maxwidth' does not apply to LaTeX/PDF animations, so the default value of out.width for animations in LaTeX is still NULL; you will have to set out.width manually for a reasonable width (#282) (thanks, Ramnath Vaidyanathan)

MISC

CHANGES IN knitr VERSION 0.6

NEW FEATURES

  • for LaTeX output, the chunk option out.width defaults to '\\maxwidth' now; see http://yihui.name/knitr/demo/framed/ for its definition; this makes sure the figures do not overflow the page margins (#221)
  • the chunk option size now defines the font size of the whole chunk instead of only some special characters in it, so that the old trick of redefining the knitrout environment for different font sizes is no longer necessary; see updates in the beamer examples: http://yihui.name/knitr/demo/beamer/ (thanks, Baptiste Auguie)
  • added a new chunk option dev.args which can be used to pass more arguments to the graphical device (#254) (thanks, knokknok)
  • warnings, messages and errors will be wrapped according to options('width'); this will make long messages stay within the page margin when the width option is appropriately small (#259) (thanks, @muelleki)
  • added a new function spin() to turn a specially formatted R script to a report; see http://yihui.name/knitr/demo/stitch/ (#223) (thanks, Rich FitzJohn)
  • knit() gained a new argument envir to specify the environment in which to evaluate code chunks (by default in the parent frame); this will allow users to run code in a specified environment so that the global environment will not be cluttered by objects in chunks, which can hopefully make the documents more reproducible (#228)
  • added a new component inline.comment in knit_patterns to strip off tokens of inline R code from inline comments, e.g. a comment line like % x is \Sexpr{x} will become % x is x (#110); this will only happen to LaTeX documents because HTML does not have inline comments (it only has block comments <!-- -->)
  • concordance works for child documents as well now (try RStudio), although it is not very precise (#225); note when concordance is enabled, the results from child documents will be written into the parent output instead of individual tex files; also note you have to set opts_knit$set(self.contained = FALSE) for concordance to work better
  • added an OpenCPU app so that we can run knitr in the cloud now; see system.file('opencpu', 'apps', 'index.html', package = 'knitr') or http://public.opencpu.org/apps/knitr (thanks, Jeroen Ooms)
  • all messages, errors and warnings during evaluation are recorded in an internal object knit_log (use knitr:::knit_log$get() to get all messages) and they are printed if the package option verbose is TRUE (i.e. opts_knit$get('verbose')) (#224)
  • child documents are also supported in other document formats besides LaTeX, e.g. Markdown and HTML, etc; please use the chunk option child to specify the child documents; see system.file('examples', 'child', 'knitr-main.Rmd', package = 'knitr') for an example in markdown (#268) (thanks, @martinaryee)

BUG FIXES

  • the templates for stitch() used results=hide which should really be results='hide' (#219) (thanks, @r2d3)
  • format numbers with the reST syntax instead of HTML (#218) (thanks, Jeffrey Arnold)
  • hook_pdfcrop() should work better under Windows now (#209) (thanks @DCCKC and @r2d3)
  • tikz compilation fails on Windows network drives
  • FFmpeg does not really work for HTML/Markdown output because the dot in figure filenames was omitted (thanks, Ming Kuo)
  • child documents can fail when they are in different sub directories (thanks, Christoph J)
  • set_parent() failed to work in the last version due to a bug when inserting the parent preamble into the child document (#240)
  • better preserve plot sizes in interactive sessions (#258)

MAJOR CHANGES

  • .Random.seed is not cached any more because of weird problems due to lazy loading (#248 and #253); users should use set.seed() to make sure reproducibility of random simulations; the chunk output is cached in a .RData database instead of a lazy load database to avoid problems in #253
  • the default graphics device is set to the null PDF device before evaluating code chunks, i.e. pdf(file = NULL), so that neither Rplots.pdf nor plot windows will be opened during knitting

MINOR CHANGES

  • knitr will show a message when a chunk is empty; this helps users who do not actually want a chunk to be empty realize the problem like #229; in the past, knitr just silently returns an empty string from such chunks
  • knitr will show a message when the cache is loaded and the option opts_knit$get('verbose') is TRUE (#249) (thanks, Carl Boettiger)
  • the filename extensions Snw and Stex are also supported (foo.Snw/foo.Stex produces foo.tex)
  • the HTML output hooks are changed according to the suggestion of Barry Rowlingson (#250) and the default CSS is also slightly modified
  • knit() will no longer try to remove the file NA generated by pdf(file = NULL) before R 2.14.2 (which was a bug and fixed later); you should update R if you see this file

DOCUMENTATION

  • added a minimal brew example under system.file('examples', package = 'knitr')