简体   繁体   中英

Knit PDf file from RStudio

I am trying to Knit PDf file from RStudio, and I am getting the following error:

! LaTeX Error: File `framed.sty' not found.

  • R version: 3.2.2 (2015-08-14)
  • Platform: x86_64-redhat-linux-gnu on AWS EC2

I know this is kind of old, but I tried all this answers in my ubuntu and it didn't work, finally I found that yihui developed the tinytex package , the only thing you have to do is run the following code:

install.packages(c('tinytex', 'rmarkdown'))
tinytex::install_tinytex()

and you are set, this works cross platform

Cheers

While trying to knit PDF file from R Studio.

Error-1: ! LaTeX Error: File `framed.sty' not found.

Reference: https://github.com/rstudio/rmarkdown/issues/39

Solution:

You need to install the framed LaTeX package.

yum -y install texlive-framed

Error-2: ! LaTeX Error: File `titling.sty' not found.

Reference: https://github.com/rstudio/rmarkdown/issues/359

Solution:

wget http://mirrors.ctan.org/macros/latex/contrib/titling.zip

unzip titling.zip     # (might need to sudo yum install unzip)

cd titling

latex titling.ins

sudo mkdir -p /usr/share/texlive/texmf-dist/tex/latex/titling

sudo cp titling.sty /usr/share/texlive/texmf-dist/tex/latex/titling/

sudo texhash

I had a similar problem with titling.sty . The solution was to install a package that contained the missing file.

Ubuntu:

On my ubuntu it was:

sudo apt install texlive-latex-extra

Remember, that you can always find a package that contains a given file by using apt-file:

sudo apt-file search titling.sty

Of course, you'll have to install the apt-file package first (and refresh the file database) if you haven't done it before:

sudo apt install apt-file
sudo apt-file update

Based on your platform, I suspect the least disruptive solution is similar to that for Fedora. I say "least disruptive," because I did not have to replace TexLive with a different package, I just added the missing components. The process I followed came from a solution posted to https://askbot.fedoraproject.org/en/answers/94766/revisions/ [note that the page has moved so this is only read only], but nonetheless; it explains why Fedora does not ship with all the TexLive components and more importantly - it explains how to load them separately. For example, from your terminal, the following will install the missing "framed.sty" component: sudo dnf install "tex(framed.sty)"

After resolving the framed.sty issue, I was able to resolve the titling.sty error with:

sudo yum -y install texlive-titling

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM