Latex on RStudio Server Pro Centos 7

Hi fellow #r-admin !

Another question about experience sharing

Do you have some guidelines to install and configure Latex for using Rmarkdown on RStudio Server Pro ?

There are several ways of doing that I think with some questions raised like :

  • Should we use yum package manager to install Tex on Centos 7, installing also available Tex package ?
  • Should we use something like tinytex ? Globally or by user ?
  • How to do all that in an offline environment ? Does Package manager plans to cover latex package ?
  • do we need a tex mirror for latex packages ?

The aim is to offer Latex feature on RStudio Server Pro for every user, while having administration as easy as possible. That means not having every user install and configure latex himself but offering a working base for everyone.

Currently, we are thinking about:
• Installation Tex distribution available on centos 7
• Including tex library available
• With offline mode and no latex mirror, only those lib would be available.

If you have some advice and guidelines to follow, sharing experience would be awesome !

Thanks.

Hi @cderv,

Package Manager currently does not cover LaTeX packages, though I will add to our feature request list.

yum is probably your best way to go. Is there a reason not to install the full distribution (i.e. texlive-full)?

:+1: awesome!

No specific reason. I was looking for such advice.

But does texlive-full cover every latex packages ? Could be heavy to have all installed by default... :thinking:

I did not mention this specific full distro because I am not sure it is in the official centos yum repo. We have a mirror of this one I think : http://mirror.centos.org/centos/7/os/x86_64/Packages/
No texlive-full but lot of texlive rpm
That would mean something like yum install texlive texlive*. Is it equivalent ?

I found this method that would mean internet access (no rpm though I think)
https://www.tug.org/texlive/acquire-netinstall.html
Is this texlive-full ?

or is it one of the tarball available there : https://www.tug.org/texlive/acquire.html ?

Hi @cderv,

I'm definitely not an expert on LaTeX distros, but this thread has some great discussion (albeit for Ubuntu). One person suggests that texlive-full is very heavy (>3 Gb), but that they've never needed to think about downloading more packages.

I'm not sure whether the CentOS repo has all of the texlive packages. If you can install from somewhere else, that second link should permit a full installation.

For offline installation, that third link has the ISO files available, which you could download, put onto physical media, and mount and install locally.

Oh that is how it works!! Very interesting!

Thanks a lot for all the advices!

1 Like

I would welcome any input on LaTeX package management in general. For the RStudio QuickStart, we used the tinytex to keep the download size manageable, and then I went through our broken content one package at a time installing LaTeX packages until it worked... :grimacing:

I need a :shudder: emoji. I definitely do not look forward to going through that again, nor do I recommend it :slight_smile: If it's possible to do texlive-full and not be too concerned about disk space, I recommend just going for it. The time saved is probably well worth the storage costs :wink: In AWS, looks like ~$0.30/month ... So a long time before an hour is time well spent :joy:

But for anyone reading this who is glad the QuickStart is not any bigger, we saved like 1.5GB through these painful antics :stuck_out_tongue: (I think... if I remember correctly)

2 Likes

This one of the reason I did not try yet... I had the feeling that would be a huge task. Thanks for sharing!

Even if we are not cloud based, space should not be an issue I think for a few Go. I'll will try to use the rpm approach and see how it goes. If something missing in our repo, the ISO thing could be useful.

I let this open to see if someone else has experience to share.

2 Likes

I have had trouble with LaTex on RHEL 7...from what I found tlmgr isn't part of RHEL rpms....so what I ended up doing is downloading/mirroring the TeX Live repo (~4GB), then installing full from local repo (because the network installation took too long and failed multiple times). (https://tug.org/texlive/acquire-mirror.html)
Installation to new shared directory (sub folder /usr/share/texlive/2018)....and updated symlinks, with sudo access.

Hope this helps.
Shannon

Thanks for sharing!

We are currently testing solutions

  • first one was texlive full install online mode in /opt. It worked but it took 3 hours. Not sure this can be used for installation in our production cluster.
  • so we are looking at using the ISO to install offline.

We'll see how it goes.

1 Like

I did take a while to install over network.....that is why I went with the repo version....as I needed to install on two servers (TEST and PROD), so I could download it once and install on both servers from one point.
Download (rsync) did take a while but install after that was like 15 minutes for each server.
Good luck:)

Shannon

1 Like

Good to know ! Thanks !

I would go for TinyTeX, which gives you a current TeX distribution. That's what I did at one client installation that used RHEL 7. The TeX Live available from the package repositories was just to old:

wget -qO- "https://yihui.name/gh/tinytex/tools/install-unx.sh" | sh -s - --admin --no-path
sudo cp -a .TinyTeX /usr/local/tinytex
sudo /usr/local/tinytex/x86_64-linux/tlmgr path add
sudo yum install http://mirrors.ctan.org/support/texlive/texlive-dummy/EnterpriseLinux-7/texlive-dummy-2012a-1.el7.noarch.rpm
sudo /usr/local/bin/tlmgr install pgf preview xcolor

If the server is not air-gapped, you can install missing packages on the fly. Or you could use tlmgr to install the full TeX Live to be on the save side:

sudo /usr/local/bin/tlmgr install scheme-full

You can also install any subset of packages (or collections) that you might find useful. All this is done on the system level, so that users do not have to worry about installing anything. But if you do not install everything and users are able to reach out, they can use

tinytex::tlmgr('init-usertree') # only do this once
tinytex::tlmgr_install(c('koma-script', 'xcolor'), usermode = TRUE)

to install some packages locally.

Thanks !

You can also install any subset of packages (or collections) that you might find useful.

This is a point I don't want to struggle with. I don't know what is useful or what users need in their own Rmarkdown.

I thought about this solution with tinytex and user side installation, but I need to find a solution on an offline server. Users won't be able to install anything themselves from the internet repo. For R packages, we have an internal mirror. It would require the same thing from Tex packages.

Anyhow, I will keep that in mind, and I am happy to find out that this idea with tinytex has been at least implemented once :slight_smile:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.