Script that prepares tarball of tex document in current directory tree for arXiv submission, stripping any tex comments.
$ arxivprep [TEXNAME[.tex]]
Run arxivprep in the top-level directory containing the tex document.
If a TeX typesetter is available, arxivprep attempts to determine document dependencies automatically by examining the list of input and output files generated by the -recorder option of modern versions of latex (and pdflatex, xelatex, lualatex, etc).
If TEXNAME if specified it is used as the main document when determining document dependencies. If omitted, document dependencies are determined from the first .tex file (in alphanumeric order) in the current directory.
If a suitable TeX typesetter is not installed, arxivprep will include any .tex, .bbl, .sty, .cls, .pdf, .jp(e)g, and .png files in subtree relative to TEXNAME (or the current directory if TEXNAME is omitted).
The behavior of the script can be modified by setting the value of environment variables the script recognizes, e.g.
$ TEXFILES=paper.tex arxivprep
arxivprep respects the following environment variables:
-
TYPESETTERTeX typesetter used for automatic document dependency detection. Must support -recorder option. Defaults to pdflatex. -
LATEXFLAGSAdditional command line flags passed toTYPESETTER. -
OUTFILEPathname of output tarball to be created. -
TMPDIRPathname to directory where to place temporary files. -
AUXDIRPathname to directory used to store auxiliary files generated during document dependency detection. Setting this environment variable will cause auxiliary files to be left in the specified directory. -
TARDIRPathname to directory used to store processed files included in tarball. Setting this environment variable will cause processed files to be left in the specified directory. -
STRIPTEXCOMMENTCommandline used to invoke striptexcomments script.
The following environment variables can be used to override automatically detected document dependencies.
-
INPUTSList of files to include in tarball. -
TEXFILESTex files (.tex) to strip from comments and include in tarball. -
BBLFILESBibliography (.bbl) files to include in tarball. -
PKGFILESTex class and style files (.clsand.sty) to include in tarball. -
FIGFILESFigure files to include in tarball (default:.pdf,.jp(e)g,.png)
Requires Python 3 and ply.lex:
$ pip install ply
striptexcomments based on strip_comments.py script by Adam Merberger
strip_comments.py modifications that preserve comments in \makeatletter and \makeatother blocks by dzhuan
- Hugo Depuydt
Copyright 2019 Thomas Nyman <[email protected]>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.