Loading...
Loading...
Compare original and translation side by side
| Route | Trigger | Route File |
|---|---|---|
| HTML (default) | All PDF creation requests | |
| LaTeX | User explicitly requests LaTeX, .tex, or Tectonic | |
| Process | Work with existing PDFs (extract, merge, fill forms, etc.) | |
| 路径 | 触发条件 | 路径文件 |
|---|---|---|
| HTML(默认) | 所有PDF创建请求 | |
| LaTeX | 用户明确要求LaTeX、.tex或Tectonic | |
| Process(处理) | 处理现有PDF(提取内容、合并、填写表单等) | |
routes/html.mdroutes/latex.mdroutes/process.mdroutes/html.mdroutes/latex.mdroutes/process.md| User Says | Route |
|---|---|
| "Create a PDF", "Make a report", "Write a paper" | HTML |
| "Use LaTeX", "Compile .tex", "Use Tectonic" | LaTeX |
| "Extract text from PDF", "Merge these PDFs", "Fill this form" | Process |
| 用户需求 | 路径 |
|---|---|
| "创建PDF"、"生成报告"、"撰写论文" | HTML |
| "使用LaTeX"、"编译.tex文件"、"使用Tectonic" | LaTeX |
| "从PDF提取文本"、"合并这些PDF"、"填写此表单" | Process |
| Context | Style |
|---|---|
| Academic paper, thesis, formal coursework | Minimal (white, centered, no decoration) |
| Reports, proposals, professional documents | Designed (choose from style reference in html.md) |
| Uncertain | Default to Designed — plain text cover = mediocre |
| 场景 | 样式 |
|---|---|
| 学术论文、毕业论文、正式课程作业 | 极简风格(白色背景、居中、无装饰) |
| 报告、提案、专业文档 | 设计风格(从html.md的样式参考中选择) |
| 不确定 | 默认使用设计风格——纯文本封面效果一般 |
| Document Language | Format |
|---|---|
| Chinese | GB/T 7714 (use [J][M][D] identifiers) |
| English | APA |
| Mixed | Chinese refs → GB/T 7714, English refs → APA |
| 文档语言 | 格式 |
|---|---|
| 中文 | GB/T 7714(使用[J][M][D]标识符) |
| 英文 | APA |
| 混合语言 | 中文参考文献→GB/T 7714,英文参考文献→APA |
undefinedundefined
**Exit codes:**
- `0` = success
- `1` = usage error
- `2` = dependency missing (run `pdf.sh fix`)
- `3` = runtime error
**Dependencies by route:**
- **HTML route**: Node.js, Playwright, Chromium
- **Process route**: Python 3, pikepdf, pdfplumber
- **LaTeX route**: Tectonic
---
**退出码说明:**
- `0` = 成功
- `1` = 使用错误
- `2` = 缺少依赖(运行`pdf.sh fix`修复)
- `3` = 运行时错误
**各路径依赖:**
- **HTML路径**:Node.js、Playwright、Chromium
- **Process路径**:Python 3、pikepdf、pdfplumber
- **LaTeX路径**:Tectonic
---| Scenario | Search? | Notes |
|---|---|---|
| Statistics, data | Required | e.g., "2024 employment rate" |
| Policies, regulations | Required | e.g., "startup subsidies" |
| Research, papers | Required | e.g., "effectiveness of method X" |
| Time-sensitive content | Required | Information after knowledge cutoff |
| Uncertain facts | Required | If unsure, always search |
| Common knowledge | Not needed | e.g., "water boils at 100°C" |
| 场景 | 是否需要搜索 | 说明 |
|---|---|---|
| 统计数据、资料 | 是 | 例如:"2024年就业率" |
| 政策、法规 | 是 | 例如:"创业补贴" |
| 研究、论文 | 是 | 例如:"方法X的有效性" |
| 时效性内容 | 是 | 知识库截止日期之后的信息 |
| 不确定的事实 | 是 | 如有疑问,始终先搜索 |
| 常识 | 否 | 例如:"水在100°C沸腾" |
As shown in <a href="#fig-1-1">Figure 1-1</a>...
From <a href="#eq-2-1">Equation (2-1)</a>...
See <a href="#sec3">Section 3</a>...id如<a href="#fig-1-1">图1-1</a>所示...
根据<a href="#eq-2-1">公式(2-1)</a>...
详见<a href="#sec3">第3节</a>...id| User Request | Execution Standard |
|---|---|
| Specific word count (e.g., "3000 words") | Within ±20%, i.e., 2400-3600 words |
| Specific page count (e.g., "5 pages") | Exactly equal, last page may be partial |
| Word count range (e.g., "2000-3000 words") | Must fall within range |
| No explicit requirement | Infer reasonably by document type; prefer thorough over superficial |
| Minimum specified (e.g., "more than 5000 words") | No more than 2x, i.e., 5000-10000 words |
margin: 1.5cm| 用户需求 | 执行标准 |
|---|---|
| 具体字数(如"3000字") | 误差在±20%以内,即2400-3600字 |
| 具体页数(如"5页") | 严格符合,最后一页可部分内容 |
| 字数范围(如"2000-3000字") | 必须落在范围内 |
| 无明确要求 | 根据文档类型合理推断;优先全面而非简略 |
| 最低字数要求(如"超过5000字") | 不超过2倍,即5000-10000字 |
margin: 1.5cm| Route | Tools | Purpose |
|---|---|---|
| HTML | Playwright + Paged.js | HTML → PDF conversion |
| HTML | KaTeX, Mermaid | Math formulas, diagrams |
| Process | pikepdf | Form filling, page operations, metadata |
| Process | pdfplumber | Text and table extraction |
| Process | LibreOffice | Office → PDF conversion |
| LaTeX | Tectonic | LaTeX → PDF compilation |
| 路径 | 工具 | 用途 |
|---|---|---|
| HTML | Playwright + Paged.js | HTML → PDF 转换 |
| HTML | KaTeX, Mermaid | 数学公式、图表 |
| Process | pikepdf | 表单填写、页面操作、元数据处理 |
| Process | pdfplumber | 文本和表格提取 |
| Process | LibreOffice | 办公文档→PDF 转换 |
| LaTeX | Tectonic | LaTeX → PDF 编译 |