← all projects

Dev Tools Active 2025

type-it-up

Handwritten notes to LaTeX

The problem

Transcribing handwritten math, chemistry notation, and diagrams into LaTeX is tedious and time-consuming, creating friction for students and researchers turning notes into typeset documents.

The approach

Built a Next.js app that sends handwritten pages through a vision-language model (Groq) to parse math, chemistry, and diagrams into clean LaTeX, converting diagrams into TikZ, with export to PDF or a ready-to-open Overleaf archive.

Next.jsGroq Vision AIKaTeXTikZLaTeXPDF Generation

type-it-up turns a photo of a handwritten page - equations, chemistry notation, diagrams - into clean, compilable LaTeX. Take a picture, get a document you can actually use.

the problem

Every student knows this pain: solve a problem set by hand, then spend as long again typing it into LaTeX. Existing OCR tools struggle with math and chemistry notation, and almost none of them handle hand-drawn diagrams at all.

how it works

A handwritten page is sent through a vision-language model (Groq’s vision API) that parses the content by type:

  • Math and chemistry notation → clean LaTeX, rendered live with KaTeX for a preview.
  • Diagrams → TikZ, so the output stays editable rather than becoming a flattened image.
async function parsePage(imageDataUrl: string) {
  const result = await groqVision.parse(imageDataUrl, {
    targets: ["latex", "tikz"],
  });
  return result; // { latex: string, tikz: string[] }
}

export

Once parsed, the page can be exported as a rendered PDF, or as a full Overleaf-ready archive (.tex + assets), so the transcription drops straight into whatever workflow the document was headed for anyway.

why I built it

I wanted the gap between “handwritten notes” and “typeset document” to be one photo wide. Vision-language models made that possible for content that used to defeat specialized OCR - diagrams and dense notation alike.

What I took away

  • Vision-language models handle messy handwriting and mixed content (equations + diagrams on the same page) far more robustly than a specialized OCR pipeline.
  • Diagrams need a different output target than equations - TikZ, not just LaTeX math mode - to stay editable after export.
  • Shipping directly to an Overleaf archive removes the last bit of friction between 'recognized' and 'usable'.

0 comments

0/1000

Loading…