개발로 하는 개발

MathJax, LaTeX Tistory에 사용해 수식 입력하기 본문

Tips

MathJax, LaTeX Tistory에 사용해 수식 입력하기

jiwon152 2024. 1. 31. 15:06

MathJax is a cross-browser JavaScript library that displays mathematical notation in web browsers, using MathML, LaTeX and ASCIIMathML markup.

https://www.mathjax.org

 

MathJax

Beautiful math in all browsers.

www.mathjax.org

https://www.jsdelivr.com/package/npm/mathjax

 

jsDelivr - A free, fast, and reliable CDN for JS and Open Source

Optimized for JS and ESM delivery from npm and GitHub. Works with all web formats. Serving more than 150 billion requests per month.

www.jsdelivr.com

"$$" 사이에 수식을 넣는다

$ y =a \times x $

header tag 내부에 아래 html을 추가한다.

<script>
MathJax = {
  tex: {
    inlineMath: [['$', '$'], ['\\(', '\\)']],
    packages: ['base', 'newcommand', 'configMacros']
  }
};
</script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>