'Generate a tex file to render the tex string at a specific font size
returns the file name'

def make_tex(self, tex, fontsize):

    basefile = self.get_basefile(tex, fontsize)
    texfile = (u'%s.tex' % basefile)
    custom_preamble = self.get_custom_preamble()
    fontcmd = {u'sans-serif': u'{\\sffamily    %s}', u'monospace': u'{\\ttfamily    %s}'}.get(self.font_family, u'{\\rmfamily    %s}')
    tex = (fontcmd % tex)
    if rcParams[u'text.latex.unicode']:
        unicode_preamble = u'\\usepackage{ucs}\n\\usepackage[utf8x]{inputenc}'
    else:
        unicode_preamble = u''
    s = (u'\\documentclass{article}\n%s\n%s\n%s\n\\usepackage[papersize={72in,72in},body={70in,70in},margin={1in,1in}]{geometry}\n\\pagestyle{empty}\n\\begin{document}\n\\fontsize{%f}{%f}%s\n\\end{document}\n' % (self._font_preamble, unicode_preamble, custom_preamble, fontsize, (fontsize * 1.25), tex))
    with open(texfile, u'wb') as fh:
        if rcParams[u'text.latex.unicode']:
            fh.write(s.encode(u'utf8'))
        else:
            try:
                fh.write(s.encode(u'ascii'))
            except UnicodeEncodeError as err:
                mpl.verbose.report(u"You    are    using    unicode    and    latex,    but    have    not    enabled    the    matplotlib    'text.latex.unicode'    rcParam.", u'helpful')
                raise
    return texfile
