我们从Python开源项目中,提取了以下9个代码示例,用于说明如何使用utils.tex_escape()。
def autorun_get_latex_interactive_session(cmds, **kargs): ct = conf.color_theme to_latex = lambda s: tex_escape(s).replace("@[@","{").replace("@]@","}").replace("@`@","\\") try: try: conf.color_theme = LatexTheme2() s,res = autorun_get_interactive_session(cmds, **kargs) except StopAutorun,e: e.code_run = to_latex(e.code_run) raise finally: conf.color_theme = ct return to_latex(s),res