返回顶部
m

minimax-pdf最小化PDF

HTML-first PDF production skill for reports, papers, and structured documents. Must be applied before generating PDF deliverables from HTML.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
2,342
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

minimax-pdf

A. 范围与操作约定

本技能负责编写 HTML 并将其转换为适合打印的 PDF

主要输出目标:

  • - 在 Linux 运行时实现稳定的分页和可预测的布局。
  • 可搜索/可选择的文本(不采用基于截图的回退方案)。
  • 专业、适合引用的长篇文档。

B. 硬性约束(不得违反)

B1. 转换入口

对于 HTML 转 PDF,仅使用 htmltopdf。

禁止:

  • - 截图/打印技巧或手动浏览器打印
  • 直接调用底层本地脚本进行转换

原因:图像拼接路径会降低文本质量并导致分页不连续。

B2. 渲染安全规则

  • - 不要手动注入 Paged.js。运行时管道会处理加载。
  • 不要依赖 CSS 计数器(counter-reset、counter-increment、counter())。
  • 不要使用运行时图表引擎(ECharts、Chart.js、D3、Plotly 等)。
  • 图表应预渲染为静态图像,并优先采用横向宽高比。
  • 除非明确要求,否则禁止使用装饰性表情符号/图标字形。

C. 意图解析

在执行前对任务进行分类:

意图典型用户请求处理流程
构建写一份报告并导出 PDFbuild-pdf
转换
把这篇内容翻译后做成 PDF | transform-pdf |
| 现有 PDF 操作 | 提取/合并/拆分 PDF | process-existing-pdf |
| 显式 LaTeX | 请用 LaTeX/.tex/Tectonic | latex-compile |

澄清策略:

  • - 如果请求明确,直接执行。
  • 如果存在歧义,使用简洁的检查清单询问一次:

- 文档类型/主题
- 是否需要封面
- 字数或页数限制
- 语言与格式偏好

重要澄清行为:

  • - 对于意图最多询问一轮澄清。
  • 之后,基于明确的假设执行,而不是反复询问。

D. 内容治理

D1. 语言策略

  • - 中文用户查询 → 中文内容
  • 英文用户查询 → 英文内容
  • 用户指定语言 → 严格遵循

D2. 大纲策略

  • - 用户提供大纲 → 保留层级/顺序,不擅自重构
  • 无大纲 → 根据文档类型选择结构,保持叙述流程一致

D3. 引用完整性

  • - 绝不编造参考文献。
  • 每条引用必须可验证(作者/标题/年份/来源)。
  • 重复使用的来源应保持相同的引用索引。

本技能推荐的引用格式:IEEE 数字格式

参考文献列表示例:
text
[1] R. Patel and L. Chen, A comparative study on model routing, Journal of Applied AI, vol. 8, no. 3, pp. 44-58, 2025.
[2] M. Rivera, Systems Design Handbook, 2nd ed. New York, NY, USA: Northbridge Press, 2024.
[3] T. Huang, Model evaluation checklist, Research Notes, https://example.org/eval (accessed Feb. 14, 2026).

E. 转换保真度检查清单

在转换现有材料(翻译/重写/重新格式化)时,保留源材料保真度:

E1. 链接

  • - 在 href 中保留原始目标 URL。
  • 不要用纯文本替换链接。
  • 确保转换使用 preserve_links=true。

E2. 图像

使用三步检查:
  1. 1. 统计提取的图像资源数量
  2. 统计 HTML 中的 标签数量
  3. 验证转换后的图像统计数据

E3. 结构

  • - 保留源章节顺序和锚点语义。
  • 保持图表/表格的位置和编号意图。
  • 如果源材料没有封面,不要添加合成的封面。

F. 实现蓝图

F1. 禁止的模式

模式不稳定的原因替代方案
用于编号的 CSS 内容计数器分页 DOM 变化可能破坏编号标记中的显式标签
渲染时的动态 JS 图表库
打印分页冲突 | 预渲染的静态图表 | | 表情符号/图标密集的排版 | Linux 回退不一致 | 纯文本标签 |

图表图像策略:

  • - 优先使用横向图表(width > height)以减少分页瑕疵。

