Chapter 4: change case of z; update for new version of knitr