quarto-dev / quarto-r

R interface to quarto-cli
https://quarto-dev.github.io/quarto-r/
145 stars 24 forks source link

`quarto install` #140

Open cderv opened 9 months ago

cderv commented 9 months ago

Do we really need a quarto_install() wrapper ?

This is a one time command - so not sure the benefit of running from R.

Also, usually R users needing TinyTex will have tinytex R package, and if chromium needed then it is easy enough to call quarto install directly in terminal

rundel commented 2 months ago

I will just :+1: for this feature.

Context - we are deploying a bunch of containers with quarto and due to how user home directories are created we need to install tinytex when users first login via a custom .First() function. Using tinytex::install_tinytex() works but is a bit less polished experience than quarto install tinytex so we're opting for the later via system2(). This works but still feels a bit clunky.

cderv commented 2 months ago

Thanks for the 👍 that is useful to know the interest.

Using tinytex::install_tinytex() works but is a bit less polished experience than quarto install tinytex

Can you say more about the polished experience ? When installing TinyTeX from R, the tinytex package is the better option to me. Especially because we can get R console logging directly, and it is executing in session.

we're opting for the later via system2(). This works but still feels a bit clunky.

If I were to add quarto::quarto_install() into this package, I believe it would call the same R command you currently do, and this will run in background, with no interaction possible.

So curious about the less polished part so that we improve on both sides.

Thanks !

rundel commented 2 months ago

It is primarily that the tui for quarto install tinytex is more direct and has less output that is likely to freak out a student who has no idea about quarto or latex internals.

> quarto install tinytex
Installing tinytex
[✓] Downloading TinyTex v2024.07.03
[✓] Unzipping TinyTeX-v2024.07.03.tar.gz
[✓] Moving files
[✓] Verifying tlgpg support
[✓] Configuring font paths
[✓] Default Repository: https://mirrors.rit.edu/CTAN/systems/texlive/tlnet/
Installation successful

is much preferable to

> tinytex::install_tinytex()
trying URL 'https://yihui.org/tinytex/TinyTeX-1.tar.gz'
Content type 'application/octet-stream' length 92770561 bytes (88.5 MB)
==================================================
downloaded 88.5 MB

tlmgr option sys_bin ~/bin
tlmgr: setting option sys_bin to /root/bin.
tlmgr: updating /root/.TinyTeX/tlpkg/texlive.tlpdb
tlmgr option repository 'https://ctan.math.illinois.edu/systems/texlive/tlnet'
tlmgr: setting default package repository to https://ctan.math.illinois.edu/systems/texlive/tlnet
tlmgr: updating /root/.TinyTeX/tlpkg/texlive.tlpdb
tlmgr update --list
tlmgr: package repository https://ctan.math.illinois.edu/systems/texlive/tlnet (not verified: gpg unavailable)
update:   texlive-scripts    [112k]: local:    72102, source:    72107
You may have to restart your system after installing TinyTeX to make sure ~/bin appears in your PATH variable (https://github.com/rstudio/tinytex/issues/16).

also the creation of the ~/bin directory is something that I would like to avoid in these containers.

cderv commented 2 months ago

the tui for quarto install tinytex is more direct and has less output that is likely to freak out a student

That is really good feedback ! Thanks a lot. We may want to simplify the tinytex UI then too. Or at least provide a less verbose mode 🤔

also the creation of the ~/bin directory is something that I would like to avoid in these containers.

I think quarto could do the same too. In tinytex I think we check ~/.local/bin and if it does not exists, then we create ~/bin if it does not exists itself.

In Quarto we do almost the same. We check /usr/local/bin, ~/.local/bin and "~/bin. For whichever is in the PATH environment variable, we use the first found, create the directory if it does not exists, and use the same.

One important difference is that

Hope it helps