Communitygithub.com

Peytontalismanic424/paper-share-skills

MinerU를 사용하여 PDF(특히 학술 논문)를 깔끔한 마크다운으로 변환합니다. 읽기 순서, LaTeX 수식, 표, 그림을 보존하며 GPU에서 실행됩니다.

paper-share-skills란 무엇인가요?

이 스킬은 MinerU(`opendatalab/MinerU`)를 기반으로 PDF 파일을 구조가 보존된 깔끔한 마크다운으로 변환하는 전문 도구입니다. 학술 논문에 최적화되어 있으며, 다단 레이아웃, LaTeX 수식(`$...$`), 표(HTML 테이블), 그림까지 원본 그대로 유지합니다. GPU(CUDA)를 활용한 고속 파이프라인을 지원하며, 이미지, `.docx`, `.pptx`, `.xlsx` 파일도 직접 처리할 수 있습니다. Claude Code, Cursor, Codex 등 AI 에이전트에서 호출하여 사용하며, `convert.py` 래퍼 스크립트를 통해 MinerU의 Python API를 직접 호출하므로 CLI 서버의 502 오류를 우회합니다. 출력은 마크다운 파일과 추출된 이미지 폴더로 구성되며, 변환 완료 시 경로를 사용자에게 보고합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Peytontalismanic424/paper-share-skills/tree/HEAD/pdf-to-markdown

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

PDF → 마크다운 (MinerU)

MinerU (opendatalab/MinerU)를 사용하여 PDF를 깔끔하고 구조가 보존된 마크다운으로 변환합니다. 학술 논문에 가장 적합한 고충실도 오픈소스 엔진입니다. 파이프라인 백엔드는 GPU(CUDA)에서 실행됩니다. 출력에는 제목 계층, 인라인 LaTeX 수식($...$), 그림, 표(HTML)가 유지됩니다.

사용 시기

  • 사용자가 "이 PDF를 마크다운(또는 텍스트)으로 변환/추출/바꿔줘"라고 요청할 때.
  • 학술 논문에 가장 적합 — 다단 레이아웃, LaTeX 수식, 표, 참고문헌.
  • 이미지, .docx, .pptx, .xlsx도 처리 가능 (파일을 직접 전달).

실행 방법

MinerU는 전용 격리 환경에 있으며, 번들로 제공되는 convert.py 래퍼를 통해 구동됩니다. 이 래퍼는 MinerU의 Python API를 프로세스 내에서 직접 호출합니다.

여기서 mineru CLI를 사용하지 마세요 — 3.4.0 버전에서는 로컬 API 서버를 실행하여 Windows에서 502 Bad Gateway 오류를 반환합니다. 래퍼가 이를 우회합니다.

"$MINERU_PYTHON" \
  "<SKILLS_DIR>/pdf-to-markdown/convert.py" \
  "<input.pdf>" "<output_dir>" --lang en
  • 인수 1 — 입력 파일 (pdf/image/docx/pptx/xlsx).
  • 인수 2 — 출력 디렉터리.
  • --lang — OCR 언어 힌트: en(영어), ch(중국어/혼합, 기본값 ch이며 영어도 처리 가능). 스캔된(OCR) 페이지에만 영향을 줍니다.
  • 스크립트는 성공 시 DONE -> <마크다운 파일 경로>를 출력합니다.

출력 구조

<output_dir>/<name>/auto/<name>.md       # 마크다운 파일
<output_dir>/<name>/auto/images/          # 추출된 그림 (마크다운에서 참조)
<output_dir>/<name>/auto/<name>_*.json    # 레이아웃/콘텐츠 메타데이터 (무시 가능)

변환 후

  1. 출력된 DONE -> ...md 경로를 읽고 사용자에게 알립니다.
  2. 필요시 짧은 미리보기(제목 + 첫 번째 제목들)를 보여줍니다.
  3. 추출된 이미지가 저장된 위치를 안내합니다.
  4. 품질은 일반적으로 높습니다: 제목은 #, 인라인 수식은 $...$, 표는 <table> HTML(셀 내 LaTeX 포함). 스캔된 PDF가 깨져 나오면 --method ocr로 재실행하세요.

사전 확인/설정 (누락된 항목이 있을 때만)

  • MinerU가 설치된 인터프리터 (환경 변수 MINERU_PYTHON, 기본값 python).
  • CUDA 확인: $MINERU_PYTHON -c "import torch; print(torch.cuda.is_available())" → True.
  • 모델은 ~/.cache/huggingface/hub/에 사전 다운로드되어 있습니다 (최초 1회).

