Rebuild research-paper PDFs as readable, one-column PDFs for the Supernote A5 X2 Manta. The output uses the Manta screen size, preserves equations and figures, removes page furniture, and leaves a right margin for handwritten notes.
The conversion pipeline is fully local after MinerU downloads its models:
PDF -> MinerU -> Markdown and assets -> Pandoc/XeLaTeX -> PDF
- macOS with the Palatino font
- Python 3.11, 3.12, or 3.13
- Pandoc
- XeLaTeX
On macOS, Pandoc and XeLaTeX can be installed with Homebrew:
brew install pandoc
brew install --cask mactex-no-guipython3.13 -m venv .venv
. .venv/bin/activate
pip install -e .MinerU may download several gigabytes of models on the first conversion.
pdf2pdf article.pdf article-manta.pdfThe default output has 8 mm page margins and a 30 mm right notes margin. Both are adjustable:
pdf2pdf article.pdf article-manta.pdf \
--page-margin-mm 8 \
--notes-margin-mm 30The converter is also available as a Python function:
from pdf2pdf import convert_pdf
convert_pdf("article.pdf", "article-manta.pdf")Pass an object with an extract(input_pdf, output_dir) method to convert_pdf(..., extractor=...) to use another local or API-backed extractor.
python -B tests/test_reflow.pyThe test generates temporary synthetic PDFs and does not require bundled article files or OCR models.
OCR and formula recognition can make content mistakes. Very complex tables, multi-panel figures, and unusually long equations may require manual review.
This project was developed with assistance from OpenAI Codex. AI-generated changes were reviewed and tested before inclusion.