Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Usage

kakemono convert 1706.03762
kakemono convert paper.pdf --mode medium -o paper.html
kakemono convert paper.pdf --all --json -o out/
kakemono convert paper.pdf -o paper.docx
kakemono convert paper.pdf -o paper.md --image-dir images
kakemono convert paper.pdf -o paper.tex
kakemono convert book.pdf -o book.typ && typst compile book.typ
kakemono convert paper.pdf -o paper.epub
kakemono convert paper.pdf -o paper.json
kakemono convert paper.pdf --content paper.edited.json -m hard-95

The input is a PDF file, a Word document (.docx, .doc), an Excel workbook (.xlsx), an EPUB book (.epub), an arXiv ID (1706.03762, arXiv:1706.03762v7, hep-th/9901001) or an arXiv URL. Downloaded PDFs are cached in ~/.cache/kakemono (KAKEMONO_CACHE changes it).

OptionMeaning
-m, --mode <hard|hard-95|medium|friendly>Mode (default friendly); for Markdown, friendly or medium (how tables are written)
--allAll four modes: <name>.<mode>.html
-f, --format <html|docx|md|tex|typst|epub|json|chunks|pdf>HTML (default), a Word document, Markdown, LaTeX, Typst, an EPUB book, editable JSON, chunks for retrieval, or a PDF (Word and EPUB input: the document laid out in pages as Word lays it out; a workbook: printed as Excel prints it); chosen from --output when it ends in .docx, .md, .tex, .typ, .epub, .json, .jsonl or .pdf
--header-rows <N>Header rows of every table of an Excel workbook, 0 for none (default: found from the cells); ignored for other inputs
--pdf-style <excel|document>The PDF of an Excel workbook: printed as Excel prints it (default), or laid out as a document
-o, --output <path>HTML, .docx, .md, .tex, .typ, .epub, .json, .jsonl or .pdf file, or directory
--content <file.json>Write the output with the text of an edited JSON file (from --format json, for the same PDF); every format but hard mode for PDF input; Word page-layout outputs do not use edited text
--images <inline|files>Embed images (default for HTML and Word) or write them to a folder next to the file (default for Markdown and JSON, always for LaTeX and Typst; Word keeps them embedded too; never for EPUB)
--image-dir <dir>That folder, relative to the output file (default <name>_assets); with --all, one subfolder per mode
--scale <number>Image resolution in pixels per PDF point (default 3 ≈ 216 dpi), HTML, Word and EPUB
--page-image <svg|svg-only|png>Page background of hard/hard-95 (default svg; PNG for a page whose SVG would pass 1.5 MB, when smaller)
--png-compression <fast|balanced|high>How hard PNG pictures are compressed (default balanced); fast draws them several times faster for files about a quarter larger, high makes them a tenth smaller for ten times the time. The pixels are the same
--tables <auto|image>Rebuild tables when their grid is clear (default), or keep pictures
--layout <auto|article|book>Layout of the Typst output: a printed book or an article, chosen from the document by default (it is also a setting at the top of the .typ file)
--equations <mathml|image>Formulas as MathML (Word equations in .docx, LaTeX in .md and .tex, Typst math in .typ, MathML in .epub) where the structure is clear, also inside the text (default); or display formulas as pictures and inline ones as styled text
--fonts <embed|system>Embed the reading and math fonts (default, works offline) or use the reader’s fonts
--jsonAlso write <name>.json, the document structure with every field of the analysis (see below; to edit the text, use --format json)
--chunk-tokens <N>Largest chunk, in tokens (default 512), for --format chunks
--tokenizer <file.json|name>Count the tokens of chunks with a real tokenizer: a Hugging Face tokenizer.json, or cl100k_base / o200k_base (OpenAI); the default is an estimate
-j, --jobs <N>Threads (default one per core); the result is the same for every value

Other commands: kakemono fetch <id> -o paper.pdf only downloads; kakemono inspect paper.pdf prints the detected structure (headings, paragraphs, figures, formulas; <math> marks a formula rebuilt as MathML); kakemono formula picture.png reads pictures of LaTeX formulas and prints their MathML (experimental); kakemono render-svg picture.svg -o picture.png [--scale 2] draws an SVG as a PNG the way kakemono draws the SVG pictures it is given (replace_image), with the pictures it names relative to the SVG.