2

I'm trying to make a bash script to install TeX Live on CentOS (as part of provisioning in Vagrant). I want scheme=small but don't need any other options (I'll run tlmgr install to add a few more things after that). Is there a way to do that in the script without having a separate profile file? I expected to be able to do something like install-tl -scheme small -batch (pseudo-code - I know there is no batch flag), but all the docs seem to expect you do either have a profile file or do the installation interactively.

Or if I must have a profile file, what is the minimum content to just specify the scheme? I need to build the file in the shell script, so simple is best, but all the docs tell me to start with the texlive.profile file that is created when an install is done - that's a lot of stuff, most of which I don't understand.

1

By experimentation, I discovered that a profile file with just the scheme is enough to satisfy the installer. So this works fine:

echo 'selected_scheme scheme-small' > temp.profile
./install-tl -profile temp.profile

If someone would like to see the context, this is my whole script (I know this is not a Linux forum, but someone else may be wanting to automate their TeX Live installation):

#!/usr/bin/bash

# An error exit function
function error_exit
{
    echo "$1" 1>&2
    exit 1
}

# Download and unpack the latest TeX Live tarball
wget -q http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz || error_exit "Failure getting texlive tarball"
tar -xzf install-tl-unx.tar.gz || error_exit "Failure unpacking texlive tarball"
rm -f install-tl-unx.tar.gz

# Install with the small scheme
cd install-tl-20* || error_exit "Failure changing to texlive install directory"
echo 'selected_scheme scheme-small' > temp.profile
./install-tl -profile temp.profile || error_exit "Failure installing texlive core"
rm -f temp.profile

# Add the bin directory to the path
echo 'export PATH=/usr/local/texlive/2016/bin/x86_64-linux:$PATH' >> ~/.bashrc
source ~/.bashrc

# Install additional packages
tlmgr install collection-langjapanese || error_exit "Failure installing collection-langjapanese"
tlmgr install textpos || error_exit "Failure installing textpos"
tlmgr install hanging || error_exit "Failure installing hanging"
tlmgr install ulem || error_exit "Failure installing ulem"
tlmgr install needspace || error_exit "Failure installing needspace"
tlmgr install ec || error_exit "Failure installing ec"
  • And bashrc might only be good if all you ever use is the command line (or if it is sourced from the profile). – daleif Dec 7 '16 at 9:40
  • 1
    Actually, my normal use of the TeX-related commands is from PHP code, so I can spell out the whole path anyway. I set the path in .bashrc just for quick tests I might do on the command line. – OsakaWebbie Dec 7 '16 at 14:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.