Command Palette

Search for a command to run...

Назад к скиллам
скилл № 90961

pdf2md

Convert a PDF (typically a thesis or paper received with no LaTeX source, where LaTeX export and Marker both failed) into clean, chapter-split markdown laid…

БесплатноЗапускает вложенные скрипты
LARi-UQACот LARi-UQAC★ 16 звёзд на GitHub

Установить pdf2md в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

pdf2md - PDF to UQAC-shaped markdown, maximum accuracy

Converts a PDF with no LaTeX source into markdown good enough for thesis-auditor's content checks (hypothesis flow, references, equations/figures, LLM-style detection, bilingual consistency) -- never the mechanical uqac.cls checks, since mineru has no LaTeX output format at all (--format only accepts markdown/middle_json/zip, confirmed in its source).

Everything this skill does was measured hands-on against mineru-kit 4.0.11 on Windows, not guessed (R14). Where mineru's behavior changes in a later version, re-verify before trusting the script's own assumptions -- pdf2md version is the first thing to check if something that used to work stops working.

Why this is more than "run mineru-kit parse"

Three real defects, found by actually running the tool, not reading its docs:

  1. mineru-kit's own vlm-server wrapper is broken on Windows. It builds its argv as a Python list and launches via os.execv, which does not quote its own injected default --grammar "root ::= .*" (contains a space) across the POSIX-argv-to-Windows-command-line boundary. llama-server receives it split into separate tokens and dies with error: invalid argument: ::= -- even with zero flags supplied, so it is not a usage mistake. pdf2md_server.py sidesteps this entirely by launching llama-server.exe directly via subprocess.Popen with a proper argument LIST (Python quotes this correctly on Windows on its own); never reconstruct this via a manually pre-quoted PowerShell string or a .ps1 file, which reintroduces the exact same bug class (PowerShell 5.1's Start-Process -ArgumentList <array> has an identical quoting gap).

  2. ~/.mineru/config.yaml's vlm: key must nest under model:. A top-level vlm: key is silently accepted and ignored by pydantic -- no error, ever. This is why a hand-written image_min_tokens: 1024 entry under a top-level vlm: (not even a real recognized key anywhere in mineru's source, separately confirmed) never did anything, and why a later server_url edit under the same wrong nesting also silently had no effect. pdf2md_config.py diagnoses and fixes this.

  3. llm_aided.max_concurrency defaults to 16. mineru's optional title_leveling/cross_page_table_cell_merge LLM cleanup step fires up to 16 concurrent calls to a local Ollama model for cleanup JSON. If that model is not fully GPU-resident (ollama ps's CPU/GPU split tells you), 16-way contention pushes every call past the OpenAI SDK's hardcoded 600s x 3-retry ceiling (mineru/backend/postprocess/llm_client.py's _MAX_LLM_RETRIES = 3, no override exposed). mineru degrades gracefully on this failure rather than crashing -- it just leaves the page's running header as a spurious markdown heading sitting mid-paragraph, sometimes with a page number fused into it. The sentence is NOT lost, just split. Stage 5's pdf2md_postprocess.py is the dedicated fix for this, on top of pdf2md_config.py lowering the concurrency so it happens less.

The pipeline

Run every stage with the interpreter of .venv-pdf2md in the main clone (.venv-pdf2md\Scripts\python.exe, built by setup.ps1 -InstallPython from this skill's requirements.txt), never with .venv-skills. The bootstrap installs mineru into the interpreter that runs it (sys.executable -m pip), and mineru's gradio caps pillow below 13, the version .venv-skills pins to clear pillow 12's advisories (owner decision D9, 2026-10-22). mineru-kit is then on that environment's Scripts folder, not on PATH.

Run stages 1 to 4 with pdf2md.py run <pdf> -o <dir> [--tier advanced] [--yes] (a dry run without --yes: it reports the bootstrap and what it would launch, and starts nothing), or each stage separately for more control. A bootstrap that is not ok after its apply step stops run before the server starts. The stage 1 to 6 settings (port, timeouts, the pinned mineru and mineru-llama-cpp versions) are in pdf2md-pipeline.json, each with its provenance, and every pip call runs as sys.executable -m pip. Every stage emits a JSON report on request (--json) and follows the exit-code convention: 0 done, 2 refusal by design (e.g. dry-run found issues but --yes was not passed), 1 failure.

Stage Script What it does
1. Bootstrap pdf2md_bootstrap.py Checks mineru/mineru-llama-cpp installed (the pip DISTRIBUTION is mineru, confirmed via pip show mineru, 2026-10-10 -- mineru-kit is only the CLI entry point it installs, never a separate pip package; pip show mineru-kit reports "Package(s) not found"), the VLM model downloaded (mineru-kit models show), and fixes config.yaml's two defects above. Dry-run by default, --yes to apply. Installs the PINNED versions of pdf2md-pipeline.json only. After the apply, ok is read back from the real state (packages present, mod
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

  1. 01Read
  2. 02Write
  3. 03Edit
  4. 04Bash
  5. 05PowerShell

Вложенные файлы

  • scripts/pdf2md-fidelity.json
  • scripts/pdf2md-pipeline.json
  • scripts/pdf2md-postprocess.json
  • scripts/pdf2md-repair.json
  • scripts/pdf2md-validate.json
  • scripts/pdf2md-vlmcheck.json
  • scripts/pdf2md-vlmfix.json
  • scripts/pdf2md.py
  • scripts/pdf2md_bootstrap.py
  • scripts/pdf2md_config.py
  • scripts/pdf2md_convert.py
  • scripts/pdf2md_fidelity.py
  • scripts/pdf2md_models.py
  • scripts/pdf2md_postprocess.py
  • scripts/pdf2md_refs.py
  • scripts/pdf2md_repair.py
  • scripts/pdf2md_server.py
  • scripts/pdf2md_settings.py
  • scripts/pdf2md_validate.py
  • scripts/pdf2md_version.py
  • scripts/pdf2md_vlmcheck.py
  • scripts/pdf2md_vlmfix.py
  • scripts/requirements.txt

FAQ

Что делает скилл pdf2md?

Convert a PDF (typically a thesis or paper received with no LaTeX source, where LaTeX export and Marker both failed) into clean, chapter-split markdown laid out as a project's own src/ directory (-o points AT that src/ itself, never a parent of it): src/main.md linking everything, src/content/ holding frontmatter.md, Introduction.md, chapitreN.md, Conclusion.md, and src/assets/ holding bibliography.md and ref.md (acronyms and, if ever extracted, figures under assets/figures/ are reserved slots, not implemented). Accurate enough to feed thesis-auditor's content-level checks, though never auto-discovered by thesis-auditor's own directory resolution, which needs a real src/main.tex and reads LaTeX \input{}/\include{} macros only. Drives mineru end to end via its installed mineru-kit CLI: installs/downloads what's missing, starts the VLM server with a real accuracy fix (--image-min-tokens) that mineru's own CLI wrapper cannot apply on Windows, runs the conversion at maximum accuracy, then cleans up the running-header splice defect mineru's own title_leveling step leaves behind when it fails under CPU contention. An article or a talk source is kept as ONE document instead (postprocess --layout single: src/main.md plus assets/bibliography.md). Trigger on: convert this PDF to markdown, pdf2md, mineru conversion, thesis has no LaTeX source, PDF to UQAC chapters, max accuracy PDF conversion, /pdf2md.

Как установить скилл pdf2md?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл pdf2md запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить pdf2md с