별의 공부 블로그 🧑🏻‍💻
728x90
728x170

수식 사용 시, 자동 줄바꿈 기능 설정하는 방법 (MathJax)

들어가며

  • MathJax 등 수식 관련 플러그인을 사용할 때 화면 크기 이상의 수식을 적는 경우 자동 줄바꿈이 되도록 설정할 수 있다.
  • 보통은 자동 줄바꿈이 되지 않도록 설정되어 있어, 수식이 짤리는 경우가 발생한다.
  • 보통 PC 환경 보다는 모바일 환경에서 자주 발생한다.

 

방법

  • 다음과 같이 .Config 속성에 "HTML-CSS", "CommonHTML", "SVG" 속성을 넣어준다.
<script type="text/x-mathjax-config">
    MathJax.Hub.Config({
    tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]},    
    "HTML-CSS": { linebreaks: { automatic: true } },      // 추가
    CommonHTML: { linebreaks: { automatic: true } },      // 추가
    SVG: { linebreaks: { automatic: true } }              // 추가
    });
</script>

 

참고 사이트

 

MathJax equations is not mobile responsive? · Issue #2465 · mathjax/MathJax

I have this equation of MathJax in my site, while viewing the size of the site in mobile view, all the other text are responsive but the equations of mathJax are not responsive. How can I make thes...

github.com

 

728x90
그리드형(광고전용)
⚠️AdBlock이 감지되었습니다. 원할한 페이지 표시를 위해 AdBlock을 꺼주세요.⚠️
starrykss
starrykss
별의 공부 블로그 🧑🏻‍💻


📖 Contents 📖