Exemplo n.º 1
0
def process_latex(s, loc, tokens):
    latex_input = tokens["latex"]
    eq = r"\begin{align*}%s\end{align*}"

    try:
        f_svg = build_tex_item(eq % latex_input, filename_only=True)
        with open(f_svg) as FIN:
            svg = FIN.read()
    except:
        print "Problem with", latex_input
        svg = eq
    return svg
Exemplo n.º 2
0
def process_latex(s, loc, tokens):
    latex_input = tokens['latex']
    eq = r"\begin{align*}%s\end{align*}"

    try:
        f_svg = build_tex_item(eq % latex_input, filename_only=True)
        with open(f_svg) as FIN:
            svg = FIN.read()
    except:
        print "Problem with", latex_input
        svg = eq
    return svg
Exemplo n.º 3
0
def process_latex(s,loc,tokens):

    if keep_equations:
        return u"${}$".format(' '.join(tokens))

    latex_input = tokens['latex']
    eq = r"\begin{align*}%s\end{align*}"

    try:
        f_svg = build_tex_item(eq%latex_input, filename_only=True)
        with open(f_svg) as FIN:
            svg = FIN.read()
    except Exception as Ex:       
        logging.warning("Could not render {}".format(latex_input))
        svg = eq
    return svg
Exemplo n.º 4
0
def process_latex(s, loc, tokens):

    if keep_equations:
        return u"${}$".format(" ".join(tokens))

    latex_input = tokens["latex"]
    eq = r"\begin{align*}%s\end{align*}"

    try:
        f_svg = build_tex_item(eq % latex_input, filename_only=True)
        with open(f_svg) as FIN:
            svg = FIN.read()
    except Exception as Ex:
        logging.warning("Could not render {}".format(latex_input))
        svg = eq
    return svg