fix color hook for newer knitr versions
Newer knitr injects \usepackage[]{xcolor} instead of \usepackage[]{color},
so the old hook never matched and dvipsnames colors (e.g. Blue) were undefined.
This commit is contained in:
@@ -12,8 +12,11 @@
|
||||
|
||||
<<init, echo=FALSE>>=
|
||||
knit_hooks$set(document = function(x) {
|
||||
sub('\\usepackage[]{color}',
|
||||
'\\usepackage[usenames,dvipsnames]{color}', x, fixed = TRUE)
|
||||
x <- sub('\\usepackage[]{color}',
|
||||
'\\usepackage[usenames,dvipsnames]{color}', x, fixed = TRUE)
|
||||
x <- sub('\\usepackage[]{xcolor}',
|
||||
'\\usepackage[usenames,dvipsnames]{xcolor}', x, fixed = TRUE)
|
||||
x
|
||||
})
|
||||
opts_chunk$set(fig.path="figures/knitr-")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user