texmf=$(kpsewhich -var-value=TEXMFHOME)
#Saves the texmf tree location to a local variable
if [ -d "$texmf" ]; then #Checks to see if the texmf tree exists
	echo "The local texmf tree detected. Process continuing..." #The texmf tree exists
else
	echo "Your file system does not contain a texmf tree"
	echo "Would you like me to create one for you? [y-yes/n-no]"
	read -s -n1 create
	if [ "$create" == "y" ] || [ "$create" == "Y" ]; then
		mkdir -p "$texmf/bibtex/bib"
		mkdir -p "$texmf/bibtex/bst"
		mkdir -p "$texmf/doc"
		mkdir -p "$texmf/fonts/afm"
		mkdir -p "$texmf/fonts/map"
		mkdir -p "$texmf/fonts/misc"
		mkdir -p "$texmf/fonts/pk"
		mkdir -p "$texmf/fonts/source"
		mkdir -p "$texmf/fonts/tfm"
		mkdir -p "$texmf/fonts/type1"
		mkdir -p "$texmf/generic"
		mkdir -p "$texmf/scripts"
		mkdir -p "$texmf/source"
		mkdir -p "$texmf/tex/context"
		mkdir -p "$texmf/tex/generic"
		mkdir -p "$texmf/tex/latex"
		mkdir -p "$texmf/tex/plain"
		mkdir -p "$texmf/tex/xelatex"
		mkdir -p "$texmf/tex/xetex"
		echo "Local TeXmf tree created. Process continuing..."
	fi
fi
if [ -d "$texmf" ]; then
	echo "Downloading MLA13 package file..."
	curl -o "$texmf/tex/mla13.sty" https://raw.github.com/jackson13info/mla13/master/mla13.sty
	echo "Download Complete"
	echo "Setting up package..."
	echo "Package Setup"
	echo "Downloading Documentation..."
	curl -o "$texmf/doc/mla13_documentation.pdf" http://www.jackson13.info/mla13/Documentation.pdf
	echo "Documentation Download Complete"
	echo "MLA13 Package Successfully Installed"
fi