Pre-flight cleanup for arXiv/venue submission: strip comments (escape/verbatim-aware), flag packages installed-but-unused via a command->package map, list missing assets (\input/\bibliography/\includegraphics), undefined refs, TOC leftovers, non-ASCII in TeX source. Learned from google-research/arxiv-latex-cleaner. Use when the user asks for pre-arXiv-submission cleanup / clean up a LaTeX project / slim down tex / delete tex comments / check undefined references / latex cleanup / pre-submission packaging check / clean up a tex project / remove extra packages / check undefined refs / arxiv packaging / strip latex comments. Fails with rc=1 when the input file does not exist…