June 2025Personal Project · personal

React LaTeX Formula Converter

Type math as plain text and see it rendered as LaTeX instantly. Includes a categorized math keyboard and one-click copy.

React LaTeX Formula Converter

built with

  • React
  • Vite
  • TypeScript
  • Tailwind
  • Lodash
  • GitHub Actions

about the project

React LaTeX Formula Converter is a web app that turns plain-text math expressions into rendered LaTeX in real time. I built it to make typing complex formulas online faster for students, educators and developers, without needing to know LaTeX syntax by heart.

I designed and developed the app end to end with React, TypeScript and Vite, styled with Tailwind CSS. Rendering is handled by MathJax through better-react-mathjax. An on-screen math keyboard groups symbols into categories (Greek letters, logic, set theory, functions and relations, derivatives and integrals) and inserts each one at the cursor position. A copy button sends the formula to the clipboard, and the app supports light and dark themes plus an in-app feedback form.

The main challenge was keeping the live preview smooth: re-rendering MathJax on every keystroke makes typing feel laggy. I debounced the input with lodash (300 ms), so rendering runs once the user pauses, and memoized the keyboard so it doesn’t re-render on every keystroke. Inserting symbols where the cursor is, instead of at the end of the text, required tracking the input’s selection and putting the cursor back right after the inserted symbol.