TeX Live 安装:仅在命令行上指定方案?

TeX Live 安装:仅在命令行上指定方案?

我正在尝试编写一个 bash 脚本,以便在 CentOS 上安装 TeX Live(作为 Vagrant 中配置的一部分)。我想要scheme=small但不需要任何其他选项(tlmgr install之后我会运行以添加更多内容)。有没有办法在脚本中执行此操作而无需单独的配置文件?我希望能够执行类似操作install-tl -scheme small -batch(伪代码 - 我知道没有批处理标志),但所有文档似乎都希望您有一个配置文件或以交互方式进行安装。

或者如果我必须有一个配置文件,仅指定方案的最小内容是什么?我需要在 shell 脚本中构建文件,因此越简单越好,但是所有文档都告诉我从texlive.profile安装完成后创建的文件开始 - 有很多东西,其中大部分我都不明白。

答案1

通过实验,我发现仅包含方案的配置文件就足以满足安装程序的要求。所以这可以正常工作:

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

如果有人想查看上下文,这是我的整个脚本(我知道这不是一个 Linux 论坛,但其他人可能想要自动化他们的 TeX Live 安装):

#!/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"

相关内容