import gradio as gr def latex_to_html(latex_str): # MathJax를 이용하여 LaTeX 수식을 HTML로 변환합니다. return f"""
$$ {latex_str} $$
""" iface = gr.Interface(fn=latex_to_html, inputs="text", outputs="html", examples=[["E = mc^2"], ["\\int_{-\\infty}^{\\infty} e^{-x^2} dx = \\sqrt{\\pi}"]], title="LaTeX Renderer with MathJax") iface.launch(share=True)