This skill analyzes external formatting specifications and automatically adjusts LaTeX configuration files to meet page layout, fonts, and heading styles.
npx playbooks add skill li-chunyuan/djtu_thesis_latex_template --skill latex-format-adapter
解析格式规范 → 生成/修改 LaTeX 配置
根据项目结构自动识别并调整相应的格式控制文件:
适用于大多数项目,直接在主文档或配置文件中调整宏包参数:
| 配置位置 | 典型文件 | 调整内容 |
|---------|---------|---------|
| 主文档导言区 | main.tex、thesis.tex | 直接在 \documentclass 和 \begin{document} 之间配置 |
| 独立配置文件 | config.tex、setup.tex、preamble.tex | 通过 \input{config} 导入的格式设置 |
常见调整内容:
适用于需要模块化管理或复用格式定义的项目:
| 文件类型 | 典型用途 | 示例 |
|---------|---------|------|
| .sty 文件 | 封装可复用的格式定义和宏命令 | mythesis.sty、heading-style.sty |
| 分模块配置 | 按功能拆分配置(便于维护) | config/fonts.tex、config/layout.tex |
操作方式:
.sty 文件或修改现有样式包config.tex 为多个模块化文件\usepackage{mystyle} 或 \input{config/module} 引入适用于需要深度定制文档行为的场景(如学校官方模板):
| 文件类型 | 典型用途 | 注意事项 |
|---------|---------|---------|
| .cls 文件 | 定义文档类(如 \documentclass{mythesis}) | 需要深入理解 LaTeX 内部机制 |
操作方式:
.cls 文件(如 thesis.cls、ctexart.cls 的定制版)选择原则:
main.tex、thesis.tex 等)config.tex、setup.tex 等).cls、.sty 文件).cls 文件将格式要求转换为 LaTeX 代码:
\usepackage[top=2.5cm, bottom=2.5cm, ...]{geometry}\ctexset{section={format={\heiti\zihao{-3}\bfseries}}}\setstretch{1.5} 或 \linespread{1.5}.sty / .tex 文件xelatex main.tex 或项目特定的编译命令config.tex、.sty、.cls 等).tex 文件、图表、公式等)Weekly roundup of top Claude Code skills, MCP servers, and AI coding tips.