MathJax사용하기

Ghost와 함께 수식을 사용해야하다 보니, 찾아본게 MathJax였다.

MathJax 설치

MathJax를 사용하는 방법은 두가지가 있다. 첫번째로는 Injection이 있고 두번째는 직접 theme에 추가하는 방법이다. 여기서는 후자인 theme에 직접 추가하는 방법에 대해 설명하낟.

content가 설치된 폴더는 /home/user/ghost라고 하면, 여기에 theme 폴더에 MathJax.js를 다운로드 받아 복사해 놓는다. 이후 default.hbs 파일을 열어

section에 아래 코드를 집어 넣는다.
<script type="text/javascript" src="{{asset "js/MathJax.js"}}">  
</script>  

그리고 다시 시작하면 끝!!

사용 방법

$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$

위 수식을 입력할려면, 수식 앞뒤에 "$$"에 입력하면 된다. a

$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$

Reference

[1] http://academy.ghost.org/adding-mathjax-to-your-ghost-blog/

comments powered by Disqus