Installing version mismatch latex packages one by one in manual, as described in #10.A in FAQ-BUILD.txt is cumbersome. This commit adds a script for automation of the work. Signed-off-by: SeongJae Park <sj38.park@xxxxxxxxx> --- utilities/install_latex_package.sh | 44 ++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 utilities/install_latex_package.sh diff --git a/utilities/install_latex_package.sh b/utilities/install_latex_package.sh new file mode 100755 index 00000000..0a7f3d19 --- /dev/null +++ b/utilities/install_latex_package.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +if [ $# -ne 1 ] +then + echo "Usage: $0 <package name>" + exit 1 +fi + +package=$1 + +packages="titlesec cleveref listings draftwatermark epigraph fvextra" +supported="false" +for p in $packages +do + if [ "$package" == "$p" ] + then + supported="true" + break + fi +done +if [ "$supported" == "false" ] +then + echo "$package is not supported" + exit 1 +fi + +wget "http://mirrors.ctan.org/macros/latex/contrib/$package.zip" +unzip "$package.zip" +cd "$package" || exit 1 + +latex "$package.ins" +if [ ! -e "$package.sty" ] +then + echo "$package.sty creation failed" + exit 1 +fi + +install_dir=~/texmf/tex/latex/"$package" +mkdir -p "$install_dir" +cp "$package.sty" "$install_dir/" +texhash ~/texmf + +cd .. || exit 1 +rm -fr "$package" "$package.zip" -- 2.17.1