Changed to make use of bulit-in temporary directory creation. Fixed bug that would cause the script to fail if no preamble file were provided. Changed script so that it does not fail if the path to the input tikz figure has a space in it.