I just completed installing MiKTeX 2.9 on my work laptop so that I can using it with RStudio v1.0.153.
I'm run just the default R Notebook file that you get when you select New >> R Notebook. After I save it and click Knit, the following errors come up:

  processing file: test7.Rmd
|...........................................                      |  67%
label: unnamed-chunk-1
|.................................................................| 100%
ordinary text without R code

output file: test7.knit.md

"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS test7.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output test7.pdf --template "C:\Rpackages\rmarkdown\rmd\latex\default-1.17.0.2.tex" --highlight-style tango --latex-engine xelatex --variable graphics=yes --variable "geometry:margin=1in"
! LaTeX Error: File mathspec.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name:
! Emergency stop.

l.12   \else

pandoc.exe: Error producing PDF
Error: pandoc document conversion failed with error 43
running command '"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS test7.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output test7.pdf --template "C:\Rpackages\rmarkdown\rmd\latex\default-1.17.0.2.tex" --highlight-style tango --latex-engine xelatex --variable graphics=yes --variable "geometry:margin=1in"' had status 43
Execution halted


The first error I see is ! LaTeX Error: Filemathspec.sty' not found. but when I go into MiKTeX Console, I can see that the file is actually there:

So maybe R is looking in the wrong place for this package. The computer has a few firewalls which I think might be causing these issues. ' Can someone please assist me in identifying where the problem might be?

Thank you

• No. You see it was packaged, not that it was installed. – Bernard Mar 13 '18 at 23:14
• yes I see that now. Why didn't any of these get installed during the installation? This seems to have worked for me on my personal computer easily. – jmich738 Mar 13 '18 at 23:18
• Maybe you had basic install, not a full install. – Bernard Mar 13 '18 at 23:20
• Yes you are right, it was the Basic. I'm going to get IT to install the Net Installer. Looks like that should fix it. Thank you – jmich738 Mar 13 '18 at 23:35
• If you want to typeset in hieroglyphic ot linearA or classic Mongolian… Don't forget MiKTeX proposes to install missing packages on the fly. – Bernard Mar 13 '18 at 23:47