kakemono
Convert PDF papers and books, Word documents, EPUB books, or arXiv papers into readable, editable formats.
kakemono is a Rust document converter and library. It extracts reading order and structure from PDFs, Word files and EPUB books, including headings, tables, equations and figures. It can produce HTML, DOCX, Markdown, LaTeX, Typst (an article or a printed book), EPUB, editable JSON and JSONL chunks for retrieval. Word and EPUB input can also be laid out as PDF. PDF processing uses hayro; no Python, Poppler or MuPDF is needed for the CLI.
Install
Download a prebuilt binary for Linux, macOS or Windows from the latest release, or install with stable Rust:
To build from a checkout, run cargo build --release. For Python, use pip install kakemono and see the Python guide.
Quick start
Input can be a local PDF, .docx, .doc or .epub, an arXiv ID or an arXiv URL. The output extension selects the format; use --format to choose explicitly. arXiv downloads are cached in ~/.cache/kakemono (override with KAKEMONO_CACHE).
For HTML, choose a layout with --mode:
| Mode | Layout |
|---|---|
friendly |
Responsive single-column article (default) |
medium |
Preserves pages and columns while reflowing text |
hard-95 |
Page-like layout with visible HTML text |
hard |
Page images with a selectable text layer |
Markdown, LaTeX, Typst and JSON write image files alongside the output by default. The Typst output is laid out as a printed book (title page, chapters on right-hand pages, running heads, footnotes on the page of their call) when the document has chapters, as an article otherwise (--layout to choose); its settings, such as the page size and the fonts, are at the top of the .typ file. See the guide. See kakemono convert --help for image handling, table and equation options, tokenizers and other settings. kakemono inspect paper.pdf prints the detected structure; kakemono fetch <arxiv-id> -o paper.pdf downloads a paper.
Edit extracted content
Export editable JSON, change its text, then apply it to the same input:
# Edit paper.json and save it as paper.edited.json
This JSON is distinct from the full analysis written by --json. Edited text is supported in PDF-derived outputs except hard; for Word input it does not reach page-layout outputs (PDF, hard, hard-95 or medium). See the editable JSON guide for its schema and editing rules.
Libraries
Rust: add the crate with cargo add kakemono, then reuse an analysis across outputs:
use ;
let paper = from_bytes?;
let analysis = paper.analyze;
let out = paper.to_html;
write?;
The API reference and library guide cover other outputs. Python bindings and examples are documented in python/README.md.
Limitations
Scanned and encrypted PDFs are not supported. Complex tables and equations may be kept as images, and unusual layouts can affect reading order. Word 6/95, RTF and password-protected Word files are not supported, nor are EPUB books protected by DRM. See the full limitations, the Word input guide and EPUB input.
Development
Some real-paper tests require additional downloads; see the testing guide. CONTRIBUTING.md explains the development workflow, and ARCHITECTURE.md describes the pipeline. See also the detailed guide, benchmarks and changelog.
License
MIT © Cao Minh Tiến.