research_helpers.arxiv
Assembles and checks an arXiv submission. See arXiv and Zenodo.
- research_helpers.arxiv.manifest(*, patterns=DEFAULT_PATTERNS, extra=None, document=PAPER_DOCUMENT)[source]
Return the upload set, keyed by the path each file takes inside the submission.
Names are taken relative to the directory holding the manuscript, so a table installed at ‘tex/tables/scores.tex’ and read as ‘input{tables/scores}’ is uploaded as ‘tables/scores.tex’ and resolves the same way on arXiv. Only the tables and figures that the manuscript reads are uploaded (’input’ and ‘includegraphics’ outside a comment). A name with no file behind it is listed as written, so that ‘check’ reports it missing. A package the manuscript loads from its own directory, such as the ‘rhtextmath.sty’ that ‘research-helpers sty’ copies there, is uploaded beside it.
- Parameters:
patterns (
Iterable[str], default:DEFAULT_PATTERNS) – glob patterns a file in the tables and figures directories must match.extra (
Mapping[str,Path] |None, default:None) – anything else the build needs, e.g. a class file or a logo, keyed by its path inside the submission.document (
str, default:PAPER_DOCUMENT) – target: ‘paper’, or a name under ‘[tool.research-helpers.documents]’.
- Return type:
- Returns:
Submission path to source file, in a stable order.
- Raises:
KeyError – if no document of that name is configured.
- research_helpers.arxiv.unused(files, *, patterns=DEFAULT_PATTERNS, document=PAPER_DOCUMENT)[source]
Return tables and figures omitted from the upload.
Includes any file that the manuscript does not read, or reads in some way the manifest does not recognise, such as through a macro.
- research_helpers.arxiv.bbl_format(path)[source]
Return the format version declared in a biblatex .bbl.
- research_helpers.arxiv.check(files, *, engine=None, texlive=None, expected_bbl_format=None, markers=None, document=PAPER_DOCUMENT)[source]
Return every reason this submission would be rejected or would build wrongly.
- Parameters:
files (
Mapping[str,Path]) – the upload set, from ‘manifest’.engine (
str|None, default:None) – the LaTeX engine selected on arXiv. Defaults to the project’s setting.texlive (
int|None, default:None) – the TeX Live year selected on arXiv, used in messages.expected_bbl_format (
str|None, default:None) – the biblatex .bbl format that year reads. Defaults to the project’s setting.markers (
Iterable[str] |None, default:None) – text that must not reach the submission, checked outside comments in every TeX file. Defaults to the project’s setting (none).document (
str, default:PAPER_DOCUMENT) – the target document: ‘paper’, or a name under ‘[tool.research-helpers.documents]’.
- Return type:
- Returns:
One line per problem, empty when there is nothing wrong.
- Raises:
KeyError – if no document of that name is configured.
- research_helpers.arxiv.build(files, destination)[source]
Copy the upload set into a freshly emptied directory.
- research_helpers.arxiv.pack(source, archive=None)[source]
Pack a built submission as the tarball arXiv accepts.
The archive is byte-reproducible, so re-packing an unchanged submission gives an identical file and a resubmission can be told apart from a rebuild.
- research_helpers.arxiv.preview(source, destination, *, engine=None, passes=DEFAULT_PASSES, document=PAPER_DOCUMENT)[source]
Compile a built submission with the engine arXiv will use.
- Parameters:
- Return type:
- Returns:
The PDF produced.
- Raises:
RuntimeError – if the engine produced no PDF.