A React component for LaTeX input with MathQuill integration
npm install mathsy-latex-inputbash
npm install mathsy-latex-input
or
yarn add mathsy-latex-input
`
Usage
`typescript
import LatexInput from 'mathsy-latex-input';
function MyComponent() {
const [value, setValue] = useState('');
return (
Math Input Example
onChange={(latex) => setValue(latex)}
onEnter={(latex) => console.log('Enter pressed:', latex)}
initialValue="x^2 + 2x + 1"
/>
);
}
`
Props
- onChange?: (latex: string) => void - Callback when LaTeX value changes
- onEnter?: (latex: string) => void - Callback when Enter key is pressed
- initialValue?: string - Initial LaTeX value
- template?: string - Template string with placeholders for multiple inputs
Features
- On-screen keyboard with mathematical symbols
- Support for templates with multiple input fields
- Keyboard navigation
- Responsive design
- Integration with MathQuill for LaTeX editing
Development
1. Clone the repository
2. Install dependencies: yarn install
3. Build the package: yarn build`