Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

detected an existing LaTeX distribution #102

Closed
ras44 opened this issue Mar 5, 2019 · 6 comments
Closed

detected an existing LaTeX distribution #102

ras44 opened this issue Mar 5, 2019 · 6 comments

Comments

@ras44
Copy link

ras44 commented Mar 5, 2019

In reference to rstudio/rmarkdown#39 (comment)

I attempted to run tinytex::install_tinytex(), but receive:

Error: Detected an existing LaTeX distribution (e.g., pdftex is at /usr/bin/pdftex). You have to uninstall it, or use install_tinytex(force = TRUE) if you are sure TinyTeX can override it (e.g., you are a PATH expert or installed TinyTeX previously).

There seems to be a conflict between the LaTeX version that is installed by default (via yum builddep R texlive, recommended by RStudio here: https://support.rstudio.com/hc/en-us/articles/218004217-Building-R-from-source), and what is being recommended in the above-referenced issue. Unless the official recommendation is to install texlive and then force the tinytex installation.

Please let me know if I have misunderstood something. Thank you for your help.

@ras44
Copy link
Author

ras44 commented Mar 5, 2019

Here is output from the sudo yum-builddep R:

...
Getting requirements for R-3.5.2-2.el7.src
...
 --> 2:texlive-collection-latexrecommended-svn25795.0-43.20130427_r30134.el7.noarch
 --> texinfo-tex-5.1-5.el7.x86_64
...

I believe another possible solution to rstudio/rmarkdown#39 (comment) would be to update the dependency requirements in R-3.5.2-2.el7.src so that texlive-titling, and/or texlive-latexextra is installed, depending on linux flavor.

@yihui
Copy link
Member

yihui commented Mar 5, 2019

It is a shame that building R from source requires the textlive package on your platform. This requirement can be either a convenience or an annoyance. TinyTeX can work in this case (for building R from source). It is just that your system package manager doesn't recognize it. More on this in FAQ 7: https://yihui.name/tinytex/faq/

Anyway, I don't know why you have to build R from source, but the texlive package (from yum) is not required for building R Markdown to PDF. In your case, you are good to go with tinytex::install_tinytex(force = TRUE).

@yihui yihui closed this as completed in 3215a74 Mar 5, 2019
@yihui
Copy link
Member

yihui commented Mar 5, 2019

I have turned this error into a warning, since it is not really harmful to have two LaTeX distributions installed on the same machine. The only caveat is when you call LaTeX directly, you may need to know which distribution you are using. For R and tinytex package users, there is nothing to worry about since I have taken care of everything behind the scenes (TinyTeX will always be used if installed).

@ras44
Copy link
Author

ras44 commented Mar 6, 2019

One additional thought: if tinytex is required for RStudio's knit-to-pdf functionality, maybe it should be installed on the system when installing RStudio. Or when running knit-to-pdf and tinytex is not detected, RStudio should test and recommend the installation.

@yihui
Copy link
Member

yihui commented Mar 6, 2019

It is technically easy to bundle TinyTeX with RStudio. The only problem is that the licenses of LaTeX and its packages are complicated (FAQ 2: https://yihui.name/tinytex/faq/).

TinyTeX is not required but recommended for knitting R Markdown to PDF.

@fkohrt
Copy link

fkohrt commented Aug 26, 2020

TinyTeX will always be used if installed

For others who stumble upon this like me: This is due to tinytex:::tweak_path, which is called within tinytex::latexmk, which in turn is indirectly called by rmarkdown::render. So to really evaluate your *TeX binaries, do something like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants