ArXiv requires uploading TeX sources. The justifications they give for this are rather weak IMHO, but that is beside the point.
What is the easiest way to clean up an article for submission? ArXiv suggests to automatically delete all lines starting with %, but of course this vastly understates the possibilities of LaTex: Many of my files contain complex \if statements, \iffalse-\fi blocks, not all % symbols mark comments, etc.
Is there a good automatic way to prepare a file for submission?
During the compilation, clearly at some point LaTeX must decide which parts to ignore and which to compile, what to do with the conditionals etc. Is there a way to send the result of this into a file?
Or are there any other good ideas of how to approach this problem?
pdflatexonly (so no XeLaTeX or LuaLaTeX or ConTeXt), precompilebblandindfiles, precompilemintedlistings,pythontex,gnuplottexetc. But considering standard TeX/LaTeX syntax such as if-statements there should not be a problem at all for ArXiv to compile it. – Marijn Jul 16 '19 at 11:01