test-math.blade.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Math Test</title>
  5. <meta name="csrf-token" content="{{ csrf_token() }}">
  6. <link rel="stylesheet" href="/css/katex/katex.min.css">
  7. <style>
  8. body { font-family: Arial, sans-serif; padding: 20px; }
  9. .math-container { margin: 20px 0; padding: 15px; border: 1px solid #ddd; }
  10. </style>
  11. </head>
  12. <body>
  13. <h1>数学公式测试</h1>
  14. <div class="math-container">
  15. <h3>测试 1: 基本公式</h3>
  16. <p>$x^2 - 9$</p>
  17. </div>
  18. <div class="math-container">
  19. <h3>测试 2: 分式公式</h3>
  20. <p>$\frac{x^2 - 9}{x + 3}$</p>
  21. </div>
  22. <div class="math-container">
  23. <h3>测试 3: 求根公式</h3>
  24. <p>$x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$</p>
  25. </div>
  26. <script src="/js/katex.min.js"></script>
  27. <script src="/js/auto-render.min.js"></script>
  28. <script>
  29. renderMathInElement(document.body, {
  30. delimiters: [
  31. {left: '$$', right: '$$', display: true},
  32. {left: '$', right: '$', display: false},
  33. {left: '\\(', right: '\\)', display: false},
  34. {left: '\\[', right: '\\]', display: true}
  35. ],
  36. throwOnError: false
  37. });
  38. console.log('Math rendered');
  39. </script>
  40. </body>
  41. </html>