Skip to content

Instantly share code, notes, and snippets.

@brycepg
Last active December 1, 2022 09:28
Show Gist options
  • Save brycepg/37910f615abd3732f4e3ac4335a33966 to your computer and use it in GitHub Desktop.
Save brycepg/37910f615abd3732f4e3ac4335a33966 to your computer and use it in GitHub Desktop.
Install Sphinx latexpdf Dependencies for Centos 7
#!/bin/bash
# source: https://cbs.centos.org/koji/rpminfo?rpmID=45050
set -xeuo pipefail
sudo yum install -y "tex(cmap.sty)" "tex(ecrm1000.tfm)" "tex(fancybox.sty)" "tex(footnote.sty)" "tex(framed.sty)" "tex(multirow.sty)" "tex(parskip.sty)" "tex(threeparttable.sty)" "tex(titlesec.sty)" "tex(upquote.sty)" "tex(wrapfig.sty)" "texlive-collection-fontsrecommended" "texlive-collection-latex" "tex(fncychap.sty)" python-sphinx > /dev/null
# Determine latex search directory
SEARCH_DIRECTORY="$(kpsewhich -var-value=TEXMFHOME)/tex/latex/local"
mkdir -p "$SEARCH_DIRECTORY"
# capt-of.sty has no Centos 7 package
install_capt_of() {
cp /usr/lib/python2.7/site-packages/sphinx/texinputs/tabulary.sty "$SEARCH_DIRECTORY"
wget http://mirrors.ctan.org/macros/latex/contrib/capt-of.zip -O /tmp/capt-of.zip -q
unzip /tmp/capt-of.zip -d /tmp/ 2>&1 > /dev/null
(cd /tmp/capt-of; latex capt-of.ins 2>&1 > /dev/null; cp capt-of.sty "$SEARCH_DIRECTORY")
rm -r /tmp/capt-of.zip /tmp/capt-of
}
# needspace.sty has no Centos 7 package
install_needspace() {
wget http://mirrors.ctan.org/macros/latex/contrib/needspace.zip -O /tmp/needspace.zip -q
unzip /tmp/needspace.zip -d /tmp/needspace 2>&1 > /dev/null
(cd /tmp/needspace/needspace/; latex 2>&1 needspace.ins > /dev/null; cp needspace.sty "$SEARCH_DIRECTORY")
rm -r /tmp/needspace.zip /tmp/needspace
}
install_capt_of
install_needspace
@vale981
Copy link

vale981 commented Sep 6, 2019

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment