LaTeX rendering component for Mathsy applications
npm install mathsy-latexbash
npm install mathsy-latex
or
yarn add mathsy-latex
`
Usage
`typescript
import Latex from 'mathsy-latex';
function MyComponent() {
return (
Math Example
The quadratic formula is: $x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$
);
}
`
Props
- children: string - The LaTeX content to render
- throwOnError?: boolean - Whether to throw an error on invalid LaTeX (default: false)
Features
- Renders LaTeX expressions using KaTeX
- Responsive design with Material-UI
- Error handling with visual feedback
- Sanitized HTML output
- Support for both inline ($) and display ($$) math
Development
1. Clone the repository
2. Install dependencies: yarn install
3. Build the package: yarn build`