I have written some code in Python 2.7 that will read a string from a .ini file and generate a .png image of the string in LaTeX format using sympy.preview
. The idea is to use this script to generate the images in the background while I am typing them out. The problem is that even when I run the script in the background (using pythonw.exe), two empty command line windows will pop up for latex.exe
and dvipng.exe
and close immediately. This is annoying because it interrupts my typing. I want to be able to do it "on the fly" without being interrupted.
Is there a way to prevent these windows from opening?
Here is my minimum working example:
from sympy import preview # for generating Latex images
import ConfigParser # for reading .ini files
# read the latex commands from the .ini file:
config = ConfigParser.RawConfigParser()
config.read('mathPredictor.ini')
one = config.get('Words', 'one')
prefix = '\\Huge $' # make the Latex equations bigger
suffix = '$'
eqone = prefix + one + suffix
# for generating Latex images:
preview(eqone, viewer='file', filename='one.png', euler=False)
for the .ini file
[Words]
one=\alpha
I am running Windows 8 64-bit with Python 2.7.10. This question is cross-posted at tex.SE.