Skip to content

Commit

Permalink
Add install_latex_packages
Browse files Browse the repository at this point in the history
  • Loading branch information
0xmachos committed Apr 26, 2024
1 parent 702099f commit 2859aa3
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions bittersweet
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ function usage {
echo " maccy - Install Maccy"
echo " texpad - Install Texpad (Texifier) & BasicTeX"
echo " basictex - Install MacTeX BasicTeX Distribution"
echo " latex - Install LaTeX packages via tlmgr"
echo " blockblock - Install BlockBlock"
echo " oversight - Install OverSight 📸🎤"
echo " brew - Install Homebrew, Homebrew-file and export HOMEBREW_BREWFILE"
Expand Down Expand Up @@ -908,6 +909,45 @@ function install_basictex {
# Delete the pkg
}


function install_latex_packages {
# install_latex_packages
# Installs some LaTeX packages via tlmrg
# Updates tlmgr and all currently installed packages first

echo "[🍺] Updating tlmgr, all installed packages and installing packages..."
sleep 2

get_sudo "to update tlmgr, update installed packages and install packages"

# Update tlmgr
if sudo tlmgr update --self >/dev/null; then
echo "[✅] Successfully updated tlmgr"
else
echo "[❌] Failed to update tlmgr"
fi

# Update packages installed via tlmgr
if sudo tlmgr update --all >/dev/null; then
echo "[✅] Successfully updated LaTeX packages via tlmgr"
else
echo "[❌] Failed to update LaTeX packages via tlmgr"
fi

local -ar PACKAGES=(sectsty helvetic)
# sectsty: Required for the Custom sectioning
# helvetic: Installs the helvetica font (phv) for the custom sectioning

for PACKAGE in "${PACKAGES[@]}"; do
if sudo tlmgr install "${PACKAGE}"; then
echo "[✅] Successfully installed LaTeX package ${PACKAGE} via tlmgr"
else
echo "[❌] Failed to install LaTeX package ${PACKAGE} via tlmgr"
fi
done
}


function install_blockblock {
# install_blockblock
# Installs BlockBlock (BB) via usual helpers
Expand Down Expand Up @@ -1201,8 +1241,15 @@ function main {
texpad)
install_texpad
install_basictex
install_latex_packages
;;
basictex)
install_basictex
install_latex_packages
;;
latex)
install_latex_packages
;;
blockblock)
install_blockblock
;;
Expand Down Expand Up @@ -1246,6 +1293,7 @@ function main {
install_maccy
install_texpad
install_basictex
install_latex_packages
install_blockblock
install_oversight
install_brew
Expand Down

0 comments on commit 2859aa3

Please sign in to comment.