-
Notifications
You must be signed in to change notification settings - Fork 170
Can't knit to PDF if template requires new latex packages #104
Comments
@raubreywhite thanks for the bug report, looks like I've marfed the permissions in |
@yihui In rocker, we use
Not sure why it should be trying to mess with @raubreywhite not sure why you don't see the same error I do... Relevant config in rocker-versioned/verse/Dockerfile Lines 40 to 48 in 2ed00a8
|
Hi! When I made my own LaTeX template and tried to rmarkdown my LaTeX template directly (which required installation of new LaTeX packages), then I got the same error that you have there. So you're definitely circling around the same issue, but it is weird that it's not the same... |
Not that it is a good solution, but what happens if you just do tinytex_install() in R first? |
Ok, so firstly I didn't want to do a direct install to So I first tried installing to a random directory (not forcing it):
Then I tried installing to a random directory (forcing it):
Then I tried installing to my home directory (forcing it):
This actually installed. But then when I tried to knit:
|
I guess it didn't recognize the new TinyTex install, because it's not on the PATH? |
I don't have an idea about the failure to install LaTeX packages. The error message seems to indicate that the installer didn't have write permission to |
@yihui thanks much for the reply! Note that The problem has to do with however LateX is detecting the installed package. LaTeX claims it cannot find the package, and attempts to re-install it. Note that from R,
I would really appreciate your help in digging around here a bit. It definitely does have permission to write to all of rocker-versioned/verse/Dockerfile Lines 40 to 52 in db064ba
(Anything jump out at you there?) Things do work fine at the user level install, but we really prefer a system-wide setup here. Can you try running the (or I can spin up a server if you'd prefer). |
I see. That might be the problem. The part for changing permission shouldn't be followed to the letter. The commands |
@yihui Also, it's quite clear that the user has write permissions to |
@cboettig Okay, I guess I was confused by the error messages above (which indicated permission issues): #104 (comment). If the permission was set correctly, I might be able to help more.
If the .tex document is compiled through the R package tinytex, missing LaTeX packages will be automatically installed by default (I thought you knew that). Note that the intermediate .tex output files of R Markdown are compiled through tinytex, therefore when compile Rmd files, missing LaTeX packages will be installed automatically.
I'm lost here. Just to be clear, is this your confusion? You installed a LaTeX package, but LaTeX couldn't find it. If it is, using
Are you sure |
Yes, I see:
So it's installed, as I claim. When I press the Knit button in RStudio, I see this in the render panel:
As you can see in the dialog above, RStudio has automatically detected the So I know that
but I don't know precisely how installed by default is doing things, in particular, what environment it has that is causing it not to see what I see when I run If you have Docker installed, run:
go to localhost:8787 and create an Rmd with the above header, you should see exactly what I see in an active RStudio session, if it helps to poke around. |
That's really odd. I don't use Docker myself. Is there an existing server that I can test with? If not, no problem, I can install Docker and the image myself. |
Yes, I've pinged you in twitter with access info for a server |
@raubreywhite So as @yihui points out, there's something funny with how Anyway, till I have a better solution, I've set |
FWIW this particularly example 'works for me' in Ubuntu as I never pursued this further as I actually do not prefer LaTeX to install in $HOME -- I like what texlive does, and it generally works for me via the Debian / Ubuntu packages so I tend not to run In case I could help by testing something locally. I'd be happy to do so. I also have a good working relationship with the Debian texlive maintainer if we needed get advice. |
@raubreywhite This has now been fixed upstream, so everything should work as expected with the system-wide installation regardless of user. Thanks again for the opening the bug report. |
Can you reopen this issue? Unfortunately, the error still persists. I have exactly the same error as @cboettig initially reported, just with a different package:
As for @cboettig, the package is installed:
|
On a similar note to: #101
The issue is, I open up a new rmarkdown file (inside RStudio Server) and give it the YAML header:
I then click on the "Knit to PDF" button. The following happens:
So basically I can't run any rmarkdown documents where the template requires new latex packages, as they don't want to be installed...
The text was updated successfully, but these errors were encountered: