|
<!DOCTYPE html> |
|
<html lang="fr"> |
|
<head> |
|
<meta charset="UTF-8"> |
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|
<title>Éditeur LaTeX avec MathJax</title> |
|
<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-mml-chtml.js"></script> |
|
</head> |
|
<body> |
|
<h2>Entrez votre LaTeX ci-dessous</h2> |
|
<input type="text" id="latex-input" placeholder="Entrez votre LaTeX ici" size="50"> |
|
<button onclick="renderLatex()">Afficher</button> |
|
<div id="output" style="margin-top: 20px; border: 1px solid #ccc; padding: 10px;"></div> |
|
|
|
<script> |
|
function renderLatex() { |
|
var input = document.getElementById('latex-input').value; |
|
var output = document.getElementById('output'); |
|
output.innerHTML = `\\(${input}\\)`; |
|
MathJax.typesetPromise(); |
|
} |
|
</script> |
|
</body> |
|
</html> |
|
|