# I Built Inkwell So My Friend Would Stop Retyping Lecture Notes into LaTeX

> Source: <https://dev.to/itzmeready/i-built-inkwell-so-my-friend-would-stop-retyping-lecture-notes-into-latex-50b3>
> Published: 2026-10-04 22:08:38+00:00

*This is a submission for the [Hacktoberfest Weekend Challenge: Build for a Friend](https://dev.to/challenges/hacktoberfest-weekend-2026-10-01)*

Inkwell turns messy, plain-text lecture notes into a clean study guide, with the math properly typeset and a sharp vector PDF at the end. You paste in whatever you typed during the lecture, an AI model sorts out the structure, and KaTeX renders the formulas. It's open source under the MIT license.

Inkwell is for me and my friend Asuna, a second-year engineering and CS student.

In classes like Linear Algebra, Differential Equations and Machine Learning, the professor talks and writes at full speed, so we type whatever we can into Notepad or a quick Markdown file. The result looks like this:

```
eigenvalues and eigenvectors
linear transformation Av = lambda v where lambda is eigenvalue, v is non zero eigenvector
to find lambda solve characteristic equation det(A - lambda I) = 0
example 2x2 matrix with row 1: 2, 1 and row 2: 1, 2
find eigenvalues: det is (2 - lambda)^2 - 1 = lambda^2 - 4lambda + 3 = 0
factor it: (lambda - 3)(lambda - 1) = 0 so lambda1 = 3 and lambda2 = 1
since A is symmetric eigenvectors are guaranteed to be orthogonal
formula for roots: x = (-b +- sqrt(b^2 - 4ac)) / (2a)
key takeaway: matrix powers can be computed easily via A^k = P * D^k * P^-1
```

By the end of class it's a wall of text. Shorthand like `Av = lambda v` or `[[2,1],[1,2]]` is fine while you're typing, but it's miserable to study from. We were spending 3 to 4 hours every weekend retyping everything into LaTeX or Notion just to make it readable, which is a silly way to spend a weekend.

You paste in the raw notes, pick a layout, and hit "Clean & Format Notes."

**It recognizes the math.** Plain-text equations and matrices become KaTeX automatically. `Av = lambda v` becomes 
Av=λv
, `det(A - lambda I) = 0` becomes 
det(A−λI)=0
, and `[[2, 1], [1, 2]]` becomes:

**It has three layouts:**

**You can draw on it.** A canvas overlay gives you a pen, highlighter, eraser and movable text boxes, so you can sketch a diagram, circle the formula that's definitely going to be on the exam, or scribble in the margins right on top of the rendered math.

**It exports a real vector PDF.** The math fonts stay sharp and your annotations come along with them.

Try it here: [Inkwell on Render](https://inkwell-frontend-net1.onrender.com/)

A few things to try:

Inkwell is an open-source, AI-powered tool that transforms messy, raw, plain-text lecture notes into beautifully formatted, structured PDFs with precisely rendered mathematical formulas. By combining the power of Gemma open-weight models with modern rendering technologies, Inkwell automatically distills chaotic class notes into elegant, highly readable documents and study materials.

Built for students, researchers, and engineers who type fast during lectures and need clean, structured outputs without spending hours manually formatting LaTeX.

`A v = lambda v` are automatically detected, converted to KaTeX `$$A \mathbf{v} = \lambda \mathbf{v}$$`, and rendered in perfect mathematics.` gemma-4-31b-it`, `gemma-4-26b-a4b-it`, `gemma-2-27b-it`)
Inkwell is built around the Gemma family. I wrote a STEM-focused prompt in `llm.py` that asks the model to:

`lambda`, `alpha`, `a/b`, summations, matrix rows) into valid LaTeX, using `$...$` inline and `$$...$$` for blocks`**CUE:**` prompts, explanations and a `## Summary`, while two-column mode gets short, dense bullets that split well across columns
LLMs like to get creative, and I didn't want my formulas rewritten. `backend/math_guard.py` uses regex heuristics to find raw equations (like `A v = lambda v`) and swaps them for placeholders (`⟦EQ1⟧`, `⟦EQ2⟧`). Then it checks that every placeholder survives the trip through the model and puts the formatted KaTeX back afterward.

Engineering notes aren't just text. You need to draw axes, circle things, and write in the margins. `DrawingCanvas.tsx` and `TextBoxLayer.tsx` give you:

Inkwell doesn't render your notes a second time on the server. The preview on your screen is the source of truth, and the PDF is a snapshot of it. When you hit export, the React frontend serializes its live DOM, with the KaTeX math already rendered, and sends it to `/api/compile-pdf`. The backend wraps that HTML in print CSS and hands it to Playwright's headless Chromium, which produces a multi-page vector PDF.

That means the math fonts stay crisp, your annotations come along, and there's no second rendering pipeline to drift out of sync with what you were looking at. It's also why Inkwell skips `window.print()`, which tends to rasterize or clip equations.

Gemma does the thinking, and Render hosts the part people actually open. The frontend is deployed on Render, so Asuna (or anyone else) can use Inkwell from a link, with nothing to install and no setup before a study session.

**Cost.** Many AI study tools sit behind closed APIs and monthly subscriptions that a lot of students can't justify. Open-weight models like Gemma make a tool like this possible without that price tag.

**Privacy.** Lecture notes can include unpublished research, lab data or personal study logs, and some hosted AI services may use prompts for training. Because Gemma's weights are open, the same model can run on your own machine through Ollama or vLLM, so your notes don't have to leave your laptop.

**Freedom to tinker.** Since Inkwell is MIT-licensed, anyone can change the LaTeX rules, add chemistry support with mhchem, build a theme for their university's thesis format, or self-host it offline in a lecture hall with no Wi-Fi.

I made this to fix a real problem for Asuna and me, and to give back those hours of manual LaTeX every weekend.

Made with ❤️ for Hacktoberfest 2026.
