Created
November 8, 2022 19:09
-
-
Save leminhtr/4bd79f6a1af1d684e9032a2f289a5cb4 to your computer and use it in GitHub Desktop.
Helper functions to fetch latex package from CTAN with either wget or git clone then install them on Ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export LATEX_STY_INSTALL_PATH="/usr/share/texmf/tex/latex/" | |
function install_sty_wget_ctan_latex() { | |
mkdir -p /tmp/sty/ && | |
cd /tmp/sty/ && | |
wget "$1" && | |
unzip $(basename "$1") && | |
folder_name="$(ls -t | tail -1)" | |
echo "mv $folder_name $LATEX_STY_INSTALL_PATH" && | |
sudo mv $folder_name $LATEX_STY_INSTALL_PATH && | |
cd $LATEX_STY_INSTALL_PATH && | |
sudo texhash folder_name; | |
echo "Installed sty list:"; | |
ls | |
} | |
function install_sty_gitclone_ctan_latex() { | |
mkdir -p /tmp/sty/ && | |
cd /tmp/sty/ && | |
git clone "$1" && | |
folder_name="$(ls -t | tail -1)" | |
echo "mv $folder_name $LATEX_STY_INSTALL_PATH" && | |
sudo mv $folder_name $LATEX_STY_INSTALL_PATH && | |
cd $LATEX_STY_INSTALL_PATH && | |
sudo texhash folder_name; | |
echo "Installed sty list:" | |
ls; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment