glmocr-formula

Extract mathematical formulas from images and PDFs into LaTeX format.

458|40|Updated Mar 30, 2026
One-click install
npx skills add https://github.com/zai-org/GLM-skills --skill glmocr-formula
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: glmocr-formula
Source: https://github.com/zai-org/GLM-skills/tree/main/skills/glmocr-formula
Command: npx skills add https://github.com/zai-org/GLM-skills --skill glmocr-formula

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires requests, and includes scripts (resource) components.

What problem does it solve?

Extracting accurate mathematical notation from images and scanned PDFs is difficult and time-consuming when done manually; this Skill automates extraction and returns formulas in LaTeX so they can be reused in documents and research workflows.

Core Features & Use Cases

  • High-fidelity formula OCR: Recognizes complex mathematical constructs such as integrals, summations, matrices, fractions, and mixed inline/display equations and outputs LaTeX.
  • Flexible inputs: Accepts local files and remote URLs including multi-page PDFs and images.
  • Practical use cases: Convert formulas from research papers, textbooks, exam sheets, or screenshots into editable LaTeX for publication, editing, or further processing.

Quick Start

Use the glmocr-formula CLI to extract LaTeX from the file formula.png and save the OCR result to result.json.

Frequently Asked Questions about glmocr-formula

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I extract LaTeX from a formula image in a PDF?

Extracting LaTeX from a formula image requires OCR technology that recognizes complex constructs like integrals and matrices, returning editable LaTeX notation. This automates extraction from scanned PDFs and research papers, producing markdown-formatted text for immediate reuse in documents.

How does math OCR handle complex equations and matrices in scanned documents?

Math OCR handles complex equations by parsing document layouts to recognize structural constructs like summations, fractions, and matrices. It returns accurate LaTeX formatting, ensuring mathematical notation is recovered precisely from scanned textbooks, exam sheets, or screenshots.

Do I need an API key to convert math formulas to LaTeX automatically?

Yes, converting math formulas requires a ZHIPU_API_KEY to authenticate with the GLM-OCR layout parsing endpoint. This key authorizes the automated extraction of formulas from local files or remote URLs into markdown-formatted text containing LaTeX.

Can I process multi-page PDFs and remote image URLs for formula recognition?

Yes, formula recognition supports flexible inputs including local files and remote URLs. You can process multi-page PDFs and various image formats to extract mathematical notation, making it suitable for digitizing extensive research papers and textbooks.

What is the best way to digitize mathematical notation from exam sheets?

The best way to digitize mathematical notation from exam sheets is using a specialized math OCR tool. It scans the documents, recognizes complex formulas, and outputs them as markdown-formatted LaTeX, enabling easy editing, publication, and further processing.

Why does OCR fail to accurately capture complex integrals and summations?

OCR may fail to capture complex integrals and summations if the tool lacks specialized mathematical layout parsing. Using a dedicated math OCR endpoint ensures high-fidelity recognition of structural constructs, returning accurate LaTeX instead of flat plain text.