environment/lib/python2.7/site-packages/IPython/lib/latextools.py
def latex_to_png(s, encode=False, backend='mpl'):
    """Render a LaTeX string to PNG.

    Parameters
    ----------
    s : str
        The raw string containing valid inline LaTeX.
    encode : bool, optional
        Should the PNG data bebase64 encoded to make it JSON'able.
    backend : {mpl, dvipng}
        Backend for producing PNG data.

    None is returned when the backend cannot be used.

    """
    if backend == 'mpl':
        f = latex_to_png_mpl
    elif backend == 'dvipng':
        f = latex_to_png_dvipng
    else:
        raise ValueError('No such backend {0}'.format(backend))
    bin_data = f(s)
    if encode and bin_data:
        bin_data = encodestring(bin_data)
    return bin_data
def latex_to_png(s, encode=False, backend='mpl'):
    """Render a LaTeX string to PNG.

    Parameters
    ----------
    s : str
        The raw string containing valid inline LaTeX.
    encode : bool, optional
        Should the PNG data bebase64 encoded to make it JSON'able.
    backend : {mpl, dvipng}
        Backend for producing PNG data.

    None is returned when the backend cannot be used.

    """
    if backend == 'mpl':
        f = latex_to_png_mpl
    elif backend == 'dvipng':
        f = latex_to_png_dvipng
    else:
        raise ValueError('No such backend {0}'.format(backend))
    bin_data = f(s)
    if encode and bin_data:
        bin_data = encodestring(bin_data)
    return bin_data
Render a LaTeX string to PNG.

    Parameters
    ----------
    s : str
        The raw string containing valid inline LaTeX.
    encode : bool, optional
        Should the PNG data bebase64 encoded to make it JSON'able.
    backend : {mpl, dvipng}
        Backend for producing PNG data.

    None is returned when the backend cannot be used.