From eb3237c8bebef858e8a2340b6b9ffc146dfa9900 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Georges=20Dup=C3=A9ron?= <georges.duperon@gmail.com>
Date: Thu, 17 Aug 2017 14:34:04 +0200
Subject: [PATCH] Automatic builds of the LaTeX file on travis-ci, and
 automatic deployment from my fork. Added dependency on lmodern and stmaryrd
 packages. Upgraded pgf and pgfplots. Used -halt-on-error
 -interaction=nonstopmode .

---
 .gitignore                   |   2 ++
 .travis.yml                  |  54 +++++++++++++++++++++++++++++++++++
 README.md                    |   5 ++++
 auto-push-gh-pages.sh        |  50 ++++++++++++++++++++++++++++++++
 biblio.bib                   |   0
 travis-deploy-key-id_rsa.enc | Bin 0 -> 1680 bytes
 6 files changed, 111 insertions(+)
 create mode 100644 .travis.yml
 create mode 100755 auto-push-gh-pages.sh
 mode change 100755 => 100644 biblio.bib
 create mode 100644 travis-deploy-key-id_rsa.enc

diff --git a/.gitignore b/.gitignore
index aa2df3d..a6cb905 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,3 +7,5 @@
 *.out
 *.toc
 *.lof
+travis-deploy-key-id_rsa
+travis-deploy-key-id_rsa.pub
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..4159286
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,54 @@
+language: c
+sudo: false
+
+before_install:
+ - true
+
+addons:
+  apt:
+    packages:
+    - texlive-latex-base
+    - texlive-fonts-extra
+    - texlive-fonts-recommended
+    - texlive-latex-extra
+    # on 12.04: texlive-latex3, but use texlive-latex-recommended on more recent versions of Ubuntu.
+    - texlive-latex3
+    - texlive-latex-recommended
+    - pgf
+    - latex-xcolor
+    - lmodern
+    - texlive-math-extra
+
+install:
+  - echo "LaTeX extra packages:"
+  - latex_home=$(kpsewhich -var-value=TEXMFHOME)
+  - curl -L -o newunicodechar.ins http://mirrors.ctan.org/macros/latex/contrib/newunicodechar/newunicodechar.ins
+  - curl -L -o newunicodechar.dtx http://mirrors.ctan.org/macros/latex/contrib/newunicodechar/newunicodechar.dtx
+  - latex newunicodechar.ins
+  - mkdir -p "$latex_home/tex/latex/newunicodechar"
+  - mv newunicodechar.sty "$latex_home/tex/latex/newunicodechar"
+  - curl -L -o mathpartir.dtx http://mirrors.ctan.org/macros/latex/contrib/mathpartir/mathpartir.dtx
+  - curl -L -o mathpartir.ins http://mirrors.ctan.org/macros/latex/contrib/mathpartir/mathpartir.ins
+  - latex mathpartir.ins
+  - mkdir -p "$latex_home/tex/latex/mathpartir"
+  - mv mathpartir.sty "$latex_home/tex/latex/mathpartir"
+  - curl -L -o pgf.zip https://downloads.sourceforge.net/project/pgf/pgf/version%203.0.1/pgf_3.0.1.tds.zip
+  - unzip -d "$latex_home" pgf.zip
+  - curl -L -o pgfplots.zip https://downloads.sourceforge.net/project/pgfplots/pgfplots/1.15/pgfplots_1.15.tds.zip
+  - unzip -d "$latex_home" pgfplots.zip
+  - echo "Finished installing extra latex packages."
+  # ################## #
+  # Actual LaTeX build #
+  # ################## #
+  - pdflatex -halt-on-error -interaction=nonstopmode main.tex
+  - bibtex main
+  - pdflatex -halt-on-error -interaction=nonstopmode main.tex
+  - pdflatex -halt-on-error -interaction=nonstopmode main.tex
+  - pdflatex -halt-on-error -interaction=nonstopmode main.tex
+  # ################## #
+  # End of LaTeX build #
+  # ################## #
+  - bash ./auto-push-gh-pages.sh
+
+script:
+  - true
\ No newline at end of file
diff --git a/README.md b/README.md
index a01596c..ede3fab 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,8 @@
+[![Build Status,](https://img.shields.io/travis/jsmaniac/journal-article/master.svg)](https://travis-ci.org/jsmaniac/journal-article)
+[![Build Stats,](https://img.shields.io/website-stats-stats%20unavailable-blue-red/https/jsmaniac.github.io/travis-stats/.svg?label=build)](http://jsmaniac.github.io/travis-stats/#jsmaniac/journal-article)
+[![Try our Tool Online](https://img.shields.io/website-online-currently%20unavailable-blue-red/http/ajl-demo.fr/2016/.svg?label=try%20our%20tool)](http://ajl-demo.fr/2016/)
+[![Read Online (PDF)](https://img.shields.io/website-PDF-PDF%20unavailable-blue-red/https/jsmaniac.github.io/journal-article-gh-pages/main.pdf.svg?label=read%20online)](https://jsmaniac.github.io/journal-article-gh-pages/main.pdf)
+
 # journal-article
 
 This repository contains the LaTeX code for our upcoming journal article.
diff --git a/auto-push-gh-pages.sh b/auto-push-gh-pages.sh
new file mode 100755
index 0000000..d444183
--- /dev/null
+++ b/auto-push-gh-pages.sh
@@ -0,0 +1,50 @@
+#!/bin/sh
+set -e
+set +x
+if test "$(git config remote.origin.url)" != "https://github.com/jsmaniac/journal-article.git"; then
+  echo "Not on official repo, will not deploy gh-pages."
+elif test "$TRAVIS_PULL_REQUEST" != "false"; then
+  echo "This is a Pull Request, will not deploy gh-pages."
+elif test "$TRAVIS_BRANCH" != "master"; then
+  echo "Not on master branch (TRAVIS_BRANCH = $TRAVIS_BRANCH), will not deploy gh-pages."
+# A key can be created following the steps at https://docs.travis-ci.com/user/encrypting-files/ .
+#     ssh-keygen -f travis-deploy-key-id_rsa -C 'Deploy key for travis-ci'
+#     travis encrypt-file travis-deploy-key-id_rsa
+elif test -z "${encrypted_264397dfc790_key:-}" -o -z "${encrypted_264397dfc790_iv:-}"; then
+  echo "Travis CI secure environment variables are unavailable, will not deploy gh-pages."
+else
+  set -x
+  echo "Automatic push to gh-pages"
+
+  # Git configuration:
+  git config --global user.name "$(git log --format="%aN" HEAD -1) (Travis CI automatic commit)"
+  git config --global user.email "$(git log --format="%aE" HEAD -1)"
+
+  # SSH configuration
+  mkdir -p ~/.ssh
+  chmod 700 ~/.ssh
+  set +x
+  if openssl aes-256-cbc -K $encrypted_264397dfc790_key -iv $encrypted_264397dfc790_iv -in travis-deploy-key-id_rsa.enc -out travis-deploy-key-id_rsa -d >/dev/null 2>&1; then
+    echo "Decrypted key successfully."
+  else
+    echo "Error while decrypting key."
+  fi
+  mv travis-deploy-key-id_rsa ~/.ssh/travis-deploy-key-id_rsa
+  set -x
+  chmod 600 ~/.ssh/travis-deploy-key-id_rsa
+  set +x
+  eval `ssh-agent -s`
+  set -x
+  ssh-add ~/.ssh/travis-deploy-key-id_rsa
+
+  TRAVIS_GH_PAGES_DIR="$HOME/travis-gh-pages-$(date +%s)"
+  if test -e $TRAVIS_GH_PAGES_DIR; then rm -rf $TRAVIS_GH_PAGES_DIR; fi
+  mkdir -p "$TRAVIS_GH_PAGES_DIR"
+  mv -i main.pdf $TRAVIS_GH_PAGES_DIR/main.pdf
+  git init $TRAVIS_GH_PAGES_DIR
+  touch $TRAVIS_GH_PAGES_DIR/.nojekyll
+  (cd $TRAVIS_GH_PAGES_DIR && git add -A . && git commit -m "Auto-publish to gh-pages") > commit.log || (cat commit.log && exit 1)
+  (cd $TRAVIS_GH_PAGES_DIR && git log --oneline --decorate --graph -10)
+  echo '(cd '"$TRAVIS_GH_PAGES_DIR"'; git push --force --quiet "git@github.com/jsmaniac/journal-article-gh-pages.git" master:gh-pages)'
+  (cd $TRAVIS_GH_PAGES_DIR; git push --force --quiet "git@github.com:jsmaniac/journal-article-gh-pages.git" master:gh-pages >/dev/null 2>&1) >/dev/null 2>&1 # redirect to /dev/null to avoid showing credentials.
+fi
\ No newline at end of file
diff --git a/biblio.bib b/biblio.bib
old mode 100755
new mode 100644
diff --git a/travis-deploy-key-id_rsa.enc b/travis-deploy-key-id_rsa.enc
new file mode 100644
index 0000000000000000000000000000000000000000..2e8b1d0ba82347e7e0de8cac982cd86be4416a9f
GIT binary patch
literal 1680
zcmV;B25<RC3Bc^Rqoa|}B+kUYLitT(2@fX;?_g!y-l$oMO*Y{>0NC~CA=q2h&Hu{{
z__$h%YZ6FM^8aA-O5T<ZBRv#&`!&N+3MSLt>b?Ot=jUJsWDkV1P~wT~W`oC*elg+#
zwC#qlW`56lCkQ}jZd1bPwR2Y~xq>ie{sI9*2{3tGiV&qMCDpK#fKyrEH+Vs_CO%x`
zhC2=iD+n+YWh_KBXJd#Lzh2ql%vBD_sY^m%3a}z&x8zh}t5t2)8t6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