minimax-pdf
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseminimax-pdf
minimax-pdf
Three tasks. One skill.
三项任务,一个Skill。
Read design/design.md
before any CREATE or REFORMAT work.
design/design.md在进行任何CREATE或REFORMAT操作前,请阅读design/design.md
。
design/design.mdRoute table
路由表
| User intent | Route | Scripts used |
|---|---|---|
| Generate a new PDF from scratch | CREATE | |
| Fill / complete form fields in an existing PDF | FILL | |
| Reformat / re-style an existing document | REFORMAT | |
Rule: when in doubt between CREATE and REFORMAT, ask whether the user has an existing document to start from. If yes → REFORMAT. If no → CREATE.
| 用户意图 | 处理路径 | 使用的脚本 |
|---|---|---|
| 从头生成新PDF | CREATE | |
| 填写现有PDF中的表单字段 | FILL | |
| 重新格式化/重新设置现有文档样式 | REFORMAT | |
规则: 若无法区分CREATE和REFORMAT,请询问用户是否有可作为基础的现有文档。若是 → 选择REFORMAT;若否 → 选择CREATE。
Route A: CREATE
路径A:CREATE
Full pipeline — content → design tokens → cover → body → merged PDF.
bash
bash scripts/make.sh run \
--title "Q3 Strategy Review" --type proposal \
--author "Strategy Team" --date "October 2025" \
--accent "#2D5F8A" \
--content content.json --out report.pdfDoc types: · · · · · · · · · · · · · ·
reportproposalresumeportfolioacademicgeneralminimalstripediagonalframeeditorialmagazinedarkroomterminalposter| Type | Cover pattern | Visual identity |
|---|---|---|
| | Dark bg, dot grid, Playfair Display |
| | Left panel + right geometric, Syne |
| | Oversized first-word, DM Serif Display |
| | Near-black, radial glow, Fraunces |
| | Light bg, classical serif, EB Garamond |
| | Dark slate, Outfit |
| | White + single 8px accent bar, Cormorant Garamond |
| | 3 bold horizontal color bands, Barlow Condensed |
| | SVG angled cut, dark/light halves, Montserrat |
| | Inset border, corner ornaments, Cormorant |
| | Ghost letter, all-caps title, Bebas Neue |
| | Warm cream bg, centered stack, hero image, Playfair Display |
| | Navy bg, centered stack, grayscale image, Playfair Display |
| | Near-black, grid lines, monospace, neon green |
| | White bg, thick sidebar, oversized title, Barlow Condensed |
Cover extras (inject into tokens via , ):
--abstract--cover-image- — abstract text block on the cover (magazine/darkroom)
--abstract "text" - — hero image URL/path (magazine, darkroom, poster)
--cover-image "url"
Color overrides — always choose these based on document content:
- — override the accent color;
--accent "#HEX"is auto-derived by lightening toward whiteaccent_lt - — override the cover background color
--cover-bg "#HEX"
Accent color selection guidance:
You have creative authority over the accent color. Pick it from the document's semantic context — title, industry, purpose, audience — not from generic "safe" choices. The accent appears on section rules, callout bars, table headers, and the cover: it carries the document's visual identity.
| Context | Suggested accent range |
|---|---|
| Legal / compliance / finance | Deep navy |
| Healthcare / medical | Teal-green |
| Technology / engineering | Steel blue |
| Environmental / sustainability | Forest |
| Creative / arts / culture | Burgundy |
| Academic / research | Deep teal |
| Corporate / neutral | Slate |
| Luxury / premium | Warm black |
Rule: choose a color that a thoughtful designer would select for this specific document — not the type's default. Muted, desaturated tones work best; avoid vivid primaries. When in doubt, go darker and more neutral.
content.json block types:
| Block | Usage | Key fields |
|---|---|---|
| Section heading + accent rule | |
| Subsection heading | |
| Sub-subsection (bold) | |
| Justified paragraph; supports | |
| Unordered list item (• prefix) | |
| Ordered list item — counter auto-resets on non-numbered blocks | |
| Highlighted insight box with accent left bar | |
| Data table — accent header, alternating row tints | |
| Embedded image scaled to column width | |
| Image with auto-numbered "Figure N:" caption | |
| Monospace code block with accent left border | |
| Display math — LaTeX syntax via matplotlib mathtext | |
| Bar / line / pie chart rendered with matplotlib | |
| Process diagram with nodes + edges via matplotlib | |
| Numbered reference list with hanging indent | |
| Accent-colored full-width rule | — |
| Small muted label | |
| Force a new page | — |
| Vertical whitespace | |
chart / flowchart schemas:
json
{"type":"chart","chart_type":"bar","labels":["Q1","Q2","Q3","Q4"],
"datasets":[{"label":"Revenue","values":[120,145,132,178]}],"caption":"Q results"}
{"type":"flowchart",
"nodes":[{"id":"s","label":"Start","shape":"oval"},
{"id":"p","label":"Process","shape":"rect"},
{"id":"d","label":"Valid?","shape":"diamond"},
{"id":"e","label":"End","shape":"oval"}],
"edges":[{"from":"s","to":"p"},{"from":"p","to":"d"},
{"from":"d","to":"e","label":"Yes"},{"from":"d","to":"p","label":"No"}]}
{"type":"bibliography","items":[
{"id":"1","text":"Author (Year). Title. Publisher."}]}完整流程 — 内容 → 设计令牌 → 封面 → 正文 → 合并PDF。
bash
bash scripts/make.sh run \
--title "Q3 Strategy Review" --type proposal \
--author "Strategy Team" --date "October 2025" \
--accent "#2D5F8A" \
--content content.json --out report.pdf文档类型: · · · · · · · · · · · · · ·
reportproposalresumeportfolioacademicgeneralminimalstripediagonalframeeditorialmagazinedarkroomterminalposter| 类型 | 封面样式 | 视觉标识 |
|---|---|---|
| | 深色背景、点阵网格、Playfair Display字体 |
| | 左侧面板+右侧几何图形、Syne字体 |
| | 超大首字、DM Serif Display字体 |
| | 近黑色、径向渐变、Fraunces字体 |
| | 浅色背景、经典衬线体、EB Garamond字体 |
| | 深灰蓝、Outfit字体 |
| | 白色+单条8px强调栏、Cormorant Garamond字体 |
| | 3条粗色水平带、Barlow Condensed字体 |
| | SVG斜角切割、深浅分块、Montserrat字体 |
| | 内嵌边框、角落装饰、Cormorant字体 |
| | 虚影文字、全大写标题、Bebas Neue字体 |
| | 暖奶油色背景、居中堆叠、主图、Playfair Display字体 |
| | 藏青背景、居中堆叠、灰度图、Playfair Display字体 |
| | 近黑色、网格线等宽字体、霓虹绿 |
| | 白色背景、粗侧边栏、超大标题、Barlow Condensed字体 |
封面额外选项(通过、注入令牌):
--abstract--cover-image- — 封面添加摘要文本块(适用于magazine/darkroom类型)
--abstract "text" - — 主图URL/路径(适用于magazine、darkroom、poster类型)
--cover-image "url"
颜色覆盖选项 — 请始终根据文档内容选择:
- — 覆盖强调色;
--accent "#HEX"会自动通过向白色提亮生成accent_lt - — 覆盖封面背景色
--cover-bg "#HEX"
强调色选择指南:
你对强调色拥有创意决策权。请根据文档的语义语境(标题、行业、用途、受众)选择,而非通用的“安全”选项。强调色会出现在章节分隔线、提示栏、表格表头和封面上:它承载着文档的视觉标识。
| 语境 | 推荐强调色范围 |
|---|---|
| 法律/合规/金融 | 深藏青 |
| 医疗/健康 | 青绿 |
| 科技/工程 | 钢蓝 |
| 环境/可持续发展 | 森林绿 |
| 创意/艺术/文化 | 酒红 |
| 学术/研究 | 深青绿 |
| 企业/中性 | 灰蓝 |
| 奢侈品/高端 | 暖黑 |
规则: 选择一位有想法的设计师会为该特定文档挑选的颜色 — 而非类型默认色。柔和、低饱和度的色调效果最佳;避免鲜艳的原色。若有疑问,选择更深、更中性的颜色。
content.json块类型:
| 块类型 | 用途 | 关键字段 |
|---|---|---|
| 章节标题+强调分隔线 | |
| 子章节标题 | |
| 三级子标题(加粗) | |
| 两端对齐段落;支持 | |
| 无序列表项(前缀为•) | |
| 有序列表项 — 计数器会在非编号块处自动重置 | |
| 带左侧强调栏的高亮提示框 | |
| 数据表格 — 强调色表头、交替行底色 | |
| 嵌入图片,缩放至列宽 | |
| 带自动编号“图N:”标题的图片 | |
| 带左侧强调边框的等宽代码块 | |
| 显示数学公式 — 通过matplotlib mathtext支持LaTeX语法 | |
| 用matplotlib渲染的柱状图/折线图/饼图 | |
| 用matplotlib渲染的带节点+边的流程图 | |
| 带悬挂缩进的编号参考文献列表 | |
| 强调色全宽分隔线 | — |
| 小型柔和标签 | |
| 强制分页 | — |
| 垂直空白 | |
图表/流程图示例:
json
{"type":"chart","chart_type":"bar","labels":["Q1","Q2","Q3","Q4"],
"datasets":[{"label":"Revenue","values":[120,145,132,178]}],"caption":"Q results"}
{"type":"flowchart",
"nodes":[{"id":"s","label":"Start","shape":"oval"},
{"id":"p","label":"Process","shape":"rect"},
{"id":"d","label":"Valid?","shape":"diamond"},
{"id":"e","label":"End","shape":"oval"}],
"edges":[{"from":"s","to":"p"},{"from":"p","to":"d"},
{"from":"d","to":"e","label":"Yes"},{"from":"d","to":"p","label":"No"}]}
{"type":"bibliography","items":[
{"id":"1","text":"Author (Year). Title. Publisher."}]}Route B: FILL
路径B:FILL
Fill form fields in an existing PDF without altering layout or design.
bash
undefined在不改变布局或设计的情况下填写现有PDF的表单字段。
bash
undefinedStep 1: inspect
Step 1: 检查
python3 scripts/fill_inspect.py --input form.pdf
python3 scripts/fill_inspect.py --input form.pdf
Step 2: fill
Step 2: 填写
python3 scripts/fill_write.py --input form.pdf --out filled.pdf
--values '{"FirstName": "Jane", "Agree": "true", "Country": "US"}'
--values '{"FirstName": "Jane", "Agree": "true", "Country": "US"}'
| Field type | Value format |
|---|---|
| `text` | Any string |
| `checkbox` | `"true"` or `"false"` |
| `dropdown` | Must match a choice value from inspect output |
| `radio` | Must match a radio value (often starts with `/`) |
Always run `fill_inspect.py` first to get exact field names.
---python3 scripts/fill_write.py --input form.pdf --out filled.pdf
--values '{"FirstName": "Jane", "Agree": "true", "Country": "US"}'
--values '{"FirstName": "Jane", "Agree": "true", "Country": "US"}'
| 字段类型 | 值格式 |
|---|---|
| `text` | 任意字符串 |
| `checkbox` | `"true"`或`"false"` |
| `dropdown` | 必须与检查输出中的选项值匹配 |
| `radio` | 必须与单选按钮值匹配(通常以`/`开头) |
请始终先运行`fill_inspect.py`以获取准确的字段名称。
---Route C: REFORMAT
路径C:REFORMAT
Parse an existing document → content.json → CREATE pipeline.
bash
bash scripts/make.sh reformat \
--input source.md --title "My Report" --type report --out output.pdfSupported input formats:
.md.txt.pdf.json解析现有文档 → 生成content.json → 进入CREATE流程。
bash
bash scripts/make.sh reformat \
--input source.md --title "My Report" --type report --out output.pdf支持的输入格式:
.md.txt.pdf.jsonEnvironment
环境要求
bash
bash scripts/make.sh check # verify all deps
bash scripts/make.sh fix # auto-install missing deps
bash scripts/make.sh demo # build a sample PDF| Tool | Used by | Install |
|---|---|---|
| Python 3.9+ | all | system |
| | |
| fill, merge, reformat | |
| Node.js 18+ | | system |
| | |
bash
bash scripts/make.sh check # 验证所有依赖
bash scripts/make.sh fix # 自动安装缺失的依赖
bash scripts/make.sh demo # 生成示例PDF| 工具 | 使用者 | 安装方式 |
|---|---|---|
| Python 3.9+ | 所有 | 系统安装 |
| | |
| 填充、合并、重新格式化 | |
| Node.js 18+ | | 系统安装 |
| | |