#!/bin/bash

if [ $# -ne 1 ]
  then
    echo "Which .tex?"
    exit 1
fi

OUT_NAME="out-$1"
#NILS_STY=~/book/nils.sty

# Headers
HEADER="\documentclass[12pt]{amsbook}
\usepackage{palatino, euler, amsmath, amssymb, comment}
\usepackage{nils}
\usepackage[all]{xy}

\\begin{document}"
FOOTER="\\end{document}"

# Get lib
#cp "$NILS_STY" .

# Make file
echo $HEADER > "$OUT_NAME"
cat $1 >> "$OUT_NAME"
echo $FOOTER >> "$OUT_NAME"

# Compile
pdflatex "$OUT_NAME"
