当我收到“资源路径中找不到文件”错误时如何解决问题?

当我在我的 rmarkdown 文档中运行 knit 时,它一开始似乎可以工作,但最终会出现以下错误消息。

output file: paper-1_revised.knit.md

File  not found in resource path
Error: pandoc document conversion failed with error 99
Execution halted

我几乎检查了 includegraphics 中使用的图片的每条路径,但它们对我来说似乎是正确的。有什么方法可以修复或找到我的资源路径问题在我的代码中的位置?

---
title: "Model"
author: |
  | jj
date: '2020-04-20'
header-includes:
- usepackage{amsmath}
- usepackage{tikz}
- usepackage{caption}
- usepackage{pgfplots}
- usepackage[makeroom]{cancel}
- usetikzlibrary{arrows,decorations.markings}
- usetikzlibrary{intersections}
- usepackage{biblatex}
- usepackage[nottoc]{tocbibind}
- usepackage{filecontents}
- addbibresource{jobname.bib}
- usepackage[T1]{fontenc}
- usepackage[utf8]{inputenc}
- usepackage{tabularx,ragged2e,booktabs,caption}
- newenvironment{rcases}
  {left.begin{aligned}}
  {end{aligned}rightrbrace}

bibliography: 
subparagraph: true
toc: false
number_sections: true
output: pdf_document
fig_caption: yes
fig_height: 5
fig_width: 8
includes:
in_header: preamble.tex
keep_tex: yes
citation_package: biblatex
---
providecommand{keywords}[1]{textbf{textit{key words---}} #1}

`r ''```  `{r, include=FALSE, echo=FALSE}
beta1<-0.99
beta2<-0.95
varphi<-0.12
alpha<-0.2
delta<-0.01
g<-0.02
rho<-0.8
y.n<-1.778279
k.n<-17.78279
h1.n1<-5.5246
h2.n2<-1.6545
ih1.n1<-0.1934
ih2.n2<-0.0579
ik.n<-0.6224
w<-1.4226
r<-0.02
q<-0.8569
c1.n1<-0.7851
c2.n2<-1.3288
n1<-1.3461
n2<-1.0347
n.1<-log(1.3461)
n.2<-log(1.0347)
n<-n1+n2
nl<-log(n)
y<-log(y.n*n)
k<-log(k.n*n)
h1<-log(h1.n1*n1)
h2<-log(h2.n2*n2)
ih1<-log(ih1.n1*n1)
ih2<-log(ih2.n2*n2)
ik<-log(ik.n*n)
c1<-log(c1.n1*n1)
c2<-log(c2.n2*n2)
z<-1
zeta<-c(y=y, c1=c1, c2=c2, k=k, ik=ik, h1=h1, h2=h2, ih1=ih1, ih2=ih2, n.1=n.1, n.2=n.2, nl=nl,z=1)

Psi <- function(zt1, zt){
#NOTE: Variables are their logarithm.
res <- matrix(NA, nrow = 13, ncol = 1)
res[1, 1] <- zt[10] + zt[2] - log(w)
res[2, 1] <- -log(6.03)-zt[6]+log(varphi/exp(zt[6])+(1+g)^(1/(1-alpha))*beta1*6.0302*(1-delta)/exp(zt1[6]))    
res[3, 1] <- log(beta1)+zt[2] - zt1[2] +log(r+1-delta)
res[4, 1] <- zt[11] -zt[3]-log(w) 
res[5, 1] <- -log(2.0168)-zt[7]+log(varphi/exp(zt[7])+(1+g)^(1/(1-alpha))*beta2*2.0168*(1-delta)/exp(zt1[7]))    
res[6, 1] <- zt[1]-zt[13]-alpha*zt[4]-(1-alpha)*zt[12]
res[7, 1] <- zt[1] -log(exp(zt[2])+exp(zt[3])+exp(zt[8])+exp(zt[9])+exp(zt[5]))
res[8,1]<-(1/(1-alpha))*log(1+g)+zt1[4]-log(exp(zt[5])+(1-delta)*exp(zt[4]))
res[9,1]<-(1/(1-alpha))*log(1+g)+zt1[6]-log(exp(zt[8])+(1-delta)*exp(zt[6]))
res[10,1]<-(1/(1-alpha))*log(1+g)+zt1[7]-log(exp(zt[9])+(1-delta)*exp(zt[7]))
res[11,1]<-log(exp(zt[2])+exp(zt[8])*6.0302*exp(zt[2])/exp(zt[6])+exp(zt[5]))-log(w*exp(zt[10])+r*exp(zt[4]))
res[12,1]<-log(exp(zt[3])+exp(zt[9])*2.0168*exp(zt[3])/exp(zt[7]))-log(w)-zt[11]  
res[13,1]<-zt1[13]-rho*zt[13]
 return(res)}

Psi(zeta, zeta)
A<- matrix(NA, 13, 13)
B<- matrix(NA, 13, 13)
for(i in 1:13){
  curz <- zeta;
  curz[i] <- curz[i]+0.00001
  PsiP <- Psi(curz, zeta)
  A[, i] <- (PsiP - 0)
  PsiP <- Psi(zeta, curz)
  B[, i] <- -(PsiP - 0)}
round(A, 4)
round(B, 4)
structure <- c(alpha = alpha, beta1 = beta1, beta2=beta2, varphi = varphi, delta = delta, rho = rho, g=g)
save(A, B, zeta, structure, file="laterUse")

`  `` 

 `` `
stack overflow How to fix the problem when I get "File not found in resource path" error?
原文答案

答案:

作者头像

我有一个类似的问题。

我尝试编织文档。

___
...
    includes:
      in_header: ~/Dropbox/styles/style.sty
  bookdown::pdf_book:
    citation_package: biblatex
bibliography: ~/Dropbox/literature.bib
csl: ~/Dropbox/styles/apa.csl
...
___

pandoc document conversion failed with error 99

File ~/Dropbox/styles/apa.csl not found in resource path

有趣的是它为此工作

in_header: ~/Dropbox/styles/style.sty 我仅使用此选项尝试过。

但不适合.csl

我不知道发生了什么...

相关问题