arxiv-package
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesearXiv Submission Packager
arXiv提交打包工具
Purpose
用途
Assemble a TeX/LaTeX project into a clean, correctly structured or
archive ready for arXiv upload. Handles file selection, artifact
exclusion, directory structure, 00README generation, and validation of the
final package.
.tar.gz.zipCompanion skills:
- — validate before packaging
arxiv-preflight - — optimize figures before packaging
arxiv-figures
将TeX/LaTeX项目组装为结构规范、整洁的或归档文件,以便上传至arXiv。工具可处理文件筛选、构建产物排除、目录结构整理、00README文件生成以及最终包的验证工作。
.tar.gz.zip配套工具:
- — 打包前验证项目
arxiv-preflight - — 打包前优化图片
arxiv-figures
Workflow
工作流程
1. Inventory
1. 项目文件盘点
Scan the project directory. Classify every file:
INCLUDE — Required
- Main file(s)
.tex - All /
\inputtargets (recursively trace)\include - All targets
\includegraphics - files (pre-processed bibliography)
.bbl - files (pre-processed index)
.ind - /
.glsfiles (glossary/nomenclature).nls - Custom ,
.sty,.clsfiles not in TeX Live.bst - (if present)
00README.XXX - directory contents (ancillary files)
anc/
EXCLUDE — Build Artifacts
- ,
.aux,.log,.toc,.lot,.lof,.out,.nav,.snm.vrb - ,
.dvi,.ps(except figure PDFs and ancillary PDFs).pdf - ,
.synctex,.synctex.gz,.fls.fdb_latexmk - ,
.blg,.ilg,.glg(log files from bib/index/glossary processing).nlg - ,
*.bak,*~,*.swp(editor backups)*.swo - ,
.DS_Store,Thumbs.db(OS artifacts)desktop.ini
EXCLUDE — Should Not Submit
- Journal templates / style guides (unless custom needed for compilation)
.sty - Referee letters, cover letters
- Build scripts (,
Makefile) — not needed by arXivlatexmkrc - ,
.git/, version control directories.svn/ - IDE configs (,
.vscode/,.idea/).texpadtmp/
FLAG — Needs Decision
- files (include alongside
.bibor omit — arXiv processes both).bbl - Multiple files with
.tex(needs\documentclasswith00README.XXX)toplevelfile - Large data files (ancillary or exclude)
扫描项目目录,对所有文件进行分类:
包含 — 必需文件
- 主文件
.tex - 所有/
\input引用的目标文件(递归追踪)\include - 所有引用的目标文件
\includegraphics - 文件(预处理后的参考文献)
.bbl - 文件(预处理后的索引)
.ind - /
.gls文件(术语表/命名规范).nls - TeX Live中未包含的自定义、
.sty、.cls文件.bst - 已存在的文件
00README.XXX - 目录下的所有内容(辅助文件)
anc/
排除 — 构建产物
- 、
.aux、.log、.toc、.lot、.lof、.out、.nav、.snm.vrb - 、
.dvi、.ps(图片PDF和辅助PDF除外).pdf - 、
.synctex、.synctex.gz、.fls.fdb_latexmk - 、
.blg、.ilg、.glg(参考文献/索引/术语表处理生成的日志文件).nlg - 、
*.bak、*~、*.swp(编辑器备份文件)*.swo - 、
.DS_Store、Thumbs.db(系统生成的冗余文件)desktop.ini
排除 — 不应提交的文件
- 期刊模板/样式指南(除非编译需要自定义文件)
.sty - 审稿意见、投稿信
- 构建脚本(、
Makefile)—— arXiv无需此类文件latexmkrc - 、
.git/等版本控制目录.svn/ - IDE配置文件(、
.vscode/、.idea/).texpadtmp/
标记 — 需要人工决策
- 文件(是否与
.bib一同提交——arXiv支持两种处理方式).bbl - 多个包含的
\documentclass文件(需在.tex中声明00README.XXX)toplevelfile - 大型数据文件(归入辅助文件或直接排除)
2. Generate 00README.XXX
2. 生成00README.XXX文件
Create or update the file when needed:
00README.XXXundefined在需要时创建或更新文件:
00README.XXXundefinedAuto-generated by arxiv-package
Auto-generated by arxiv-package
Main TeX file (only if ambiguous — multiple \documentclass files)
Main TeX file (only if ambiguous — multiple \documentclass files)
main.tex toplevelfile
main.tex toplevelfile
Files to exclude from processing
Files to exclude from processing
cover-letter.pdf ignore
notes.txt ignore
cover-letter.pdf ignore
notes.txt ignore
Optional directives
Optional directives
nostamp
nostamp
nohypertex
nohypertex
Only generate if:
- Multiple `.tex` files contain `\documentclass` (declare `toplevelfile`)
- Files need explicit `ignore` directives
- User requests `nostamp` or other directives
仅在以下场景生成该文件:
- 多个`.tex`文件包含`\documentclass`(需声明`toplevelfile`)
- 需要为某些文件添加明确的`ignore`指令
- 用户要求添加`nostamp`或其他指令3. Validate Structure
3. 验证归档结构
Before creating the archive:
- All /
\inputtargets resolve to files in the package\include - All targets resolve to files in the package
\includegraphics - All targets have corresponding
\bibliographyfiles.bbl - No absolute paths in any TeX source
- No filenames with spaces or special characters
- directory contains no
anc/files.tex - No hidden files (will be deleted by arXiv upon announcement)
- Total uncompressed size is reasonable (flag >50MB — may need exception request)
创建归档前需完成以下验证:
- 所有/
\input引用的目标文件均存在于包内\include - 所有引用的目标文件均存在于包内
\includegraphics - 所有引用的目标文件均有对应的
\bibliography文件.bbl - TeX源文件中无绝对路径
- 文件名无空格或特殊字符
- 目录下无
anc/文件.tex - 无隐藏文件(arXiv会在发布时删除此类文件)
- 未压缩总大小合理(超过50MB需标记——可能需要申请例外)
4. Create Archive
4. 创建归档文件
bash
undefinedbash
undefinedFrom project root, create tar.gz excluding unwanted files
From project root, create tar.gz excluding unwanted files
tar czf submission.tar.gz
--exclude='.aux' --exclude='.log' --exclude='.toc'
--exclude='.lot' --exclude='.lof' --exclude='.out'
--exclude='.nav' --exclude='.snm' --exclude='.vrb'
--exclude='.dvi' --exclude='.synctex'
--exclude='.fls' --exclude='.fdb_latexmk'
--exclude='.blg' --exclude='.ilg' --exclude='.glg'
--exclude='.bak' --exclude='~' --exclude='.swp'
--exclude='.git' --exclude='.svn'
--exclude='.DS_Store' --exclude='Thumbs.db'
--exclude='.vscode' --exclude='.idea'
[list of files/directories to include]
--exclude='.aux' --exclude='.log' --exclude='.toc'
--exclude='.lot' --exclude='.lof' --exclude='.out'
--exclude='.nav' --exclude='.snm' --exclude='.vrb'
--exclude='.dvi' --exclude='.synctex'
--exclude='.fls' --exclude='.fdb_latexmk'
--exclude='.blg' --exclude='.ilg' --exclude='.glg'
--exclude='.bak' --exclude='~' --exclude='.swp'
--exclude='.git' --exclude='.svn'
--exclude='.DS_Store' --exclude='Thumbs.db'
--exclude='.vscode' --exclude='.idea'
[list of files/directories to include]
tar czf submission.tar.gz
--exclude='.aux' --exclude='.log' --exclude='.toc'
--exclude='.lot' --exclude='.lof' --exclude='.out'
--exclude='.nav' --exclude='.snm' --exclude='.vrb'
--exclude='.dvi' --exclude='.synctex'
--exclude='.fls' --exclude='.fdb_latexmk'
--exclude='.blg' --exclude='.ilg' --exclude='.glg'
--exclude='.bak' --exclude='~' --exclude='.swp'
--exclude='.git' --exclude='.svn'
--exclude='.DS_Store' --exclude='Thumbs.db'
--exclude='.vscode' --exclude='.idea'
[list of files/directories to include]
--exclude='.aux' --exclude='.log' --exclude='.toc'
--exclude='.lot' --exclude='.lof' --exclude='.out'
--exclude='.nav' --exclude='.snm' --exclude='.vrb'
--exclude='.dvi' --exclude='.synctex'
--exclude='.fls' --exclude='.fdb_latexmk'
--exclude='.blg' --exclude='.ilg' --exclude='.glg'
--exclude='.bak' --exclude='~' --exclude='.swp'
--exclude='.git' --exclude='.svn'
--exclude='.DS_Store' --exclude='Thumbs.db'
--exclude='.vscode' --exclude='.idea'
[list of files/directories to include]
Or create zip
Or create zip
zip -r submission.zip [files]
-x '.aux' -x '.log' -x '*.toc' ...
-x '.aux' -x '.log' -x '*.toc' ...
Prefer explicit file inclusion over directory-wide inclusion with exclusions.
This prevents accidental inclusion of sensitive or unnecessary files.zip -r submission.zip [files]
-x '.aux' -x '.log' -x '*.toc' ...
-x '.aux' -x '.log' -x '*.toc' ...
优先使用明确的文件包含方式,而非“全目录包含+排除指定文件”的方式。这能避免意外包含敏感或不必要的文件。5. Verify Archive
5. 验证归档文件
After creation:
- List archive contents — verify no unexpected files
- Extract to temporary directory
- Attempt compilation in the extracted directory (if TeX toolchain available)
- Report archive size (compressed and uncompressed)
- Compare file list against the include/exclude inventory
创建完成后需执行以下验证:
- 列出归档内容——确认无意外文件
- 将归档解压至临时目录
- 尝试在解压后的目录中编译项目(若TeX工具链可用)
- 报告归档大小(压缩后和未压缩)
- 对比文件列表与之前的包含/排除盘点结果
6. Report
6. 生成报告
markdown
undefinedmarkdown
undefinedarXiv Package Report
arXiv Package Report
Archive: submission.tar.gz
Compressed size: [size]
Uncompressed size: [size]
File count: [count]
Archive: submission.tar.gz
Compressed size: [size]
Uncompressed size: [size]
File count: [count]
Contents
Contents
| File | Size | Type |
|---|---|---|
| main.tex | 45 KB | Source |
| references.bbl | 12 KB | Bibliography |
| fig1.pdf | 380 KB | Figure |
| anc/data.csv | 1.2 MB | Ancillary |
| File | Size | Type |
|---|---|---|
| main.tex | 45 KB | Source |
| references.bbl | 12 KB | Bibliography |
| fig1.pdf | 380 KB | Figure |
| anc/data.csv | 1.2 MB | Ancillary |
Excluded
Excluded
| File | Reason |
|---|---|
| main.aux | Build artifact |
| main.log | Build artifact |
| referee-response.pdf | Not for submission |
| File | Reason |
|---|---|
| main.aux | Build artifact |
| main.log | Build artifact |
| referee-response.pdf | Not for submission |
00README.XXX
00README.XXX
[Contents if generated]
[Contents if generated]
Verification
Verification
- Archive extracts cleanly
- All source references resolve
- Compilation succeeds (if tested)
- No sensitive files included
undefined- Archive extracts cleanly
- All source references resolve
- Compilation succeeds (if tested)
- No sensitive files included
undefinedArchive Format Notes
归档格式说明
- preferred over
.tar.gz(standard in academic TeX workflows).zip - arXiv accepts both (gzipped) and
.tar.zip - Do not nest archives (no inside a
.tar.gz).zip - Files should be at root level or in logical subdirectories — no wrapper directory unless the project uses subdirectories for organization
- 学术TeX工作流中优先使用格式,而非
.tar.gz.zip - arXiv同时接受(gzip压缩)和
.tar格式.zip - 请勿嵌套归档(禁止在中包含
.zip).tar.gz - 文件应位于根目录或逻辑子目录中——除非项目本身使用子目录组织,否则不要添加外层包裹目录
Core Principles
核心原则
- Explicit inclusion over blanket exclusion. Build the file list from what's needed, not from everything minus what's not needed. This catches files that shouldn't be submitted but aren't in the exclusion list.
- Verify after packaging. The archive is the submission. Test it, not the source directory.
- Preserve directory structure. If the project uses subdirectories for figures or sections, maintain that structure. TeX paths depend on it.
- No sensitive files. Check for , credentials, personal notes, referee correspondence before packaging.
.env
- 明确包含优先于批量排除:根据需求构建文件列表,而非“所有文件减去排除项”。这能捕获不在排除列表中但不应提交的文件。
- 打包后验证:归档文件即为最终提交物,请验证归档而非源目录。
- 保留目录结构:若项目使用子目录存放图片或章节,请保持该结构。TeX路径依赖于目录结构。
- 无敏感文件:打包前检查是否存在、凭据文件、个人笔记、审稿往来邮件等。
.env