seawolf2357 commited on
Commit
1eef0a3
·
verified ·
1 Parent(s): ef4e60f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -21
app.py CHANGED
@@ -1,25 +1,14 @@
1
  import gradio as gr
2
 
3
- def render_latex(latex_string):
4
- preamble = """
5
- <!DOCTYPE html>
6
- <html>
7
- <head>
8
- <script src='https://polyfill.io/v3/polyfill.min.js?features=es6'></script>
9
- <script id='MathJax-script' async src='https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js'></script>
10
- </head>
11
- <body>
12
- $$""" + latex_string + """$$
13
- </body>
14
- </html>
15
- """
16
- return preamble
17
 
18
- iface = gr.Interface(fn=render_latex,
19
- inputs=gr.Textbox(lines=2, placeholder="Enter LaTeX String Here..."),
20
- outputs="html",
21
- title="LaTeX Renderer",
22
- description="Enter a LaTeX string to render it!")
 
 
23
 
24
- if __name__ == "__main__":
25
- iface.launch(share=True)
 
1
  import gradio as gr
2
 
3
+ def render_latex(latex_code):
4
+ return latex_code
 
 
 
 
 
 
 
 
 
 
 
 
5
 
6
+ iface = gr.Interface(
7
+ fn=render_latex,
8
+ inputs=gr.TextArea(placeholder="Enter LaTeX code here...", default="E = mc^2"),
9
+ outputs="text",
10
+ title="LaTeX Code Renderer",
11
+ description="This interface returns LaTeX code as is. Please use a LaTeX renderer in your browser to see the formatted output."
12
+ )
13
 
14
+ iface.launch()