Handwriting to LaTeX Skill
Recognise handwritten notes or problem sets (images or PDFs) and convert them into a complete, Overleaf-ready .tex file.
Supported Input Types
| Format |
Handling |
| JPG / PNG images |
Direct visual recognition |
| Scanned PDFs |
Page-by-page recognition |
| iPad handwriting PDFs |
Same as above — pay attention to stylus stroke recognition |
If the user uploads multiple pages, process them in order and merge into a single .tex file.
Output Structure
Generate a complete, self-contained .tex file with the following structure:
\documentclass[12pt, a4paper]{article}
% ─── Packages ────────────────────────────────────
\usepackage{amsmath, amssymb, amsthm} % Mathematics
\usepackage{physics} % \dv, \pdv, \bra, \ket etc.
\usepackage{geometry} % Page margins
\usepackage{graphicx} % Images
\usepackage{booktabs} % Tables
\usepackage{array} % Enhanced matrices
\usepackage{hyperref} % Hyperlinks
\usepackage{setspace} % Line spacing
\usepackage{enumitem} % List formatting
\geometry{margin=2.5cm}
\setstretch{1.3}
% ─── Cover page (optional — remove if not needed) ─
\title{Assignment / Notes Title}
\author{Your Name \\ Your Institution}
\date{\today}
% ──────────────────────────────────────────────────
\begin{document}
\maketitle % Remove this line if no cover page is needed
% Body content starts here
...
\end{document}
Recognition and Conversion Rules
Mathematical Expressions
- Inline expressions:
$...$
- Multi-step derivations:
\begin{align*}...\end{align*} (with * — no line numbering)
- Single standalone equations:
\[ ... \] — do not use \begin{equation}
- Never output numbered equation tags — do not use
\tag{}, \label{}, or \ref{} unless the user explicitly requests them
- Preserve every step of a derivation exactly as written — do not skip steps
- Common symbol reference:
| Handwritten |
LaTeX |
| Vector arrow |
\vec{v} or \mathbf{v} |
| Partial derivative |
\frac{\partial f}{\partial x} or \pdv{f}{x} |
| Integral |
\int_{a}^{b} f(x)\,dx |
| Summation |
\sum_{i=1}^{n} |
| Infinity |
\infty |
| Quantum state |
\ket{\psi}, \bra{\phi} |
| Expectation value |
\langle \hat{A} \rangle |
| Reduced Planck constant |
\hbar |
| Hamiltonian |
\hat{H} |
Matrices and Tables
- Matrices:
\begin{pmatrix}...\end{pmatrix} (round brackets) or bmatrix (square brackets)
- Augmented matrices:
\left[\begin{array}{cc|c}...\end{array}\right]
- Data tables:
booktabs style — use \toprule, \midrule, \bottomrule
Text Paragraphs
- Write all paragraphs and explanations in English
- If handwriting contains non-English annotations, translate them to English naturally
- Preserve the paragraph structure as written
- Problem numbers: use
\section*{Problem 1} or \subsection*{(a)}
Cover Page (Optional)
Only add a cover page when the user explicitly requests one. When included, prompt the user for:
- Title (assignment name / course name)
- Author name
- Institution
- Date (defaults to
\today)
Workflow
Step 1 — Receive Input
- Obtain the image or PDF from the conversation
- If multiple images are uploaded, confirm the page order with the user:
"Please confirm the page order: Page 1 → Page 2 → Page 3, or do you need to reorder?"
Step 2 — Pre-conversion Confirmation
Before starting the conversion, show the user a brief summary and ask for confirmation:
I can see the following:
- Content: {brief description, e.g. "QM derivation, ~3 equations, 1 matrix"}
- Sections: {detected section or problem numbers}
- Cover page: Yes / No
Shall I proceed with the conversion?
Wait for user confirmation before generating the .tex file.
Step 3 — Recognise Content
- Read every line of handwritten content carefully
- For ambiguous passages, add a LaTeX comment:
% [Unclear: transcribed as X, please verify]
- Do not skip any step, even intermediate calculations
Step 4 — Convert Block by Block
- Text → paragraphs
- Equations →
align* environment
- Matrices →
pmatrix / bmatrix
- Tables →
booktabs tables
Step 5 — Generate File
- Filename:
{course-code}-{content-description}.tex (e.g. PHYS101-QM-hw3.tex)
- Save to
/mnt/user-data/outputs/
- Also display the complete LaTeX source in the chat for easy copying
Step 6 — Quality Check
- Confirm every
\begin has a matching \end
- Confirm math environments are not nested (e.g. no
equation inside align)
- If anything is uncertain, append a "Please verify" list at the end of the reply
Important Notes
- Never simplify derivations — if the handwriting has five steps, output five steps, aligned at each equals sign
- Physics packages included by default — the
physics package is always loaded, providing \dv, \pdv, \ket, \bra, and other commands commonly used in physics and physical chemistry
- Compiler target — optimised for Overleaf pdfLaTeX by default; no settings changes needed, just hit Compile
- Language — all body text and explanations should be in English; translate any non-English handwritten annotations naturally
- Ambiguous handwriting — always add a comment rather than silently guessing:
% [Unclear: transcribed as X, please verify]
- Cover page — omitted by default unless the user explicitly says "add cover page"
1---2name: claude-code-skill-handwriting-to-latex3description: Handwriting to LaTeX Skill4---56# Handwriting to LaTeX Skill78Recognise handwritten notes or problem sets (images or PDFs) and convert them into a complete, Overleaf-ready `.tex` file.910## Supported Input Types1112| Format | Handling |13|---|---|14| JPG / PNG images | Direct visual recognition |15| Scanned PDFs | Page-by-page recognition |16| iPad handwriting PDFs | Same as above — pay attention to stylus stroke recognition |1718If the user uploads multiple pages, process them in order and merge into a single `.tex` file.1920## Output Structure2122Generate a complete, self-contained `.tex` file with the following structure:2324```latex25\documentclass[12pt, a4paper]{article}2627% ─── Packages ────────────────────────────────────28\usepackage{amsmath, amssymb, amsthm} % Mathematics29\usepackage{physics} % \dv, \pdv, \bra, \ket etc.30\usepackage{geometry} % Page margins31\usepackage{graphicx} % Images32\usepackage{booktabs} % Tables33\usepackage{array} % Enhanced matrices34\usepackage{hyperref} % Hyperlinks35\usepackage{setspace} % Line spacing36\usepackage{enumitem} % List formatting37\geometry{margin=2.5cm}38\setstretch{1.3}3940% ─── Cover page (optional — remove if not needed) ─41\title{Assignment / Notes Title}42\author{Your Name \\ Your Institution}43\date{\today}44% ──────────────────────────────────────────────────4546\begin{document}4748\maketitle % Remove this line if no cover page is needed4950% Body content starts here51...5253\end{document}54```5556## Recognition and Conversion Rules5758### Mathematical Expressions59- Inline expressions: `$...$`60- Multi-step derivations: `\begin{align*}...\end{align*}` (with `*` — **no line numbering**)61- Single standalone equations: `\[ ... \]` — do not use `\begin{equation}`62- **Never output numbered equation tags** — do not use `\tag{}`, `\label{}`, or `\ref{}` unless the user explicitly requests them63- Preserve every step of a derivation exactly as written — do not skip steps64- Common symbol reference:6566| Handwritten | LaTeX |67|---|---|68| Vector arrow | `\vec{v}` or `\mathbf{v}` |69| Partial derivative | `\frac{\partial f}{\partial x}` or `\pdv{f}{x}` |70| Integral | `\int_{a}^{b} f(x)\,dx` |71| Summation | `\sum_{i=1}^{n}` |72| Infinity | `\infty` |73| Quantum state | `\ket{\psi}`, `\bra{\phi}` |74| Expectation value | `\langle \hat{A} \rangle` |75| Reduced Planck constant | `\hbar` |76| Hamiltonian | `\hat{H}` |7778### Matrices and Tables79- Matrices: `\begin{pmatrix}...\end{pmatrix}` (round brackets) or `bmatrix` (square brackets)80- Augmented matrices: `\left[\begin{array}{cc|c}...\end{array}\right]`81- Data tables: `booktabs` style — use `\toprule`, `\midrule`, `\bottomrule`8283### Text Paragraphs84- Write all paragraphs and explanations in English85- If handwriting contains non-English annotations, translate them to English naturally86- Preserve the paragraph structure as written87- Problem numbers: use `\section*{Problem 1}` or `\subsection*{(a)}`8889### Cover Page (Optional)90Only add a cover page when the user **explicitly requests** one. When included, prompt the user for:91- Title (assignment name / course name)92- Author name93- Institution94- Date (defaults to `\today`)9596## Workflow9798### Step 1 — Receive Input99- Obtain the image or PDF from the conversation100- If multiple images are uploaded, confirm the page order with the user:101 > "Please confirm the page order: Page 1 → Page 2 → Page 3, or do you need to reorder?"102103### Step 2 — Pre-conversion Confirmation104Before starting the conversion, show the user a brief summary and ask for confirmation:105106```107I can see the following:108- Content: {brief description, e.g. "QM derivation, ~3 equations, 1 matrix"}109- Sections: {detected section or problem numbers}110- Cover page: Yes / No111112Shall I proceed with the conversion?113```114115Wait for user confirmation before generating the `.tex` file.116117### Step 3 — Recognise Content118- Read every line of handwritten content carefully119- For ambiguous passages, add a LaTeX comment: `% [Unclear: transcribed as X, please verify]`120- Do not skip any step, even intermediate calculations121122### Step 4 — Convert Block by Block123- Text → paragraphs124- Equations → `align*` environment125- Matrices → `pmatrix` / `bmatrix`126- Tables → `booktabs` tables127128### Step 5 — Generate File129- Filename: `{course-code}-{content-description}.tex` (e.g. `PHYS101-QM-hw3.tex`)130- Save to `/mnt/user-data/outputs/`131- Also display the complete LaTeX source in the chat for easy copying132133### Step 6 — Quality Check134- Confirm every `\begin` has a matching `\end`135- Confirm math environments are not nested (e.g. no `equation` inside `align`)136- If anything is uncertain, append a **"Please verify"** list at the end of the reply137138## Important Notes139140- **Never simplify derivations** — if the handwriting has five steps, output five steps, aligned at each equals sign141- **Physics packages included by default** — the `physics` package is always loaded, providing `\dv`, `\pdv`, `\ket`, `\bra`, and other commands commonly used in physics and physical chemistry142- **Compiler target** — optimised for Overleaf **pdfLaTeX** by default; no settings changes needed, just hit Compile143- **Language** — all body text and explanations should be in English; translate any non-English handwritten annotations naturally144- **Ambiguous handwriting** — always add a comment rather than silently guessing: `% [Unclear: transcribed as X, please verify]`145- **Cover page** — omitted by default unless the user explicitly says "add cover page"