Astro component to auto-render math in element, based on Katex
Math in astro markdown is not working with astro > 1.0.0-beta.31. #issue-3714
Install | Try it now | Blog Demo
$ npm install astro-katex katex
import katex from 'astro-katex';
export default defineConfig({
integrations: [ katex() ],
});
---
import AstroKatex from 'astro-katex/AstroKatex.astro'
---
<AstroKatex is:raw>
Look again at \(\textbf{Figure A} \) and \(\textbf{Figure B}\). Notice that in both graphs, as \(x\) approaches \(7\), the output values approach \(8\). This means
\[
\lim_{x \to 7} f(x) = \lim_{x \to 7} g(x)
\]
</AstroKatex>
Look again at
---
import Expr from 'astro-katex/OnlyExpression.astro'
---
A simple mathematical expression:
<Expr>
\sqrt{3x-1}+(1+x)^2
</Expr>
A simple mathematical expression:
A number of options are now supported. For a comprehensive list please visit: here
MIT
Note: Some
$\LaTeX$ syntax may not be supported by KaTeX itself.