|
| 1 | +# Build an arXiv-ready tarball of the DCP paper. |
| 2 | +# |
| 3 | +# Usage: |
| 4 | +# cd docs/paper |
| 5 | +# .\build-arxiv.ps1 |
| 6 | +# |
| 7 | +# Output: docs/paper/dcp-arxiv-v0.X.tar.gz |
| 8 | +# |
| 9 | +# Bumps the version by reading the project version from pyproject.toml. |
| 10 | + |
| 11 | +$ErrorActionPreference = "Stop" |
| 12 | +$paperDir = $PSScriptRoot |
| 13 | +Set-Location $paperDir |
| 14 | + |
| 15 | +# Pull version from pyproject.toml for the filename. |
| 16 | +$pyproject = Get-Content "..\..\pyproject.toml" -Raw |
| 17 | +$version = if ($pyproject -match '(?m)^version\s*=\s*"([^"]+)"') { $matches[1] } else { "dev" } |
| 18 | + |
| 19 | +Write-Output "=== regenerating figures ===" |
| 20 | +python figures\make_figures.py |
| 21 | + |
| 22 | +Write-Output "`n=== rebuilding paper (latexmk pdflatex bibtex pdflatex pdflatex) ===" |
| 23 | +latexmk -pdf -interaction=nonstopmode main.tex | Out-Null |
| 24 | + |
| 25 | +if (-not (Test-Path "main.pdf")) { |
| 26 | + Write-Error "main.pdf not produced; check main.log" |
| 27 | + exit 1 |
| 28 | +} |
| 29 | +if (-not (Test-Path "main.bbl")) { |
| 30 | + Write-Error "main.bbl not produced; bibtex did not run" |
| 31 | + exit 1 |
| 32 | +} |
| 33 | + |
| 34 | +$stage = Join-Path $env:TEMP "dcp-arxiv-staging" |
| 35 | +if (Test-Path $stage) { Remove-Item -Recurse -Force $stage } |
| 36 | +New-Item -ItemType Directory -Path $stage | Out-Null |
| 37 | +New-Item -ItemType Directory -Path "$stage\figures" | Out-Null |
| 38 | + |
| 39 | +Copy-Item main.tex $stage |
| 40 | +Copy-Item refs.bib $stage |
| 41 | +Copy-Item main.bbl $stage |
| 42 | +Copy-Item figures\*.pdf "$stage\figures\" |
| 43 | + |
| 44 | +$out = Join-Path $paperDir "dcp-arxiv-v$version.tar.gz" |
| 45 | +if (Test-Path $out) { Remove-Item $out } |
| 46 | +tar -czf $out -C $stage . |
| 47 | + |
| 48 | +$size = [math]::Round((Get-Item $out).Length / 1KB, 1) |
| 49 | +Write-Output "`n=== done ===" |
| 50 | +Write-Output " $out ($size KB)" |
| 51 | +Write-Output " contains: main.tex, refs.bib, main.bbl, 5 figures" |
| 52 | +Write-Output "" |
| 53 | +Write-Output "Upload to arXiv:" |
| 54 | +Write-Output " 1. arxiv.org -> Submit" |
| 55 | +Write-Output " 2. Primary category: cs.NI (or cs.DC for distributed/systems)" |
| 56 | +Write-Output " 3. Cross-list: cs.LG (machine learning) optional" |
| 57 | +Write-Output " 4. License: arXiv non-exclusive" |
| 58 | +Write-Output " 5. Upload the tar.gz above; arXiv builds latex itself" |
0 commit comments