diff --git a/.texlive-minmal-installer.sh b/.texlive-minmal-installer.sh new file mode 100755 index 0000000..58f33ea --- /dev/null +++ b/.texlive-minmal-installer.sh @@ -0,0 +1,37 @@ +#!/bin/bash +# +# Install minimal TeXLive 2015 for GMT_docs +# +#REMOTE=http://mirrors.ustc.edu.cn/CTAN/systems/texlive/tlnet +REMOTE=http://ctan.sharelatex.com/tex-archive/systems/texlive/tlnet/ +TEXBIN=/usr/local/texlive/2015/bin/x86_64-linux +PACKAGES="titlesec fandol ctex threeparttable framed wrapfig upquote capt-of needspace multirow eqparbox environ trimspaces zhnumber zapfding latexmk" + +# install TeXLive +mkdir -p /tmp/install-texlive +cd /tmp/install-texlive/ +curl -sSL $REMOTE/install-tl-unx.tar.gz | tar -xz -C ./ --strip-components=1 + +cat << EOF > texlive.profile +selected_scheme scheme-minimal +TEXMFHOME ~/.texmf +TEXMFCONFIG ~/.texlive/texmf-config +TEXMFVAR ~/.texlive/texmf-var +collection-basic 1 +collection-genericrecommended 1 +collection-latex 1 +collection-latexextra 0 +collection-latexrecommended 1 +collection-xetex 1 +collection-langchinese 0 +option_autobackup 0 +option_doc 0 +option_src 0 +EOF + +sudo ./install-tl -profile texlive.profile -repository $REMOTE +sudo $TEXBIN/tlmgr update --self --all --repository $REMOTE +sudo $TEXBIN/tlmgr install $PACKAGES --repository $REMOTE + +cd - +echo export PATH=$TEXBIN:'$PATH' > srcfile diff --git a/.travis-deploy.sh b/.travis-deploy.sh new file mode 100755 index 0000000..437e657 --- /dev/null +++ b/.travis-deploy.sh @@ -0,0 +1,19 @@ +#!/bin/bash +name="Dongdong Tian" +mail="seisman.info@gmail.com" +docdir=pdf +pdfname=Makefile.pdf + +echo "In master branch, deploying now..." +git config user.name "${name}" +git config user.email "${mail}" + +# Deploy Github Pages +ghp-import -b gh-pages -n build/html -m 'Update by travis automatically' +git push "https://${GH_TOKEN}@${GH_REF}" gh-pages:gh-pages --force + +# Deploy offline HTML and PDF files +mkdir build/${docdir} && cd build +cp latex/${pdfname} ${docdir}/ +ghp-import -b ${docdir} ${docdir} -m 'Update by travis automatically' +git push "https://${GH_TOKEN}@${GH_REF}" ${docdir}:${docdir} --force diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..5cc38f8 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,22 @@ +language: python +python: + - "3.5" + +sudo: required +dist: trusty + +branches: + only: + - dev + +install: + - pip install -r requirements.txt + - bash ./.texlive-minmal-installer.sh + - source ./srcfile + +script: + - make html + - make xelatexpdf + +after_success: + bash ./.travis-deploy.sh diff --git a/Makefile b/Makefile index 27c019b..7dbd766 100644 --- a/Makefile +++ b/Makefile @@ -119,9 +119,8 @@ latexpdf: xelatexpdf: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through xelatex..." - sed -i s/pdflatex/xelatex/ $(BUILDDIR)/latex/Makefile - $(MAKE) -C $(BUILDDIR)/latex all-pdf + @echo "Runnning LaTeX files through xelatex..." + cd $(BUILDDIR)/latex; latexmk -xelatex -shell-escape -interaction=nonstopmode @echo "xelatex finished; the PDF files are in $(BUILDDIR)/latex." latexpdfja: diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..22f0895 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +sphinx +sphinx_rtd_theme +pygments +ghp-import