본문 바로가기

[IT/Programming]/HTML related

How can I block MathJax.js to render texts enclosed by backtick ``?

반응형
# How can I block MathJax.js to render texts enclosed by backtick ``? 구글로 검색해보고 , ChatGPT 에게 물어본걸 좀 더 정리함. 정리하는건 사람이/내가 더 나은듯? AI 도 뭐 별거 없어서 ㅡ,.ㅡ;; ## TOC ## Google search (Feat. stackoverflow) 구글 검색에서 뜬 건 . 좀 공부를 해야하고 긴 글을 정독해야 하지만 ref 도 잘 달아주고 해서 좋음. 아주 간단하게는 바로 아래처럼 MathJax.js 를 load 했던걸, ```[.lang-html] <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.6.1/MathJax.js?config=TeX-MML-AM_CHTML"></script> ```/ 아래와 같이 바꿔주면 된다는듯. (That will be faster as well as it is a smaller file.) ```[.lang-html] <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.6.1/MathJax.js?config=TeX-AMS_CHTML"></script> ```/
See for gengeral MathJax settings/usages. 인터넷, Web, HTML, 블로그에서 수식 사용하고 싶은 분들은 참조하세요.
### Upgrading from v2 to v3 Upgrading from v2 to v3 Upgrading from v2 to v3 :: Configuration Changes
The service worker navigation preload request was cancelled before 'preloadResponse' settled. If you intend to use 'preloadResponse', use waitUntil() or respondWith() to wait for the promise to settle.
## ChatGPT: To prevent MathJax from rendering text enclosed by backticks ``. (Wrong answer I think.) If you want to prevent MathJax from rendering text enclosed by backticks, you can do so by modifying the MathJax configuration. To block MathJax from rendering backticks, you can add the following code to your MathJax configuration: ```[.linenums] <script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [['$', '$'], ['\\(', '\\)']], displayMath: [['$$', '$$'], ['\\[', '\\]']], processEscapes: true, ignoreClass: 'nostem|nolatexmath' } }); </script> ```/ The key part is the ignoreClass option, which tells MathJax to ignore any elements with the nostem or nolatexmath classes. You can add these classes to any elements that you want to exclude from MathJax processing.
See for gengeral MathJax settings/usages. 인터넷, Web, HTML, 블로그에서 수식 사용하고 싶은 분들은 참조하세요.
## RRA
  1. stackoverflow.com :: Mathjax strangely render back-tick in code blocks, asked at 2020-05-31, by Hanlin.
    // answered by Davide Cervone, at 2020-06-01.
  2. OpenAI ChatGPT
  3. kipid's blog :: 인터넷, Web, HTML, 블로그에서 수식 사용하기 (Equation or math in HTML, blog)
반응형