38 lines
1.1 KiB
Python
38 lines
1.1 KiB
Python
import webview
|
|
|
|
def create_webview_app():
|
|
html_content = """
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
|
|
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
|
|
<script>
|
|
MathJax = {
|
|
tex: { inlineMath: [['$', '$']], displayMath: [['$$', '$$']] }
|
|
};
|
|
</script>
|
|
<style>
|
|
body { font-family: Arial, sans-serif; margin: 20px; }
|
|
.demo { background: #f0f0f0; padding: 10px; margin: 10px 0; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>MathJax con webview</h1>
|
|
<div class="demo">
|
|
<p>Ecuación simple: $x^2 + y^2 = z^2$</p>
|
|
<p>Ecuación compleja:</p>
|
|
$$\\sum_{n=1}^{\\infty} \\frac{1}{n^2} = \\frac{\\pi^2}{6}$$
|
|
</div>
|
|
</body>
|
|
</html>
|
|
"""
|
|
|
|
webview.create_window('MathJax App', html=html_content, width=800, height=600)
|
|
webview.start()
|
|
|
|
|
|
# Función principal para elegir método
|
|
if __name__ == "__main__":
|
|
create_webview_app()
|