diff --git a/Makefile b/Makefile index ab12cce..94e7e2a 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,7 @@ SWEEP_ENV_LOAD = set -a; [ -f "$(SWEEP_ENV_FILE)" ] && . "$(SWEEP_ENV_FILE)" || .PHONY: help help: - @echo "pdf.build pdf.watch pdf.clean pdf.genpop pdf.genpop.watch | test.backend test.e2e test.all | web.dev | install | train | benchmark | benchmark.simple | benchmark.agent | train.agent | train.bootstrap | stats.lines" + @echo "pdf.build pdf.watch pdf.clean pdf.genpop pdf.genpop.watch pdf.arxiv | test.backend test.e2e test.all | web.dev | install | train | benchmark | benchmark.simple | benchmark.agent | train.agent | train.bootstrap | stats.lines" @echo "backend.server backend.provider backend.worker | platform.up platform.down platform.logs | docker.train.publish" @echo "" @echo "Build general public version:" @@ -81,6 +81,10 @@ pdf.genpop: pdf.genpop.watch: @bash scripts/nx_paper.sh watch-genpop +.PHONY: pdf.arxiv +pdf.arxiv: + @bash scripts/nx_paper.sh build-arxiv + .PHONY: test.backend test.backend: @$(NX) run research:test diff --git a/paper/project.json b/paper/project.json index ed47680..503c67a 100644 --- a/paper/project.json +++ b/paper/project.json @@ -34,6 +34,16 @@ "command": "bash scripts/nx_paper.sh wordcount", "cwd": "." } + }, + "build-arxiv": { + "executor": "nx:run-commands", + "outputs": [ + "{projectRoot}/build/main-arxiv.pdf" + ], + "options": { + "command": "bash scripts/nx_paper.sh build-arxiv", + "cwd": "." + } } }, "tags": [ diff --git a/paper/src/mirrors/arxiv/INSTRUCTIONS.md b/paper/src/mirrors/arxiv/INSTRUCTIONS.md new file mode 100644 index 0000000..91e1f3e --- /dev/null +++ b/paper/src/mirrors/arxiv/INSTRUCTIONS.md @@ -0,0 +1,64 @@ +The source thesis lives in paper/src/ (main.tex + chapters/ + preamble.tex + bib/references.bib). +Your job is to produce a self-contained arxiv-ready submission in this directory. + +## What to produce + +A single compilable main.tex that reproduces the full thesis content and compiles +cleanly with pdflatex + bibtex (no latexmk extras, no shell-escape). The output +must pass arxiv's AutoTeX pipeline without manual intervention. + +## arxiv constraints to satisfy + +1. Flat layout: all files referenced by \input or \includegraphics must sit in + this directory or one level below (no ../../ relative paths). Copy or symlink + chapters and graphics here, then rewrite \input paths accordingly. + +2. Bibliography: arxiv does not run biber. Use bibtex. The preamble currently + loads biblatex with backend=bibtex — keep that, or switch to natbib + + \bibliographystyle{plainnat} if biblatex causes trouble. Either way, include + the pre-built .bbl file in the submission tarball (arxiv runs bibtex once but + having the .bbl avoids failures). + +3. Packages: remove or replace anything arxiv's TeX Live snapshot may not carry. + Known problematic ones in the current preamble: + - newtxtext/newtxmath: fine on recent TeX Live, but have a fallback to + \usepackage{times} + \usepackage{mathptmx} if the build fails. + - algorithm2e: arxiv supports it, keep it. + - cleveref: fine. + - pgfplots: fine, but pin compat=1.18. + +4. No \include of generated code appendix: the concat_code.sh appendix that gets + appended at build time is for the university submission only. Omit it here or + replace with a short note pointing to the repository URL. + +5. Hyperref: keep it but add \usepackage[hidelinks]{hyperref} to suppress colored + boxes, which look bad in arxiv's PDF renderer. + +6. Title / author block: use a normal \maketitle with full author name, affiliation, + and date. Do not use the titlepage environment from the university version. + +7. Double spacing: remove \doublespacing (arxiv readers expect single spacing). + +8. Page headers: remove the fancyhdr block; arxiv adds its own stamp header. + +## Minimal diff principle + +Preserve all content, section order, equations, theorems, figures, and tables from +the original thesis exactly. Only make the structural changes listed above. Do not +paraphrase, summarize, or rewrite prose. The mirror is a format adaptation, not +an editorial one. + +## How to verify + +From paper/src/mirrors/arxiv/ run: + pdflatex main.tex + bibtex main + pdflatex main.tex + pdflatex main.tex + +The build must complete without errors (warnings are acceptable). The resulting +main.pdf should be visually equivalent to paper/build/main.pdf modulo formatting +differences from removing double spacing and the titlepage. + +To build via make from the repo root: + make pdf.arxiv diff --git a/scripts/nx_paper.sh b/scripts/nx_paper.sh index 8ddd80c..375db5a 100644 --- a/scripts/nx_paper.sh +++ b/scripts/nx_paper.sh @@ -41,6 +41,15 @@ case "$cmd" in cd paper/src latexmk -pvc -pdf -jobname=main-genpop -f -interaction=nonstopmode -file-line-error -r ../.latexmkrc -outdir=../build main-genpop.tex ;; + build-arxiv) + mkdir -p paper/build + cd paper/src/mirrors/arxiv + pdflatex -interaction=nonstopmode -file-line-error main.tex + bibtex main + pdflatex -interaction=nonstopmode -file-line-error main.tex + pdflatex -interaction=nonstopmode -file-line-error main.tex + cp main.pdf ../../../build/main-arxiv.pdf + ;; *) printf '%s\n' "Unknown paper command: $cmd" >&2 exit 1