Use math annotations in your Markdown. Support LaTeX math.
Works on SSG, no client-side JavaScript needed.
Lift($L$) can be determined by Lift Coefficient ($C_L$) like the following
equation.
$$
L = \frac{1}{2} \rho v^2 S C_L
$$
Lift(
npm i remark-math rehype-mathjax --save-dev
remark-math
makes AST changes for later processing by rehype-mathjax
rehype-mathjax
transforms work from remark-math
into equations, etc.
In your astro.config.mjs
file, add the plugins
export default defineConfig({
//integrations: [ixmageOptimize()],
markdown: {
//mode: 'mdx',
remarkPlugins: [
'remark-gfm', 'remark-smartypants',
'remark-math'
],
rehypePlugins: [
//'rehype-slug', < needed only prior beta.22
'rehype-mathjax'
]
}
});
Because you are adding extra plugins, you will need to explicitly also include remark-gfm
and remark-smartypants
Now my site supports markdown math if I ever need it.
A table | co-existing | with math-latex |
---|---|---|
1,1 | 1,2 | 1,3 |
2,1 | 2,2 | 2,3 |
3,1 | 3,2 | 3,3 |