| name | kirklin-latex |
| description | Create polished, compile-tested LaTeX documents from curated kirklin templates and build them to PDF with per-page PNG previews. Use when the user wants to write, typeset, or compile a LaTeX document — especially an academic or research paper in NeurIPS/arXiv style (the neurips-paper template) — or says "make a LaTeX paper", "write a conference paper", "typeset this as a paper", "compile this .tex", or "turn this into a PDF paper". This is a template framework: pick a template under templates/, copy and customize it, then build with scripts/compile.sh (auto engine detection, latexmk, previews). New document types are added as templates. |
kirklin-latex
Curated LaTeX templates plus a one-command build. Each template is a complete,
compile-tested document you copy and fill in; scripts/compile.sh turns it into a
PDF with page previews. Paths below are relative to this skill's directory.
When to use
- Writing a research / academic paper (NeurIPS / arXiv style) →
neurips-paper.
- Writing an everyday Chinese document — 通知 / 报告 / 总结 / 请示 / 函 / 制度 —
in the layout Chinese readers expect (黑体标题、「一、(一)1.」层级、首行缩进、
落款) →
cn-doc. Default for Chinese documents.
- Writing a formal Party/government official document — 公文 / 红头文件 per
GB/T 9704—2012 (红色机关标志、发文字号、红线、版记、页码一字线) →
cn-gongwen.
- Writing a one-page professional resume — 中文简历 (single-file layout macros,
works for English too) →
resume.
- Writing a formal Chinese letter — 辞职信 / 求职自荐信 / 感谢信 / 推荐信
(标题/称谓顶格/此致敬礼/右下落款 五段式) →
cn-letter.
- Writing everyday one-page personal paperwork — 借条 / 收条 / 在职证明 /
收入证明 / 授权委托书 (要件齐全、填写线+签署区+公章钩子) →
cn-everyday.
- Typesetting the official published text of Chinese statutes — 法律 / 法规 /
规章 / 司法解释的正式发布文本 per GB/T 47229.1—2026 (编/章/节/条 statutory
hierarchy, Chinese-numeral auto-numbering) →
cn-fagui. Niche: for
legislative/publishing scenarios only, NOT everyday legal writing
(contracts, briefs — those are ordinary documents).
- Writing an A-share IPO prospectus — 招股说明书 / 招股书 / IPO 申报文件 per
证监会信息披露准则第 57 号 (封面/声明及承诺/致投资者声明/发行概况/十二节正文/签字页/附件系列(承诺全文/权利清单等)
full skeleton, 结构与措辞已对照准则原文及真实科创板申报稿逐项校验; 投行
申报版式: 黑体节标题、全线框财务表、1-1-N 卷册页码, TikZ 股权结构图/时间轴/柱状图/流程图/产业链图;
治理结构按新《公司法》) →
cn-ipo. Also the base for similar disclosure
documents (债券募集说明书、重组报告书 adapt from it).
- Writing a law-firm legal opinion — 法律意见书 / 补充法律意见书 / 律师函
(律所证券法律文书 per 编报规则第 12 号; 版式综合八家头部律所公开文书实测:
文号封面、双行页眉、三列释义表、「一、(一)1、」层级、签章页、问询回复
体例、信函式信头变体与律师函) →
cn-legal-opinion.
- Writing litigation / arbitration documents — 民事起诉状 / 答辩状 (要素式
表格化勾选式, per 最高法法〔2025〕82 号示范文本), 劳动仲裁申请书 (北京官方
表格), 刑事辩护词 (刑辩通行体例) — covering 民事/劳动/刑事 practice →
cn-litigation.
- Compiling any
.tex to PDF and showing previews.
- More document types will arrive as templates — always check
references/templates.md
before assuming a type isn't covered.
Workflow
- Pick a template. Match the user's document type to a template using the
catalog in references/templates.md.
- Copy it out. Copy the whole template directory to the user's working area
(default
./outputs/). Templates are self-contained — styles, figures, and
section files travel with them.
- Customize. Edit the main
.tex (title, authors, sections). Each template's
own README.md documents its file map and exactly what to replace.
- Compile.
bash scripts/compile.sh <path>/paper.tex --preview
Auto-detects the engine, runs latexmk (multi-pass, bibliography,
cross-references), writes the PDF, and renders one PNG per page.
- Deliver. Read the PNG previews to confirm the result, show them to the user,
and hand over the PDF.
Templates
| Template | Produces | Build file |
|---|
neurips-paper | Single-column NeurIPS/arXiv-style research paper (sample: Attention Is All You Need) | templates/neurips-paper/paper.tex |
cn-doc | Everyday Chinese document base — 中式公文排版 (通知/报告/总结/请示/函; sample: a complete training notice) | templates/cn-doc/main.tex |
cn-gongwen | GB/T 9704—2012 党政机关公文 — 红头、版头/主体/版记全要素, spec-verified; variants for 联合行文/信函/命令/纪要 (see its README) | templates/cn-gongwen/main.tex |
resume | One-page Chinese professional resume — classic Chinese professional layout (三列条目行/编号要点/黑体强调/证件照位), 宋黑搭配 all-black, 年.月 dates digit-aligned, single file (sample: Elon Musk's public career) | templates/resume/main.tex |
cn-fagui | GB/T 47229.1—2026 法律法规电子文件 — 法规/司法解释正式文本 (标题/题注/目录/编·章·节·条 自动中文编号; sample: 民法典真实条文节选) | templates/cn-fagui/main.tex |
cn-ipo | A股IPO招股说明书 per 证监会准则第57号 — 封面/声明/概况/十二节/签字页全要素, 对照准则原文与真实申报稿校验, 投行申报版式, 财务数据内部勾稽 (sample: 虚构AI大模型公司科创板申报稿, 67页) | templates/cn-ipo/main.tex |
cn-legal-opinion | 律所法律意见书 per 编报规则第12号 — 版式综合八家头部律所公开文书实测 (文号封面/双行页眉/释义表/签章页/卷册页码), 另含信函式补充法律意见书(问询回复体例)与律师函 | templates/cn-legal-opinion/main.tex |
cn-litigation | 诉讼与仲裁文书(民事/劳动/刑事)— 民事起诉状与答辩状 per 最高法法〔2025〕82号要素式示范文本(表格化勾选式)、劳动仲裁申请书(北京官方表格)、刑事辩护词(刑辩通行体例) | templates/cn-litigation/complaint.tex |
cn-letter | 中文书信 — 标题/称谓/此致敬礼/落款五段式骨架; 样张为辞职信(含劳动合同法第37条法定要素)与求职自荐信, 感谢信/推荐信换正文即可 | templates/cn-letter/resignation.tex |
cn-everyday | 日常一页纸文书 — 借条/收条/在职证明/收入证明/授权委托书, 要件齐全(大写金额、用途限定句、核实电话、无转委托权); 借条收条与法律模板族同一案件世界 | templates/cn-everyday/iou.tex |
Full details, variants, and "when to use each" → references/templates.md.
Compiling
bash scripts/compile.sh FILE.tex [--engine pdflatex|xelatex|lualatex] \
[--preview] [--preview-dir DIR] [--dpi N] [--clean]
Engine defaults to auto (xelatex when the source loads fontspec/xeCJK/
polyglossia or a ctex class/package, otherwise pdflatex). Run
scripts/compile.sh --help for the full list. Requires TeX Live (latexmk) and poppler-utils (pdftoppm) for previews.
Adding a template
This skill is a framework — new document types are added as template directories,
not by editing a monolith. The contract (required layout, quality rules, how to
register) is in references/adding-templates.md.
Conventions
- Write generated documents into
./outputs/ for user visibility; never edit a
template in place — copy it first.
- Always render and view PNG previews after compiling, then show the user.
- Escape LaTeX specials in user-supplied text:
% $ & # _ become
\% \$ \& \# \_; use math mode for < and > (e.g. $<$5\%).