iTranslated by AI
The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
😸
Handling Mathematical Formulas in Next.js + MDX
In this blog built with Next.js and MDX, I would like to enable support for TeX.
First, install @mdx-js/loader.
This is necessary for customizing MDX plugins within next.config.js. If you haven't installed it yet,
npm install @mdx-js/loader
please do so.
After that, run
npm install remark-math@3.0.1
npm install rehype-katex@3.0.0
and then edit next.config.js following the documentation.
Please also refer to the commit in this blog's repository.
Now you are ready to use TeX.
Note that you also need to insert KaTeX CSS within MDX (if you use formulas frequently, it might be better to add the CSS part to the blog template!).
Now you can successfully use
Discussion