transfer-old-latex-to-new
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseChineseResearchLaTeX 内容迁移技能
ChineseResearchLaTeX Content Migration Skill
这个 skill 只做一件事:把旧材料里的正文、参考文献等内容,迁移到 当前仓库已有模板项目 的内容层。
它不是模板开发 skill,也不是公共包重构 skill。凡是要改模板源码、样式、、 内骨架文件、、、、、profile、style 或构建脚本的任务,都应转给 或对应产品线的模板开发流程。
packages/bensz-*projects/*main.tex@config.tex.cls.stymake-latex-modelThis skill only does one thing: migrate the main content, references, etc., from old materials to the content layer of existing template projects in the current repository.
It is not a template development skill nor a public package refactoring skill. Any tasks that require modifying template source code, styles, skeleton files in , , , , , , profiles, styles, or build scripts should be transferred to or the template development process of the corresponding product line.
packages/bensz-*projects/*main.tex@config.tex.cls.stymake-latex-model硬性边界
Hard Boundaries
处理任务时必须始终遵守:
- 绝不能修改 下任何公共包源码、模板实现、profile、style、脚本或共享资源
packages/ - 绝不能修改 下任何模板样式、入口骨架、wrapper、
projects/、main.tex、extraTex/@config.tex、.cls、Lua/Python 构建脚本.sty - 只能把内容放到目标项目已有的内容层位置
- 如果现有模板没有合适承载位点,不能为了容纳内容去改模板;应明确报告“模板位点不足,需要模板开发 skill 介入”
当前仓库里默认可写的内容层只有 (排除 )和 。
extraTex/**/*.texextraTex/@config.texreferences/**/*.bib除非未来该 skill 的配置白名单明确放开,否则其它路径一律视为只读。
Must always comply with the following when processing tasks:
- Never modify any public package source code, template implementations, profiles, styles, scripts, or shared resources under
packages/ - Never modify any template styles, entry skeletons, wrappers, ,
main.tex,extraTex/@config.tex,.cls, or Lua/Python build scripts under.styprojects/ - Only place content in the existing content layer locations of the target project
- If there is no suitable location in the existing template to accommodate the content, do not modify the template to fit it; clearly report "insufficient template locations, need template development skill intervention"
The default writable content layers in the current repository are only (excluding ) and .
extraTex/**/*.texextraTex/@config.texreferences/**/*.bibUnless the configuration whitelist of this skill explicitly allows other paths in the future, all other paths are considered read-only.
与当前仓库结构对齐
Align with Current Repository Structure
这个 skill 仍然要识别目标产品线,但目的只是选对承载项目,而不是判断“该不该改 ”。
packages/- NSFC:选择合适的
projects/NSFC_* - SCI 论文:选择
projects/paper-sci-01/ - 毕业论文:选择最接近的
projects/thesis-* - 简历:选择
projects/cv-01/
然后把旧材料中的正文内容映射到这些现成项目的内容文件里;默认优先选择最接近的现有项目,而不是新建或重组模板结构。
This skill still needs to identify the target product line, but only to select the correct hosting project, not to judge "whether to modify ".
packages/- NSFC: Select the appropriate
projects/NSFC_* - SCI papers: Select
projects/paper-sci-01/ - Graduation theses: Select the closest
projects/thesis-* - Resumes: Select
projects/cv-01/
Then map the main content from the old materials to the content files of these existing projects; by default, prioritize selecting the closest existing project rather than creating new or restructuring template structures.
输入原则
Input Principles
不要要求用户先整理成固定输入协议。默认接受并消化任意合理输入,例如:
- 一个完整旧项目目录
- 若干 /
.tex/.bib/.docx/.md.txt - PDF、截图、图片
- 一份已有模板项目路径,加上一些迁移目标说明
- 多种输入混合出现
如果材料不完整,不要先追问“标准输入”;先判断目标产品线、合适承载项目、哪些内容能直接落入 或 ,以及哪些诉求已经超出内容迁移边界。只有缺失信息会导致把正文放错位置时,才请求补充。
extraTex/*.texreferences/*.bibDo not require users to organize inputs into a fixed protocol first. By default, accept and process any reasonable inputs, such as:
- A complete old project directory
- Multiple /
.tex/.bib/.docx/.mdfiles.txt - PDFs, screenshots, images
- An existing template project path plus some migration target instructions
- A mix of multiple input types
If materials are incomplete, do not first ask for "standard input"; first determine the target product line, suitable hosting project, which content can be directly placed into or , and which requests have exceeded the content migration boundaries. Only request supplementary information if missing information will lead to incorrect placement of the main content.
extraTex/*.texreferences/*.bib输出原则
Output Principles
不要把输出理解成“任意重构仓库”。本 skill 的有效输出通常只有:
- 把正文迁移到目标项目的
extraTex/*.tex - 把参考文献迁移到目标项目的
references/*.bib - 生成必要的迁移说明、风险提示、未落位清单
- 在构建成功后给出验证结果
以下动作都超出本 skill 的边界:模板源码改动、样式修复、wrapper / / / README 的结构重写,以及公共包抽取或包级能力沉淀。默认把用户原始材料视为只读,目标模板视为只读骨架;样式差异只报告,不偷改。
main.textemplate.jsonDo not interpret the output as "arbitrary repository restructuring". The valid outputs of this skill are usually only:
- Migrate main content to of the target project
extraTex/*.tex - Migrate references to of the target project
references/*.bib - Generate necessary migration instructions, risk warnings, and unplaced content lists
- Provide verification results after successful building
The following actions are beyond the boundaries of this skill: modifying template source code, fixing styles, restructuring wrappers / / / README, and extracting public packages or沉淀 package-level capabilities. By default, treat users' original materials as read-only, and treat the target template as a read-only skeleton; only report style differences, do not modify them without permission.
main.textemplate.json推荐工作流
Recommended Workflow
1. 识别目标产品线与承载项目
1. Identify Target Product Line and Hosting Project
先回答三个问题:用户最终要落到哪条产品线、当前仓库哪个现有项目最适合作为承载容器、这次任务是“内容迁移”还是已经变成“模板开发”。如果已经变成模板开发,立即转交,不要继续伪装成内容迁移任务。
First answer three questions: which product line does the user ultimately want to use, which existing project in the current repository is most suitable as the hosting container, and whether this task is "content migration" or has become "template development". If it has become template development, transfer it immediately and do not continue to pretend it is a content migration task.
2. 清点可迁移内容
2. Inventory Migratable Content
从输入中提炼可直接复用的正文段落、BibTeX、需要人工确认的缺口,以及会触发模板改动需求的超界诉求。
Extract directly reusable main content paragraphs, BibTeX, gaps that require manual confirmation, and over-limit requests that trigger template modification requirements from the input.
3. 做内容层映射
3. Perform Content Layer Mapping
只在内容层做映射:
- 旧正文 →
extraTex/*.tex - 旧参考文献 →
references/*.bib
不要把“映射”理解成:
- 改章节命令
- 改模板标题样式
- 改目录/封面/页眉页脚
- 改公共包接口
Only perform mapping at the content layer:
- Old main content →
extraTex/*.tex - Old references →
references/*.bib
Do not interpret "mapping" as:
- Modifying chapter commands
- Modifying template title styles
- Modifying table of contents/cover/header/footer
- Modifying public package interfaces
4. 执行迁移
4. Execute Migration
执行时只允许覆盖目标内容文件、新建目标内容文件(若模板已有对应承载位点)、以及写入或补齐 。
.bib如果某项需求必须改模板骨架才能完成,不要继续自动修改;应明确标出受阻位置和原因,并建议改用 。
make-latex-modelDuring execution, only allow overwriting target content files, creating new target content files (if the template has corresponding hosting locations), and writing or supplementing files.
.bibIf a certain requirement can only be completed by modifying the template skeleton, do not continue to modify automatically; clearly mark the blocked location and reason, and recommend using instead.
make-latex-model5. 官方入口验证
5. Official Entry Verification
迁移完成后,尽量用对应产品线的官方入口验证:
- NSFC:
python packages/bensz-nsfc/scripts/nsfc_project_tool.py build --project-dir <项目路径> - SCI:
python packages/bensz-paper/scripts/paper_project_tool.py build --project-dir <项目路径> - Thesis:
python packages/bensz-thesis/scripts/thesis_project_tool.py build --project-dir <项目路径> - CV:
python packages/bensz-cv/scripts/cv_project_tool.py build --project-dir <项目路径> --variant all
如果构建失败且原因来自模板骨架缺口,不要私自修模板;应如实报告。
After migration is completed, try to verify using the official entry of the corresponding product line as much as possible:
- NSFC:
python packages/bensz-nsfc/scripts/nsfc_project_tool.py build --project-dir <project path> - SCI:
python packages/bensz-paper/scripts/paper_project_tool.py build --project-dir <project path> - Thesis:
python packages/bensz-thesis/scripts/thesis_project_tool.py build --project-dir <project path> - CV:
python packages/bensz-cv/scripts/cv_project_tool.py build --project-dir <project path> --variant all
If the build fails and the reason comes from template skeleton gaps, do not modify the template without permission; report truthfully.
Legacy CLI 的定位
Legacy CLI Positioning
scripts/run.pyscripts/migrate.shscripts/run.pyscripts/migrate.sh不适用场景
Inapplicable Scenarios
以下场景不要继续使用本 skill 直接落地:
- 用户要“做一个新模板”
- 用户要“把旧样式 1:1 复刻到当前仓库”
- 用户要改 、
packages/bensz-*里的模板入口或样式文件projects/* - 用户要新增模板承载位点、封面结构、目录结构、profile、class、style
这些都应转交模板开发链路。
Do not directly use this skill for the following scenarios:
- Users want to "create a new template"
- Users want to "1:1 replicate old styles into the current repository"
- Users want to modify template entry or style files in ,
packages/bensz-*projects/* - Users want to add new template hosting locations, cover structures, table of contents structures, profiles, classes, styles
These should all be transferred to the template development pipeline.
参考材料
Reference Materials
优先阅读本文件。需要 legacy CLI 细节时,再查看:
scripts/README.mdreferences/quickstart.mdreferences/config_guide.mdreferences/api_reference.md
确认边界时,始终优先遵循:
- 只迁移内容,不改模板骨架
- 样式差异只报告,不偷改
Prioritize reading this document. When details of the legacy CLI are needed, refer to:
scripts/README.mdreferences/quickstart.mdreferences/config_guide.mdreferences/api_reference.md
When confirming boundaries, always follow the priorities:
- Only migrate content, do not modify template skeletons
- Only report style differences, do not modify them without permission