Verified Commit 15d7a78e authored by Simão Afonso @ Powertools Tech's avatar Simão Afonso @ Powertools Tech
Browse files

Initial Commit

# VirtuaLaTeX
Like `venv` and `pip`, for LaTeX.
## Usage
Create a virtual LaTeX environment on the folder `$FOLDER`. Defaults to the
current location.
$ virtualatex $FOLDER
The virtual environment is (explicitly) compatible with the `venv`, so you can
create a virtual LaTeX environment before of after creating a Python `venv`.
Add `$FOLDER/bin` to your `PATH` (or just activate the `venv`) to have `tlmgr`
available and configured correctly.
Here is the [documentation]( The
important command is:
- `tlmgr install $PACKAGE`: Install a CTAN package
If you have a list of LaTeX dependencies on a text file (one per line), use:
<$FILE xargs -- tlmgr install
## Pedantry
This technically installs the most bare-bones TeXlive schema, with three essential packages:
- latex-bin
- luatex
- xetex
Many thanks to [TinyTex](, the inspiration for this project.
If you need a list of packages needed to compile basic files, check TinyTex:
set -e
# TODO: This is the latest version
# See "" for archived versions
# TODO: Integrate this
setup_tinytex() { # Install Location
il="$(readlink -e "$1")"
tmp="$(mktemp -d)" # Temporary Location
pushd "$tmp"
# TexLive
wget -nc "$TexLive_URL"{,.sha512,.sha512.asc}
sha512sum -c "$TexLive_File.sha512" # Verify hash
gpg --verify "$TexLive_File.sha512.asc" || true # TODO: Verify GPG
# TinyTex
wget -nc "$TinyTex_Profile"
echo "tlpdbopt_sys_bin $il_bin" >> tinytex.profile
# Extract files
tar xf "$TexLive_File"
# Verify TexLive version
texlive_version="$(find . -name 'install-tl-*' -type d | head -1 | sed 's@./install-tl-@@')"
echo "=> TexLive Version: $texlive_version"
platform="$(uname -m)-linux"
echo "=> Install Location: $il"
echo "- Binaries: $il_bin"
echo "- TexLive: $il_texlive"
echo "=> Platform (Script): $platform"
# Do it!
if [ -d "$il_texlive" ]; then
echo "=> Re-Installing TexLive"
rm -rf "$il_texlive"
echo "=> Installing TexLive @ '$il_texlive'"
mkdir -p "$il_texlive"
cd "$il_texlive" &&
TEXLIVE_INSTALL_ENV_NOCHECK=true TEXLIVE_INSTALL_NO_WELCOME=true "$tmp/install-tl-$texlive_version/install-tl" -no-gui -profile="$tmp/tinytex.profile" -repository "$TexLive_Repo"
# Setup it!
binaries="$(readlink -e "$il_texlive/bin/$platform")"
echo "=> Platform (tlmgr):"
"$tlmgr" print-platform-info
echo "=> Setup Repository"
"$tlmgr" option repository "$TexLive_Repo"
echo "=> Installing packages"
"$tlmgr" install latex-bin luatex xetex
# Option: Install GPG
# "$tlmgr" --repository "" install tlgpg
echo "=> Add symlinks to '$il_bin'"
"$tlmgr" path add
# Remove detritus
rm -rf "$tmp"
test -d "$install_location"
setup_tinytex "$install_location"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment