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

No TeX installation detected when trying to render pdf #2408

Closed
cderv opened this issue Sep 12, 2022 Discussed in #2406 · 26 comments
Closed

No TeX installation detected when trying to render pdf #2408

cderv opened this issue Sep 12, 2022 Discussed in #2406 · 26 comments
Labels
enhancement New feature or request
Milestone

Comments

@cderv
Copy link
Collaborator

cderv commented Sep 12, 2022

Discussed in #2406

Originally posted by ericvmai September 12, 2022
I keep trying to render a quarto html and pdf but rstudio tells me: No TeX installation was detected.

But when I enter quarto install tool tinytex then it says it is already installed. When I try to produce a pdf of a different project - I can produce a PDF with no issue. Help!

https://github.com/hdadvisors/chesterfield-market-analysis/tree/quarto-transition

@cderv
Copy link
Collaborator Author

cderv commented Sep 12, 2022

@ericvmai We keep getting some report about similar issues. Can you give us more information :

  • Share quarto check output
  • Share quarto tools info tinytex output
  • How did you installed TeX on your system ?
  • Which OS are you on ? What is the result of which tlmgr if you are on LINUX or Get-Command tlmgr in powershell on Windows ? More generally do you have tlmgr found in PATH ?

Thank you.

@ericvmai
Copy link

quarto check output:

[>] Checking basic markdown render....OK

[>] Checking Python 3 installation....(None)

  Unable to locate an installed version of Python 3.
  Install Python 3 from https://www.python.org/downloads/

[>] Checking R installation...........OK
Version: 4.1.2
Path: C:/PROGRA1/R/R-411.2
LibPaths:
- C:/Users/ericv/Documents/R/win-library/4.1
- C:/Program Files/R/R-4.1.2/library
rmarkdown: 2.16

[>] Checking Knitr engine render......OK

quart tools info tinytex output:

{
"name": "TinyTeX",
"installed": true,
"version": "v2022.09",
"directory": "C:\Users\ericv\AppData\Roaming\TinyTeX",
"bin-directory": "C:\Users\ericv\AppData\Roaming\TinyTeX\bin\win32",
"configuration": {
"status": "warning",
"message": "TeX Live not on path."
}
}

TeX was installed utilizing Yihui's instructions on: https://yihui.org/tinytex/

I'm on Windows OS 11 Pro. Not sure about tlmgr.

@cderv
Copy link
Collaborator Author

cderv commented Sep 13, 2022

"message": "TeX Live not on path."

This is probably the issue.

Can you open

  • powershell terminal and do (Get-Command tlmgr).Source
  • or CMD if you prefer and type where tlmgr

This is to check if this is found in terminal. I think it will not be found.

@dragonstyle this seems to be another case where

  • Quarto finds TinyTeX with quarto tools
  • But it is not on PATH somehow, so it is not found during rendering.

@ericvmai
Copy link

"message": "TeX Live not on path."

This is probably the issue.

Can you open

  • powershell terminal and do (Get-Command tlmgr).Source
  • or CMD if you prefer and type where tlmgr

This is to check if this is found in terminal. I think it will not be found.

@dragonstyle this seems to be another case where

  • Quarto finds TinyTeX with quarto tools
  • But it is not on PATH somehow, so it is not found during rendering.

Get-Command : The term 'tlmgr' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:2

  • (Get-Command tlmgr).Source
  •  + CategoryInfo          : ObjectNotFound: (tlmgr:String) [Get-Command], CommandNotFoundException
     + FullyQualifiedErrorId : CommandNotFoundException,Microsoft.PowerShell.Commands.GetCommandCommand
    

@cderv
Copy link
Collaborator Author

cderv commented Sep 13, 2022

Yes so the issue is that for some reason, Installation was not complet and tlmgr has not be added to PATH.

This leads to Quarto not finding it. Is this possible to uninstall TinyTeX and reinstall using quarto install tool tinytex ?

Installation should call tlmgr path add to correctly put the binary into the PATH. (note that on Windows, you may need to restart Terminal or even computer for this to work after installation)

@ericvmai
Copy link

What method do you suggest for uninstalling TinyTeX?

@cderv
Copy link
Collaborator Author

cderv commented Sep 13, 2022

if you used tinytex::install_tinytex(), you can do tinytex::uninstall_tinytex().

@ericvmai

This comment was marked as resolved.

@cderv

This comment was marked as resolved.

@nzgwynn
Copy link

nzgwynn commented Sep 13, 2022

I'm teaching beginner students (their first R class) and they are having the same issue. What is the best way to help them debug?

@cderv
Copy link
Collaborator Author

cderv commented Sep 13, 2022

they are having the same issue

You mean the no TeX installation detected ?

We are currently working on improving all this in Quarto so that when TinyTeX is found, it will be used.

Currently, Quarto assumes that TeX Live is available by looking at tlmgr on PATH - So it must be on PATH.

To debug:

  • Which TeX Live installation are they running ? If none they install, it could be good to use the TinyTeX one quarto tools install tinytex
  • If still not working after this installation, add on PATH tlmgr - usually tlmgr path add is the solution, but it should have been run by the installer.
  • Uninstalling and reinstalling TinyTeX is an option as it seems that solved the issue for @ericvmai above.
  • Adding manually on PATH the bin directory where tlmgr is should be possible too.

