title: How to fix the problem when I get "File not found in resource path" error?
body: <p>When I run <code>knit</code> in my rmarkdown document, it seems to work at first but eventually the following error message shows up.</p>
  <pre><code>output file: paper-1_revised.knit.md
  
  File  not found in resource path
  Error: pandoc document conversion failed with error 99
  Execution halted
  </code></pre>
  <p>I checked pretty much every path for pictures used in <code>\includegraphics</code>, but they seem correct to me.
  Is there any way I can fix or locate where my resource path problem lies in my code?</p>
  <pre><code>---
  title: &quot;Model&quot;
  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}\right\rbrace}
  
  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}
  
  </code></pre>
  <pre class="lang-markdown prettyprint-override"><code>`r ''````{r, include=FALSE, echo=FALSE}
  beta1&lt;-0.99
  beta2&lt;-0.95
  varphi&lt;-0.12
  alpha&lt;-0.2
  delta&lt;-0.01
  g&lt;-0.02
  rho&lt;-0.8
  y.n&lt;-1.778279
  k.n&lt;-17.78279
  h1.n1&lt;-5.5246
  h2.n2&lt;-1.6545
  ih1.n1&lt;-0.1934
  ih2.n2&lt;-0.0579
  ik.n&lt;-0.6224
  w&lt;-1.4226
  r&lt;-0.02
  q&lt;-0.8569
  c1.n1&lt;-0.7851
  c2.n2&lt;-1.3288
  n1&lt;-1.3461
  n2&lt;-1.0347
  n.1&lt;-log(1.3461)
  n.2&lt;-log(1.0347)
  n&lt;-n1+n2
  nl&lt;-log(n)
  y&lt;-log(y.n*n)
  k&lt;-log(k.n*n)
  h1&lt;-log(h1.n1*n1)
  h2&lt;-log(h2.n2*n2)
  ih1&lt;-log(ih1.n1*n1)
  ih2&lt;-log(ih2.n2*n2)
  ik&lt;-log(ik.n*n)
  c1&lt;-log(c1.n1*n1)
  c2&lt;-log(c2.n2*n2)
  z&lt;-1
  zeta&lt;-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 &lt;- function(zt1, zt){
  #NOTE: Variables are their logarithm.
  res &lt;- matrix(NA, nrow = 13, ncol = 1)
  res[1, 1] &lt;- zt[10] + zt[2] - log(w)
  res[2, 1] &lt;- -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] &lt;- log(beta1)+zt[2] - zt1[2] +log(r+1-delta)
  res[4, 1] &lt;- zt[11] -zt[3]-log(w) 
  res[5, 1] &lt;- -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] &lt;- zt[1]-zt[13]-alpha*zt[4]-(1-alpha)*zt[12]
  res[7, 1] &lt;- zt[1] -log(exp(zt[2])+exp(zt[3])+exp(zt[8])+exp(zt[9])+exp(zt[5]))
  res[8,1]&lt;-(1/(1-alpha))*log(1+g)+zt1[4]-log(exp(zt[5])+(1-delta)*exp(zt[4]))
  res[9,1]&lt;-(1/(1-alpha))*log(1+g)+zt1[6]-log(exp(zt[8])+(1-delta)*exp(zt[6]))
  res[10,1]&lt;-(1/(1-alpha))*log(1+g)+zt1[7]-log(exp(zt[9])+(1-delta)*exp(zt[7]))
  res[11,1]&lt;-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]&lt;-log(exp(zt[3])+exp(zt[9])*2.0168*exp(zt[3])/exp(zt[7]))-log(w)-zt[11]  
  res[13,1]&lt;-zt1[13]-rho*zt[13]
   return(res)}
  
  Psi(zeta, zeta)
  A&lt;- matrix(NA, 13, 13)
  B&lt;- matrix(NA, 13, 13)
  for(i in 1:13){
    curz &lt;- zeta;
    curz[i] &lt;- curz[i]+0.00001
    PsiP &lt;- Psi(curz, zeta)
    A[, i] &lt;- (PsiP - 0)
    PsiP &lt;- Psi(zeta, curz)
    B[, i] &lt;- -(PsiP - 0)}
  round(A, 4)
  round(B, 4)
  structure &lt;- c(alpha = alpha, beta1 = beta1, beta2=beta2, varphi = varphi, delta = delta, rho = rho, g=g)
  save(A, B, zeta, structure, file=&quot;laterUse&quot;)
  
  ```
  </code></pre>