Replies: 1 comment
-
Hi @batchor , I use import createMDX from '@next/mdx'
import remarkGfm from 'remark-gfm'
import remarkMath from 'remark-math'
import rehypeMathjaxChtml from 'rehype-mathjax/chtml'
import rehypeHighlight from 'rehype-highlight'
const withMDX = createMDX({
extension: /\.mdx?$/,
options: {
remarkPlugins: [remarkGfm, remarkMath],
rehypePlugins: [
[rehypeMathjaxChtml, {
chtml: {
fontURL: 'https://cdn.jsdelivr.net/npm/mathjax@3/es5/output/chtml/fonts/woff-v2'
}
}],
rehypeHighlight,
],
},
})
const nextConfig = {
pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'md', 'mdx'],
output: 'export' as const,
trailingSlash: true,
}
export default withMDX(nextConfig) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
I'm using nextjs 15 + mdx + rehypeMathjax to write math-heavy blog articles.
However, the inline equations are rendered as block ones no matter how I config the inline delimiters in mathjax.
Both

$f(x)$
and$$f(x)$$
are rendered into block equation html codes as below:I think the problem is that the options to the rehypeMathjax plugin seems to be not working. Because no matter what delimiters I set (e.g., inline math: [["#," "#"]]), the behavior does not change.
My next.config.mjs:
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions