Skip to content

Instantly share code, notes, and snippets.

@brews
Last active December 1, 2015 00:21
Show Gist options
  • Save brews/4018016 to your computer and use it in GitHub Desktop.
Save brews/4018016 to your computer and use it in GitHub Desktop.
Quickly compile American Meteorological Society template LaTeX files into a PDF for publication
#! /usr/bin/env bash
# publishTex.sh
# 2010-06-08
# This is a quick script to help produce a PDF from .tex files for AMS publication.
# Run it from Bash like so:
# ./publishTex.sh sample.tex
if [ ! -e "$1" ]
then
echo "The file or directory given does not seem to exist."
exit 1
fi
filename=${1/${1: -4}}
echo "########## $(date +%F) - RUNNING LATEX1 ##########"
latex $filename.tex
echo "########## $(date +%F) - RUNNING BIBTEX ##########"
bibtex $filename
echo "########## $(date +%F) - RUNNING LATEX2 ##########"
latex $filename.tex
echo "########## $(date +%F) - RUNNING LATEX FINAL ##########"
latex $filename.tex
echo "########## $(date +%F) - CONVERTING DVI TO PS ##########"
dvips $filename.dvi -o $filename.ps
echo "########## $(date +%F) - CONVERTING PS TO PDF ##########"
ps2pdf14 $filename.ps
echo "########## $(date +%F) - ALL DONE! ##########"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment