在使用Knitr时出现了 错误,请问有谁知道原因吗,谢谢。
Error in if (format == "latex") { : argument is of length zero
`library(pander)
library(knitr)
panderOptions('round', 2)
figWidth = 8*sqrt(2)
figHeight = 8
figpath = "figures/"
mapFormat = "pdf"
knitr::opts_chunk$set(fig.width=figWidth,
fig.height=figHeight,
fig.path=figpath,
#dev="pdf",
dev="tikz",
cache=TRUE,
external=TRUE
#size='small',
)
#options(tikzMetricsDictionary="~/R/tikzMetrics") # speeds tikz up
options(tikzDefaultEngine='luatex')
options(tikzDocumentDeclaration = "\\documentclass[10pt]{standalone}\n\\renewcommand{\\familydefault}{\\sfdefault}\n\\usepackage{newtxsf}")
options(tikzMetricPackages = c(
"\\renewcommand{\\familydefault}{\\sfdefault}",
"\\usepackage{newtxsf}",
"\\usepackage{lmodern}",
"\\usetikzlibrary{calc}"
))
thm = knit_theme$get("biogoo") # parse the theme to a list
knit_theme$set(thm)`