So basically, the thing is for now tlmgr should be found on PATH. For later version of Quarto, it will be improved and hopefully this will never happen again

Hope it helps

@nzgwynn
Copy link

nzgwynn commented Sep 13, 2022

We've uninstalled and reinstalled a few times using quarto install tool tinytex which didn't help.

You're saying in the console run

tinytex::uninstall_tinytex()
tinytex::install_tinytex() 

Is the best next step?

@cderv
Copy link
Collaborator Author

cderv commented Sep 13, 2022

How was TinyTeX installed in the first place ? Using the tinytex R package ?
If so, then yes you can try this step. tlmgr path add should be run by default as part of the installation steps.

You can still try to run it yourself. For R users managing with R package:

  • tinytex::tinytex_root() should return where the installation took place
  • tinytex::is_tinytex() will confirm that it is a tinytex
  • tinytex::tlmgr_path("add") should run the command to add in PATH.

Not that going to tinytex::tinytex_root() folder, you can find the tlmgr binary and then run the command from terminal there too

tlmgr path add

I am sorry this looks so complex. I am trying to give as much information as I can to help without seeing the real environment and trying to see the real issues.

@ericvmai

This comment was marked as resolved.

@dragonstyle

This comment was marked as resolved.

@AmeliaMN
Copy link

Count me among the people whose students are having issues with this! I would estimate about 50% of my students were able to get a TeX installation that Quarto could detect using tinytex::install_tinytex() but the other 50% needed to do the quarto install tool tinytex after the fact. At the terminal when running that command they usually got a message about already having TeX installed, but I had them Y to reinstall. I assume this just fixed whatever the path stuff was a little mis-specified before, because then everything worked!

@nzgwynn
Copy link

nzgwynn commented Sep 13, 2022

I found a work around @AmeliaMN! Have them render an HTML, you can open the HTML in a website and save it as a pdf! They can open in Chrome and hit print and to save to a pdf!

@ericvmai

This comment was marked as resolved.

@cderv cderv added this to the v1.2 milestone Sep 14, 2022
@cderv cderv added the enhancement New feature or request label Sep 14, 2022
@cderv
Copy link
Collaborator Author

cderv commented Sep 14, 2022

We have added better detection process for the TinyTeX installation, installed by Quarto or by R with tinytex

This currently lives in the pre release for 1.2 that can be downloaded at https://quarto.org/docs/download/

Changes are:

Please do give a try to the pre-release if you still encounter issue with some installation.

Thank you everyone for your feedback. This helped us improve !

@gshotwell
Copy link

I ran into this issue and it turned out that my /usr/local/bin was not writable. This old tinytex issue resolved it for me.

rstudio/tinytex#24

@joundso
Copy link

joundso commented Apr 12, 2023

I ran into this issue while trying to install quarto and tex into the rstudio image: Dockerfile.

quarto check says:

[✓] Checking Quarto installation......OK
      Version: 1.2.335
      Path: /usr/lib/rstudio-server/bin/quarto/bin

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.10.6
      Path: /usr/bin/python3
      Jupyter: (None)

      Jupyter is not available in this Python installation.
      Install with python3 -m pip install jupyter

ERROR: PermissionDenied: Permission denied (os error 13), stat '/root/pyvenv.cfg'

Do I need python/pip/jupyter for compiling quarto documents with only R chunks?
The error if I hit the "Render project" button in RStudio is:

running xelatex - 1
command xelatex not found, attempting install
finding package for xelatex
ERROR: Error executing '/home/rstudio/.TinyTeX/bin/x86_64-linux/tlmgr': No such file or directory (os error 2)

Exited with status 1.

Any hints?

@cderv
Copy link
Collaborator Author

cderv commented Apr 12, 2023

Do I need python/pip/jupyter for compiling quarto documents with only R chunks?

No you don't need Python / Jupyter is you don't need document with Python.

The error if I hit the "Render project" button in RStudio is:

It seems you have a valid installation of LaTeX - See https://quarto.org/docs/output-formats/pdf-engine.html#installing-tex

Version: 1.2.335

Please do update to 1.3 Release Candidate available at https://quarto.org/docs/download/ - it should have some fix toward better error message I believe.

@memeplex
Copy link

memeplex commented Feb 3, 2024

Share quarto tools info tinytex output

@cderv This was an useful tip given that I was struggling to find the location of tinytex. But FYI it's not documented quarto tools --help.

@mcanouil
Copy link
Collaborator

mcanouil commented Feb 3, 2024

@memeplex are you using the version of Quarto from last year? Be cautious of the date/version.
The posts mentioned 1.2 (stable) and a 1.3 pre-release. The original post where you found the command is even from 1.1. We are at 1.4 (stable).

@memeplex
Copy link

memeplex commented Feb 3, 2024

1.4.549. It was just a heads up.

@cderv
Copy link
Collaborator Author

cderv commented Feb 5, 2024

But FYI it's not documented quarto tools --help.

Yes we know. quarto CLI help needs some improvements, especially on some specific commands like this. Thanks for the heads up.

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

No branches or pull requests

9 participants