Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,25 +1,14 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
def render_latex(
|
4 |
-
|
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(
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
|
|
|
|
23 |
|
24 |
-
|
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()
|
|