Esempio n. 1
0
def ext_math_role(role, raw, text, line, inliner, options={}, content=[]):
    text = replace_mathdefs(inliner.document, raw.split('`')[1])
    return math_role(role,
                     raw,
                     text,
                     line,
                     inliner,
                     options=options,
                     content=content)
Esempio n. 2
0
def new_math_role(role, rawtext, text, lineno, inliner, 
                  options={}, content=[]):
    """New math role parsing the latex code."""
    try:
        math_macros = inliner.document.math_macros
    except AttributeError:
        pass
    else:
        if math_macros:
            rawtext = multiple_replace(rawtext, math_macros)
            text = rawtext.split('`')[1]

    return math_role(role, rawtext, text, lineno, inliner,
                     options=options, content=content)
Esempio n. 3
0
def ext_math_role(role, raw, text, line, inliner, options = {}, content = []):
  text = replace_mathdefs(inliner.document, raw.split('`')[1])
  return math_role(role, raw, text, line, inliner, options = options,
                   content = content)