MathML Getting Started - boostcamp-2020/Project15-A-Client-Based-Formula-Editor GitHub Wiki

MathML κ³΅μ‹λ¬Έμ„œ κ°€μ΄λ“œ λ°”λ‘œκ°€κΈ°
MDN MathML λ°”λ‘œκ°€κΈ°

🐀 Beginner's Guide

  • HTML5 μ—μ„œ μ‚¬μš© κ°€λŠ₯
  • 기본적인 μˆ˜ν•™μ  κ΅¬μ‘°λŠ” mathml.css 둜 μΆ©λΆ„
  • 헀더에 mathml.css μ‚½μž…
<script src="[https://fred-wang.github.io/mathml.css/mspace.js](https://fred-wang.github.io/mathml.css/mspace.js)"></script>
  • 더 λ³΅μž‘ν•œ ꡬ쑰가 ν•„μš”ν•œ 경우 MathJax 라이브러리λ₯Ό MathML ν΄λ¦¬ν•„λ‘œ μ‚¬μš©ν•œλ‹€.
    • μŠ€νƒ€μΌ 속성 μ‚¬μš©ν•˜κΈ° μœ„ν•΄μ„œ ν•„μš”!
<script src="[https://fred-wang.github.io/mathjax.js/mpadded-min.js](https://fred-wang.github.io/mathjax.js/mpadded-min.js)"></script>
  • MathML의 루트 μš”μ†ŒλŠ” <math>
<math xmlns="http://www.w3.org/1998/Math/MathML">
    <mi>z</mi>
    <mo>=</mo>
    <mn>2</mn>
    <mo>-</mo>
    <mn>3</mn>
  </math>

Token Elements

  • mn : number token

    • λΆ€ν˜Έ μ—†λŠ” μ •μˆ˜ λ˜λŠ” μ‹€μˆ˜ 포함
    • 2, 3.04
    • μŒμˆ˜λŠ” ν¬ν•¨ν•˜μ§€ μ•ŠμœΌλ©°, -(λ§ˆμ΄λ„ˆμŠ€)λŠ” μ—°μ‚°μžμ— ν¬ν•¨λœλ‹€.
  • mi : identifier token

    • ν•¨μˆ˜ 이름 및 기호, μƒμˆ˜ 포함
    • x, sin, Ο€
  • mo : operator token

    • μˆ˜ν•™ μ—°μ‚°μž 포함
    • +, -, βˆ‘

Styling

  • mathvariant : font style

    • normal, bold, italic, bold-italic, script
  • mathsize : font size

    • small, normal, big, 12px
  • mathcolor : font color

  • mathbackground

<math>
    <mi>y</mi>

    <mo>=</mo>

    <mi mathbackground="red">m</mi><mi>x</mi>
    <mo>+</mo>
    <mi mathcolor="blue">c</mi>

    <mo>=</mo>

    <mstyle mathbackground="red">
      <mn>3</mn><mo>t</mo>
    </mstyle>
    <mi>x</mi>
    <mo>+</mo>
    <mn mathcolor="blue" mathvariant="bold">4</mn>
</math>
⚠️ **GitHub.com Fallback** ⚠️