{"id":"43b68c98-3b57-44aa-8801-be0f70d785fd","shortId":"Bgc3Bw","kind":"skill","title":"render-pdf-doc","tagline":"Render Korean academic Markdown documents to publication-quality PDF via pandoc + xelatex. Targets non-bibliography artifacts: research proposals, IRB cover letters, briefing handouts, anchor docs (Q&A grids), and reference tables. Auto-infers pipe-table column widths from conten","description":"# Render-PDF-Doc Skill\n\nMarkdown + frontmatter → publication-quality Korean academic PDF.\n\n## Why This Skill Exists\n\nIn real circulation cycles for Korean academic PDFs, two recurring failure patterns appear:\n1. v1 drafts: change-history, version numbers, and PI attribution leak into the attached PDF, confusing the first recipient.\n2. v2 drafts: pandoc pipe-table dash ratios are misjudged, narrowing the first column and forcing label wrapping that hurts readability.\n\nManual fixes work but the same pattern recurs across proposals, briefings, IRB covers, exemption applications. This skill focuses on **layout** (CJK fonts + table column widths). Bibliography and CSL are handled by `/manage-refs`.\n\n## Boundary (다른 스킬과 분리)\n\n| 작업 | 스킬 |\n|---|---|\n| Manuscript + bibliography → DOCX/PDF | `/manage-refs scripts/render_pandoc.sh` (CSL + .bib) |\n| 기관 .docx 양식 채움 | `/fill-protocol` |\n| ICMJE COI 폼 | `/fill-icmje-coi` |\n| Figure / PPTX | `/make-figures`, `/present-paper` |\n| **이 스킬**: non-bib 학술 마크다운 → PDF (proposal, briefing, anchor doc, IRB cover) | `/render-pdf-doc` |\n\n## Core Principles\n\n1. **Pipe table column widths must be inferred from content.** 균등 분할 금지. 첫 열(라벨)은 최장 라벨에 맞추고, 데이터 열은 남은 폭을 content-proportional 분배.\n2. **CJK font는 명시적으로 설정** — `mainfont` + `CJKmainfont`. Default fallback은 OS-detect.\n3. **회람용 PDF에서는 변경이력·버전번호·PI attribution 제거** (또는 supplementary로 분리). frontmatter `redact_internal: true` 옵션.\n4. **Quarto 의존성 없음** — raw pandoc + xelatex. Quarto의 `tbl-colwidths`는 PDF에서 regression 보고됨 (issue 6089/9200).\n\n## Dependencies\n\n```bash\n# Required\nbrew install pandoc                                                   # macOS\nbrew install --cask mactex-no-gui          # xelatex + xeCJK (~5 GB)\n\n# Linux\nsudo apt-get install pandoc texlive-xetex texlive-lang-cjk fonts-noto-cjk\n```\n\nDetection:\n```bash\nbash scripts/check_deps.sh\n```\n\n## Workflow\n\n### Step 1 — Author markdown with frontmatter\n\n```yaml\n---\ntitle: \"Paper 2 Calibration Anchor — Q&A Grid\"\nauthor: \"<Author Group>\"\ndate: \"2026-05-01\"\nmainfont: \"Apple SD Gothic Neo\"        # macOS default\nCJKmainfont: \"Apple SD Gothic Neo\"\ngeometry: \"margin=0.85in\"\nfontsize: 11pt\nlinestretch: 1.25\ncolorlinks: true\n---\n```\n\nFor Linux/CI, use `Noto Sans CJK KR` instead. The render script auto-detects.\n\n### Step 2 — Infer column widths\n\n```bash\npython scripts/infer_colwidths.py input.md > input.colwidths.md\n```\n\nThe script:\n1. Finds every pipe table block.\n2. For each column, computes display width = `max(len(header), max(len(cell)))` (CJK = 2 cells, ASCII = 1).\n3. Generates dash-row separator with proportional dash counts.\n4. Writes a new file with separator rows replaced.\n\nOverride per-table via attribute: `{tbl-colwidths=\"[20,40,40]\"}` after caption — passes through unchanged.\n\n### Step 3 — Render\n\n```bash\nbash scripts/render_pdf.sh -i input.colwidths.md -o output.pdf\n```\n\nOr one-shot:\n```bash\nbash scripts/render_pdf.sh -i input.md -o output.pdf --infer-colwidths\n```\n\n### Step 4 — Visual verify\n\nOpen the PDF. Check:\n- 첫 열 라벨이 wrap 안 되고 단일 행 유지\n- 데이터 열 충분한 폭\n- Korean glyph 깨짐 없음 (Times New Roman fallback 발생 시 CJKmainfont 미적용)\n- 변경이력·내부 버전 노출 없음\n\n## Templates\n\n`templates/` 에 starter markdown:\n- `anchor-doc.md` — Q&A grid (Paper 2 사례)\n- `proposal-cover.md` — 연구계획서 cover page\n- `briefing-handout.md` — 미팅 brief (1-page)\n- `reference-table.md` — 비교표 형식\n\n각 template은 `<!-- TODO: -->` 마커로 슬롯 표시.\n\n## Anti-Patterns\n\n| Anti-pattern | Consequence |\n|---|---|\n| 균등 dash 분할 (`\\|---\\|---\\|---\\|`) | 첫 열에 short label만 있어도 같은 폭 → 데이터 열 협소 |\n| `CJKmainfont` 미설정 | Hangul이 Times New Roman fallback (Latin glyph 깨짐 또는 빈칸) |\n| 회람 PDF에 v3.2.2 / 변경이력 / PI attribution 노출 | 첫 수신자 혼란, 내부 정보 유출 |\n| Quarto `tbl-colwidths` for PDF | Quarto 1.4+에서 PDF regression — HTML만 신뢰 |\n\n## Files\n\n- `scripts/render_pdf.sh` — pandoc + xelatex wrapper, OS font detection\n- `scripts/infer_colwidths.py` — pipe table separator dash-ratio 자동 생성\n- `scripts/check_deps.sh` — pandoc / xelatex / CJK font 존재 확인\n- `templates/` — 4개 starter\n- `references/pandoc_korean_cheatsheet.md` — frontmatter 패턴 모음\n- `references/known_pitfalls.md` — em-dash 줄바꿈, smart quote 등\n\n## Anti-Hallucination\n\n- Numerical content in tables: `~/.claude/rules/numerical-safety.md` 적용. CSV에서 read.\n- Reference: 별도 `/manage-refs` 사용 — 이 스킬은 bib 처리 안 함.\n- 회람 PDF 작성 시 `~/.claude/rules/senior-mentor-circulation.md` (1차 source 보존) + `~/.claude/rules/ai-drafted-document-policy.md` 적용.","tags":["render","pdf","doc","medsci","skills","aperivue","agent-skills","biostatistics","claude-code","claude-skills","clinical-research","diagnostic-accuracy"],"capabilities":["skill","source-aperivue","skill-render-pdf-doc","topic-agent-skills","topic-biostatistics","topic-claude-code","topic-claude-skills","topic-clinical-research","topic-diagnostic-accuracy","topic-irb-protocol","topic-literature-review","topic-manuscript","topic-medical-ai","topic-medical-research","topic-meta-analysis"],"categories":["medsci-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/Aperivue/medsci-skills/render-pdf-doc","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add Aperivue/medsci-skills","source_repo":"https://github.com/Aperivue/medsci-skills","install_from":"skills.sh"}},"qualityScore":"0.499","qualityRationale":"deterministic score 0.50 from registry signals: · indexed on github topic:agent-skills · 98 github stars · SKILL.md body (4,403 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T18:56:31.311Z","embedding":null,"createdAt":"2026-05-13T12:57:46.230Z","updatedAt":"2026-05-18T18:56:31.311Z","lastSeenAt":"2026-05-18T18:56:31.311Z","tsv":"'-01':328 '-05':327 '/.claude/rules/ai-drafted-document-policy.md':654 '/.claude/rules/numerical-safety.md':632 '/.claude/rules/senior-mentor-circulation.md':650 '/fill-icmje-coi':173 '/fill-protocol':169 '/make-figures':176 '/manage-refs':151,161,638 '/present-paper':177 '/render-pdf-doc':192 '0.85':343 '1':78,195,310,377,400,518 '1.25':348 '1.4':580 '11pt':346 '1차':651 '2':98,223,318,366,383,397,509 '20':429 '2026':326 '3':235,401,438 '4':251,411,462 '40':430,431 '4개':611 '5':284 '6089/9200':267 'academ':7,59,71 'across':128 'anchor':30,188,320 'anchor-doc.md':504 'anti':529,532,626 'anti-hallucin':625 'anti-pattern':528,531 'appear':77 'appl':330,337 'applic':134 'apt':289 'apt-get':288 'artifact':22 'ascii':399 'attach':92 'attribut':88,241,425,565 'author':311,324 'auto':39,363 'auto-detect':362 'auto-inf':38 'bash':269,305,306,370,440,441,451,452 'bib':164,182,642 'bibliographi':21,145,159 'block':382 'boundari':152 'brew':271,275 'brief':28,130,187,517 'briefing-handout.md':515 'calibr':319 'caption':433 'cask':277 'cell':395,398 'chang':82 'change-histori':81 'check':468 'circul':67 'cjk':140,224,299,303,356,396,606 'cjkmainfont':229,336,492,548 'coi':171 'colorlink':349 'column':44,112,143,198,368,386 'colwidth':261,428,460,576 'comput':387 'confus':94 'consequ':534 'conten':47 'content':204,220,629 'content-proport':219 'core':193 'count':410 'cover':26,132,191,513 'csl':147,163 'csv에서':634 'cycl':68 'dash':105,404,409,536,599,620 'dash-ratio':598 'dash-row':403 'date':325 'default':230,335 'depend':268 'detect':234,304,364,593 'display':388 'doc':4,31,51,189 'document':9 'docx':166 'docx/pdf':160 'draft':80,100 'em':619 'em-dash':618 'everi':379 'exempt':133 'exist':64 'failur':75 'fallback':489,554 'fallback은':231 'figur':174 'file':415,586 'find':378 'first':96,111 'fix':121 'focus':137 'font':141,301,592,607 'fonts-noto-cjk':300 'fontsiz':345 'font는':225 'forc':114 'frontmatt':54,246,314,614 'gb':285 'generat':402 'geometri':341 'get':290 'glyph':483,556 'gothic':332,339 'grid':34,323,507 'gui':281 'hallucin':627 'handl':149 'handout':29 'hangul이':550 'header':392 'histori':83 'html만':584 'hurt':118 'icmj':170 'infer':40,202,367,459 'infer-colwidth':458 'input.colwidths.md':374,444 'input.md':373,455 'instal':272,276,291 'instead':358 'intern':248 'irb':25,131,190 'issu':266 'korean':6,58,70,482 'kr':357 'label':115 'label만':541 'lang':298 'latin':555 'layout':139 'leak':89 'len':391,394 'letter':27 'linestretch':347 'linux':286 'linux/ci':352 'maco':274,334 'mactex':279 'mactex-no-gui':278 'mainfont':228,329 'manual':120 'manuscript':158 'margin':342 'markdown':8,53,312,503 'max':390,393 'misjudg':108 'must':200 'narrow':109 'neo':333,340 'new':414,487,552 'non':20,181 'non-bib':180 'non-bibliographi':19 'noto':302,354 'number':85 'numer':628 'o':445,456 'one':449 'one-shot':448 'open':465 'os':233,591 'os-detect':232 'output.pdf':446,457 'overrid':420 'page':514,519 'pandoc':16,101,256,273,292,588,604 'paper':317,508 'pass':434 'pattern':76,126,530,533 'pdf':3,14,50,60,93,185,467,578,582,647 'pdfs':72 'pdf에':561 'pdf에서':263 'pdf에서는':237 'per':422 'per-tabl':421 'pi':87,240,564 'pipe':42,103,196,380,595 'pipe-t':41,102 'pptx':175 'principl':194 'proport':221,408 'propos':24,129,186 'proposal-cover.md':511 'public':12,56 'publication-qu':11,55 'python':371 'q':32,321,505 'qualiti':13,57 'quarto':252,573,579 'quarto의':258 'quot':623 'ratio':106,600 'raw':255 'read':635 'readabl':119 'real':66 'recipi':97 'recur':74,127 'redact':247 'refer':36,636 'reference-table.md':520 'references/known_pitfalls.md':617 'references/pandoc_korean_cheatsheet.md':613 'regress':264,583 'render':2,5,49,360,439 'render-pdf-doc':1,48 'replac':419 'requir':270 'research':23 'roman':488,553 'row':405,418 'san':355 'script':361,376 'scripts/check_deps.sh':307,603 'scripts/infer_colwidths.py':372,594 'scripts/render_pandoc.sh':162 'scripts/render_pdf.sh':442,453,587 'sd':331,338 'separ':406,417,597 'short':540 'shot':450 'skill':52,63,136 'skill-render-pdf-doc' 'smart':622 'sourc':652 'source-aperivue' 'starter':502,612 'step':309,365,437,461 'sudo':287 'supplementary로':244 'tabl':37,43,104,142,197,381,423,596,631 'target':18 'tbl':260,427,575 'tbl-colwidth':259,426,574 'templat':499,500,610 'template은':524 'texliv':294,297 'texlive-lang-cjk':296 'texlive-xetex':293 'time':486,551 'titl':316 'topic-agent-skills' 'topic-biostatistics' 'topic-claude-code' 'topic-claude-skills' 'topic-clinical-research' 'topic-diagnostic-accuracy' 'topic-irb-protocol' 'topic-literature-review' 'topic-manuscript' 'topic-medical-ai' 'topic-medical-research' 'topic-meta-analysis' 'true':249,350 'two':73 'unchang':436 'use':353 'v1':79 'v2':99 'v3.2.2':562 'verifi':464 'version':84 'via':15,424 'visual':463 'width':45,144,199,369,389 'work':122 'workflow':308 'wrap':116,472 'wrapper':590 'write':412 'xecjk':283 'xelatex':17,257,282,589,605 'xetex':295 'yaml':315 '각':523 '같은':543 '균등':205,535 '금지':207 '기관':165 '깨짐':484,557 '남은':217 '내부':495,570 '노출':497,566 '는':262 '다른':153 '단일':475 '데이터':215,478,545 '되고':474 '등':624 '또는':243,558 '라벨':210 '라벨에':213 '라벨이':471 '마커로':525 '마크다운':184 '맞추고':214 '명시적으로':226 '모음':616 '미설정':549 '미적용':493 '미팅':516 '발생':490 '버전':496 '버전번호':239 '변경이력':238,494,563 '별도':637 '보고됨':265 '보존':653 '분리':155,245 '분배':222 '분할':206,537 '비교표':521 '빈칸':559 '사례':510 '사용':639 '생성':602 '설정':227 '수신자':568 '스킬':157,179 '스킬과':154 '스킬은':641 '슬롯':526 '시':491,649 '신뢰':585 '안':473,644 '양식':167 '없음':254,485,498 '에':501 '에서':581 '연구계획서':512 '열':209,470,479,546 '열에':539 '열은':216 '옵션':250 '유지':477 '유출':572 '은':211 '의존성':253 '이':178,640 '있어도':542 '자동':601 '작성':648 '작업':156 '적용':633,655 '정보':571 '제거':242 '존재':608 '줄바꿈':621 '채움':168 '처리':643 '첫':208,469,538,567 '최장':212 '충분한':480 '패턴':615 '폭':481,544 '폭을':218 '폼':172 '표시':527 '학술':183 '함':645 '행':476 '협소':547 '형식':522 '혼란':569 '확인':609 '회람':560,646 '회람용':236","prices":[{"id":"f2c29654-cc8c-446f-b988-546b3242571b","listingId":"43b68c98-3b57-44aa-8801-be0f70d785fd","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"Aperivue","category":"medsci-skills","install_from":"skills.sh"},"createdAt":"2026-05-13T12:57:46.230Z"}],"sources":[{"listingId":"43b68c98-3b57-44aa-8801-be0f70d785fd","source":"github","sourceId":"Aperivue/medsci-skills/render-pdf-doc","sourceUrl":"https://github.com/Aperivue/medsci-skills/tree/main/skills/render-pdf-doc","isPrimary":false,"firstSeenAt":"2026-05-13T12:57:46.230Z","lastSeenAt":"2026-05-18T18:56:31.311Z"}],"details":{"listingId":"43b68c98-3b57-44aa-8801-be0f70d785fd","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"Aperivue","slug":"render-pdf-doc","github":{"repo":"Aperivue/medsci-skills","stars":98,"topics":["agent-skills","biostatistics","claude-code","claude-skills","clinical-research","diagnostic-accuracy","irb-protocol","literature-review","manuscript","medical-ai","medical-research","meta-analysis","physician-researcher","prisma","pubmed","radiology","reporting-guidelines","strobe","systematic-review","tripod-ai"],"license":"other","html_url":"https://github.com/Aperivue/medsci-skills","pushed_at":"2026-05-17T20:50:52Z","description":"Claude Code skills for medical research — literature search, reporting guidelines, statistical analysis, publication figures. Built by a physician-researcher, tested on real publications. MIT licensed.","skill_md_sha":"e4b2568c08864fbd2ee19b5fe9072e90b332612f","skill_md_path":"skills/render-pdf-doc/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/Aperivue/medsci-skills/tree/main/skills/render-pdf-doc"},"layout":"multi","source":"github","category":"medsci-skills","frontmatter":{"name":"render-pdf-doc","description":"Render Korean academic Markdown documents to publication-quality PDF via pandoc + xelatex. Targets non-bibliography artifacts: research proposals, IRB cover letters, briefing handouts, anchor docs (Q&A grids), and reference tables. Auto-infers pipe-table column widths from content (label column shrinks to fit, data columns share remaining width). CJK font fallback (Apple SD Gothic Neo on macOS, Noto Sans CJK KR on Linux). NOT for: manuscripts with bibliography (use /manage-refs render_pandoc.sh), Word form filling (/fill-protocol), figures (/make-figures)."},"skills_sh_url":"https://skills.sh/Aperivue/medsci-skills/render-pdf-doc"},"updatedAt":"2026-05-18T18:56:31.311Z"}}