환경이 없으면 다시 생성하세요 (필요시 uv 먼저 설치):

uv venv --python 3.12 "<your-env>"
uv pip install --python "<your-env>/Scripts/python.exe" torch torchvision --index-url https://download.pytorch.org/whl/cu124
uv pip install --python "<your-env>/Scripts/python.exe" -U "mineru[core]"
"<your-env>/Scripts/mineru-models-download.exe" -s huggingface -m pipeline

그런 다음 MINERU_PYTHON을 <your-env>/Scripts/python.exe(Windows) 또는 <your-env>/bin/python(macOS/Linux)으로 설정하세요. macOS/Linux에서 모델 다운로드 바이너리는 mineru-models-download입니다 (.exe 접미사 없음).

문제 해결

  • cuda.is_available()이 False인 경우 → cu124 인덱스에서 torch 재설치 (설정 참조). 필요시 파이프라인이 CPU에서도 실행되지만 느립니다.
  • 모델 다운로드 실패/느린 경우 → mineru-models-download를 -s modelscope와 함께 재실행.
  • 스캔된 PDF가 깨지는 경우 → convert.py 호출에 --method ocr 추가.
  • vlm-engine / hybrid-engine 백엔드 → vLLM/SGLang(Linux)이 필요하며 Windows에서는 502 오류 발생. 래퍼에서 사용하는 기본 pipeline 백엔드를 계속 사용하세요.

경량 대체 (단순/Office 문서)

레이아웃 충실도가 중요하지 않은 비논문 파일의 경우 Microsoft의 MarkItDown이 더 빠르고 간단하지만, 학술용 2단 PDF와 표를 망가뜨리므로 논문에는 MinerU를 선호하세요:

"$MINERU_PYTHON" -m pip install markitdown
"$MINERU_PYTHON" -m markitdown "<input>" > out.md

Individual skills in this repo

This repo contains 7 individual skills — each has its own dedicated page.

Peytontalismanic424/paper-share-skills

Validate and upload narrated paper videos to Bilibili with biliup. Handles required landscape-first/portrait-second submissions, series uploads, CST scheduling, diagnostics, dry-run validation, and durable upload receipts. Trigger on: "upload to bilibili", "bilibili upload", "发布到B站", "上传到B站".

Peytontalismanic424/paper-share-skills

Download the TeX source (e-print tar.gz) of an arXiv paper from an arXiv URL or bare ID, and unpack it into paper_src/. Use FIRST whenever a pipeline input is an arXiv link and the TeX source is preferred over the PDF (paper-to-beamer, paper-to-bilibili, paper-venue-discovery). Invoke with an arXiv URL (abs/pdf/e-print, arxiv.org or export.arxiv.org) or a bare ID like 2509.07996v4.

Peytontalismanic424/paper-share-skills

Convert Beamer PDF slides into a fail-closed narrated MP4 with page-aligned narration, TTS audio, cover, and upload metadata. Trigger on narrated slides, slide video, or paper video requests.

Peytontalismanic424/paper-share-skills

Automated pipeline: paper (PDF or TeX source) → SUSTech Beamer slides (11-section 论文分享 structure) → compiled PDF. When TeX source is available, skip MinerU and extract content directly from LaTeX. Use when the user asks to create Beamer slides from an academic paper, or says "论文分享", "paper to slides", "make beamer from paper". Invoke with an absolute or relative path to a PDF, .tar.gz TeX archive, .tex file, or an arXiv URL/ID (source TeX is downloaded first via skill://paper-download-arxiv-paper-source).

Peytontalismanic424/paper-share-skills

Orchestrate a paper PDF through MinerU, SUSTech Beamer slides, complete Chinese narration, landscape and portrait video, metadata gates, and Bilibili upload. Supports single-paper and batch slides, video, or bilibili phases. Trigger on full paper-to-Bilibili requests, PDF-to-video publication, and batch paper publishing.

Peytontalismanic424/paper-share-skills

Generate a deterministic 16:10 video-cover poster from a paper directory. Extracts paper metadata and figures and atomically produces poster.tex, poster.pdf, and poster.png. Use for paper-video covers, not conference posters.

Peytontalismanic424/paper-share-skills

Fix for undefined \setsource/\setdomains/\setpresenter/\setvenue commands when compiling SUSTech Beamer slides from the standard template. Copy the extended beamerthemesustech.sty from the sustech-slides-template repository.

관련 스킬