F2. 溢出保护(必需基线)

css
/ 将可打印块保持在页面宽度内 /
pre, table, figure, img, svg, .diagram, blockquote, .eq-block {
max-inline-size: 100%;
box-sizing: border-box;
}

pre {
overflow-x: auto;
white-space: pre-wrap;
overflow-wrap: anywhere;
}

figure img, figure svg {
max-inline-size: 82%;
max-block-size: 42vh;
height: auto;
}

table { overflow-x: auto; }
.katex-display { overflow-x: auto; }
code { overflow-wrap: anywhere; }
a { overflow-wrap: anywhere; }
tr { break-inside: avoid; }

body {
text-align: justify;
text-align-last: start;
}

F3. 页面模型设置

css
@page {
size: A4;
margin: 2.4cm 1.9cm;
@top-center { content: string(doc_title); }
@bottom-center { content: counter(page); }
}

@page :first {
@top-center { content: none; }
@bottom-center { content: none; }
}

@page titlepage {
@top-center { content: none; }
@bottom-center { content: none; }
}

@page contents {
@top-center { content: none; }
@bottom-center { content: none; }
}

body { string-set: doc_title ; }
h1 { string-set: doc_title content(); }
.cover-page { page: titlepage; }
.toc-sheet { page: contents; }

分页说明:

  • - 仅对紧凑单元(单个图形、单行、标注框)应用 break-inside: avoid。
  • 切勿将其应用于大型包装器(章节/节容器)。
  • 对多页表格标题使用 thead { display: table-header-group; }。

F4. 视觉方向

默认目标是打印学术风格,而非仪表盘美学。

避免:

  • - 厚重的卡片外壳
  • KPI 指标墙
  • 深色装饰性标题栏
  • 过大的圆角/阴影装饰

偏好:

  • - 简洁标题 + 细分隔线
  • 数据密集的表格
  • 克制的灰度调色板
  • 简单、高对比度的排版

字号建议:

  • - 正文:11pt
  • 副标题:14pt
  • 主标题:18-20pt
  • 行高:1.6-1.7

F. 封面页规则

全出血基线:
css
*,
*::before,
*::after { box-sizing: border-box; }

html, body {
margin: 0;
padding: 0;
}

@page :first {
margin: 0;
}

.cover-page {
inline-size: 210mm;
block-size: 297mm;
position: relative;
display: grid;
place-items: center;
overflow: hidden;
break-after: page;
}

封面变体:

  • - 极简:白色背景,居中标题/元信息,无装饰
  • 设计版:低饱和度几何/渐变,保持中心区域清晰以放置标题

如果使用图像背景,不要使用 CSS background-image。使用绝对定位的

html



...

css
.cover-photo {
position: absolute;
inset: 0;
inline-size: 100%;
block-size: 100%;
object-fit: cover;
object-position: center;
z-index: 0;
}

.cover-layer {
position: absolute;
inset-block-start: 50%;
inset-inline-start: 50%;
transform: translate(-50%, -50%);
z-index: 1;
}

F5. 编号、参考文献、目录

在标记中使用显式标签,而不是 CSS 计数器。

html


系统概览
架构概览

...
各场景延迟

$$f(x)=x^2+1$$

css
figcaption::before {
content:

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 minimax-pdf-1776196601 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 minimax-pdf-1776196601 技能

通过命令行安装

skillhub install minimax-pdf-1776196601

下载

⬇ 下载 minimax-pdf v1.0.0(免费)

文件大小: 5.7 KB | 发布时间: 2026-4-15 10:15

v1.0.0 最新 2026-4-15 10:15
minimax-pdf 1.0.0

- Initial release of the HTML-first PDF production skill for reports, papers, and structured documents.
- Enforces stable layout, professional pagination, and print-quality output on Linux.
- Strictly governs PDF rendering paths, content integrity, language, and outline handling.
- Implements robust rules for charts, citations (IEEE style), images, TOC, and conversion fidelity.
- Provides detailed CSS and markup blueprints for covers, page model, typography, and overflow management.
- Includes a contract for intent parsing and task clarification to ensure precise pipeline handling.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部