latex-scaffold
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLaTeX Scaffold
LaTeX项目骨架搭建
Convert the approved Markdown draft into a minimal, buildable LaTeX project.
This is a deterministic conversion step; prose quality should already be addressed in .
output/DRAFT.md将已审核通过的Markdown草稿转换为可编译的极简LaTeX项目。
这是一个确定性的转换步骤;文本质量应已在中完成优化。
output/DRAFT.mdInputs
输入文件
- (or another approved draft)
output/DRAFT.md citations/ref.bib
- (或其他已审核通过的草稿)
output/DRAFT.md citations/ref.bib
Outputs
输出文件
- (and any required LaTeX support files)
latex/main.tex
- (及所有必要的LaTeX支持文件)
latex/main.tex
Workflow
工作流程
- Create directory if missing.
latex/ - Create with sections matching the outline.
latex/main.tex - Wire bibliography to .
citations/ref.bib
- 若目录不存在则创建该目录。
latex/ - 创建,其章节结构与草稿大纲匹配。
latex/main.tex - 配置参考文献指向。
citations/ref.bib
Quality checklist
质量检查清单
- exists and references
latex/main.tex.citations/ref.bib
- 已生成且正确引用
latex/main.tex。citations/ref.bib
Script
脚本使用说明
Quick Start
快速开始
python .codex/skills/latex-scaffold/scripts/run.py --helppython .codex/skills/latex-scaffold/scripts/run.py --workspace <workspace_dir>
python .codex/skills/latex-scaffold/scripts/run.py --helppython .codex/skills/latex-scaffold/scripts/run.py --workspace <workspace_dir>
All Options
所有选项
- See (inputs/outputs are taken from the unit runner when used via pipeline)
--help
- 查看获取详情(通过工作流使用时,输入/输出由单元运行器自动处理)
--help
Examples
示例
- Build from
latex/main.tex:output/DRAFT.mdpython .codex/skills/latex-scaffold/scripts/run.py --workspace <ws>
- 从生成
output/DRAFT.md:latex/main.texpython .codex/skills/latex-scaffold/scripts/run.py --workspace <ws>
Notes
注意事项
- The generated includes a table of contents (tocdepth=2) for readability.
latex/main.tex - Language default: the scaffold uses (English-looking front matter). If the draft contains CJK characters, it switches to
articleso the PDF renders correctly.ctexart - Conversion rules (high level):
- Headings →
##/###/####(strips leading numeric prefixes like\section/\subsection/\subsubsection).1.2 - Headings starting with /
Appendixtrigger附录once, then render as appendix sections.\appendix - Bold caption lines like /
**Table 1. ...**immediately before a Markdown table become a LaTeX**Appendix Table A1. ...**float withtableand a stable\caption{...}.\label{tab:...} - →
## Abstractenvironment.abstract - or
[@Key]→[@Key1; @Key2]/\citep{Key}.\citep{Key1,Key2} - Inline markdown /
**bold**/*italic*→`code`/\textbf{}/\emph{}.\texttt{}
- Headings
- 生成的包含目录(tocdepth=2)以提升可读性。
latex/main.tex - 默认语言:骨架模板使用文档类(英文格式的前置内容)。若草稿包含CJK字符,将自动切换为
article文档类以确保PDF渲染正常。ctexart - 转换规则(概要):
- 标题→
##/###/####(移除类似\section/\subsection/\subsubsection的数字前缀)。1.2 - 以/
Appendix开头的标题将触发附录命令,之后的标题将作为附录章节渲染。\appendix - 表格前的粗体标题行(如/
**Table 1. ...**)将转换为LaTeX的**Appendix Table A1. ...**浮动环境,包含table和固定的\caption{...}。\label{tab:...} - →
## Abstract环境。abstract - 或
[@Key]→[@Key1; @Key2]/\citep{Key}。\citep{Key1,Key2} - 行内Markdown格式/
**粗体**/*斜体*→`代码`/\textbf{}/\emph{}。\texttt{}
- 标题
Troubleshooting
故障排除
Issue: the generated latex/main.tex
still contains Markdown markers
latex/main.tex问题:生成的latex/main.tex
仍包含Markdown标记
latex/main.texFix:
- Re-run and ensure the input
latex-scaffoldis clean (nooutput/DRAFT.md, no##, no**syntax that isn""t handled).[@...]
解决方法:
- 重新运行,确保输入的
latex-scaffold文件干净(无未被处理的output/DRAFT.md、##、**语法)。[@...]
Issue: citations are missing in LaTeX
问题:LaTeX中缺少参考文献引用
Fix:
- Ensure exists and the scaffold points bibliography to it; then compile with
citations/ref.bib.latex-compile-qa
解决方法:
- 确保文件存在,且骨架已正确配置指向该文件;然后使用
citations/ref.bib命令编译。latex-compile-qa