use subprocess module in preview.py instead of os.system
make preview function threadsafe again
added support for a few new kwargs to the preview function + cleanup
use more kwargs for SymPyDeprecationWarning
updated docstring
reworded docstring
fix test failures
removed call to sleep()
fix doctest error

Signed-off-by: Thomas Hisch <t.hisch@gmail.com>
preview: cleanup
unskip strinio doctest
preview: fix unable to open file problem
fix different dvi filename problem (cat template.tex | latex)

see PR1779 for a description of the problem
minor cleanup
fixed wrong import of StringIO function
moved find_executable from galgebra/latex_ex.py to utilities/misc.py
update docstring + remove 'import pexpect'
preview: replace "formatstr" kwarg by "preamble"
use preview function in sympy/galgebra/latex_ex.py
preview: support for writing gen. tex file to disk

Signed-off-by: Thomas Hisch <t.hisch@gmail.com>