웹페이지 수학식 표기 예제

 

HTML 페이지의 헤드 영역에 아래처럼 추가하고 body 영역에 mathjax에 지원하는 수식 형태로 표기해 준다.

 

<head>
    <meta charset="UTF-8">
    <title>수학식 표현</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>

 

 

[ math.html ]

<!DOCTYPE html>
<html lang="ko">
<head>
    <meta charset="UTF-8">
    <title>수학식 표현</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>
    <h1>MathJax 수학식 표현 예제</h1>
    <p>1. \( y = 3^2 + 4^2 \)</p>
    <p>2. \( y = \sqrt{3^2 + 4^2} \)</p>
    <p>3. \( y = 5 \)</p>
    <p>1. \( x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} \)</p>
    <p>2. \( c = \sqrt{a^2 + b^2} \)</p>
    <p>3. \( \frac{dy}{dx} = 3x^2 + 4x + 1 \)</p>
    <p>4. \( \int_0^1 x^2 \, dx = \frac{1}{3} \)</p>
    <p>5. \( A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}, \quad B = \begin{pmatrix} 5 & 6 \\ 7 & 8 \end{pmatrix} \quad \Rightarrow \quad AB = \begin{pmatrix} 19 & 22 \\ 43 & 50 \end{pmatrix} \)</p>
    <p>6. \( f(x) = f(a) + f'(a)(x - a) + \frac{f''(a)}{2!}(x - a)^2 + \frac{f'''(a)}{3!}(x - a)^3 + \cdots \)</p>
    <p>7. \( z = r(\cos \theta + i \sin \theta) \)</p>
    <p>8. \( f(x) = \frac{L}{1 + e^{-k(x - x_0)}} \)</p>
    <p>9. \( F(\omega) = \int_{-\infty}^{\infty} f(t) e^{-i \omega t} \, dt \)</p>
    <p>10. \( P(A|B) = \frac{P(B|A) P(A)}{P(B)} \)</p>
    <p>11. \( \frac{\frac{a^3}{b-4}}{y^2 + y - 1} = k \)</p> 
    <p>12. \( \frac{a^3}{(b-4)(y^2 + y - 1)} = k \)</p> 
</body>
</html>

 

 

[ 실행 화면 ] math.html을 더블클릭하여 실행

 

반응형

+ Recent posts