react mathquill npm - boostcamp-2020/Project15-A-Client-Based-Formula-Editor GitHub Wiki

react-mathquill - npm

react-mathquill npm κ³΅μ‹λ¬Έμ„œ λ°”λ‘œκ°€κΈ°

MathQuill κ³΅μ‹λ¬Έμ„œ λ°”λ‘œκ°€κΈ°

πŸ› οΈ ν•„μš”ν•  것 같은 API Methods 정리

  • .latex() : Returns the contents as LaTeX.

β‡’ ex) mathField.latex() : ν™”λ©΄μ—μ„œ μž…λ ₯받은 λ‚΄μš©μ„ LaTeX으둜 λ³€ν™˜

  • .focus() : Puts the focus on the editable field.
  • .blur() : Removes focus from the editable field.
  • .write(latex_string) : Write the given LaTeX at the current cursor position.
  • .cmd(latex_string) : Enter a LaTeX command at the current cursor position.

β‡’ If the cursor does not have focus, writes to last position the cursor occupied in the editable field.

  • moveToLeftEnd() : Move the cursor to the left/right end of the editable field
  • moveToRightEnd() : Move the cursor to the left/right end of the editable field
  • .keystroke(keys) : Simulates keystrokes given a string like "Ctrl-Home Del"

β‡’ ex) mathField.keystroke('Shift-Left'); // Selects character before the current cursor position

  • typedText(text) : Simulates typing text

β‡’ ex) mathField.typedText('x=-b\pm \sqrt b^2 -4ac');