var mathmode = require("mathmode")
var fs = require('fs');
var characterlist = require('./characterlist.json');

var i = 0
function write(){
    if(i<characterlist.length){
        var sym = characterlist[i]
        var fileName = "icons/latex/tex"+i+".png"
        var myFile = fs.createWriteStream(fileName);
        var latex = sym["Latex"]

        var image = mathmode(latex, {dpi:3000, packages:["amsmath", "amssymb", "stmaryrd", "latexsym", "textcomp", "wasysym", "marvosym", "mathrsfs", "tipa", "upgreek", "gensymb", "esint", ""]}).pipe(myFile)
        
        i++
        setTimeout(write, 200)
    }
}

write()
//dsfont, bbold