Inspiration

We’ve all been there — spending hours typing LaTeX just to get a clean-looking homework or report. It’s slow, picky, and kind of a pain, especially when some classes require everything in LaTeX. On top of that, turning your scratch paper sketches into polished figures for papers or slides is another time sink. Existing handwriting-to-LaTeX conversion tools focus on processing single equations or short expressions. While useful for small tasks, they fall short when it comes to full derivations, structured proofs, or entire documents. These systems often lack contextual understanding, leading to errors when symbols are ambiguous or when spatial layout carries meaning. Additionally, requiring users to process one equation at a time interrupts workflow and becomes cumbersome. As a result, they provide only marginal assistance and fail to reduce the effort required to write and format LaTeX documents, especially in academic or technical settings. That’s why we built Texify. It takes your handwritten notes and diagrams and turns them into high-quality LaTeX PDFs, automatically. No more retyping math or redrawing figures — just write like you normally would, and Texify does the rest.

What it does

Texify takes user handwritten notes, figures, problem solutions, or even scratch work, and converts them into PDF format. Texify cleans up and smoothes out the logical flow within the derivation, inserting English explanations for better reader understanding even when the user inputs only handwritten math.

How we built it

Texify generates a polished LaTeX PDF by running two pipelines in parallel: text processing and figure rendering. Users can upload either individual images or a full PDF; images are first converted into a unified PDF for consistency. The text pipeline uses Gemini 2.5 Pro to extract handwritten content and convert it into structured LaTeX. It supports three processing modes: verbatim transcription, logical rewriting for improved clarity, and summarization for concise output. During this step, placeholders are inserted where figures appear, and the system retries compilation if errors are detected. In parallel, Texify processes figures by detecting visual elements in the input and generating a numbered list of figure descriptions. This numbering provides a unique identifier for each figure, allowing a pool of LLM agents to process them all simultaneously without ambiguity. These descriptions are then used to generate Asymptote code via the LLM agent, which is compiled into high-quality diagrams. Rendering is performed concurrently for efficiency, and failed attempts are retried with appended error diagnostics. Once both text and figures are ready, they are merged into a single .tex file, which can be compiled and returned to the user as a clean, readable PDF, Markdown, or other document formats.

Challenges we ran into

We ran into many problems with syntactically incorrect Asymptote code, which we fixed by appending the error message and asking the model to revise the Asymptote code. Our underlying multimodal model also struggles to replicate the figure exactly with Asymptote and closely align the generated images with the original figures. Therefore, we will look into using more traditional CV methods to improve image generation and construct higher quality figures.

Accomplishments that we're proud of

We finished this project in just 10 hours and got to spend the rest of our time sleeping and socializing.

What we learned

We found Gemini 2.5 Pro to be especially effective for rapid prototyping. By first designing a high-level logic flow diagram, we were able to prompt Gemini to generate the initial skeleton of our entire codebase. This significantly accelerated development, allowing us to iterate quickly and focus our efforts on fine-tuning functionality and integrating complex components.

What's next for Texify

In future iterations, we aim to improve the quality and reliability of figure generation by incorporating deep learning models specifically for Asymptote code generation, which would help Texify better understand diagram structure and produce more accurate visual outputs. Specifically, we plan to integrate traditional computer vision techniques to more precisely detect and crop hand-drawn sketches from PDFs. To further enhance visual fidelity, we are exploring generative models such as diffusion models and GANs for style transfer and image sharpening, enabling more aligned and aesthetically refined figure generation.

Built With

Share this project:

Updates