Skip to content

Add main TeX entry-point filtering and clean bibliography comments - #129

Open
shlee-lab wants to merge 3 commits into
google-research:mainfrom
shlee-lab:agent/main-tex-entrypoint
Open

Add main TeX entry-point filtering and clean bibliography comments#129
shlee-lab wants to merge 3 commits into
google-research:mainfrom
shlee-lab:agent/main-tex-entrypoint

Conversation

@shlee-lab

Copy link
Copy Markdown

Summary

This PR improves the generation of arXiv-ready source archives for projects
that contain multiple papers or unrelated root-level files.

It:

  • adds a --main_tex option for selecting the paper entry point;
  • retains only TeX files reachable from the selected entry point;
  • copies only referenced root-level and nested dependencies;
  • resolves ambiguous unqualified figure references by preferring the
    shallowest matching path;
  • removes comments from retained .bib and .bbl files; and
  • documents the new option and adds regression tests.

Motivation

The cleaner currently treats every root-level TeX and non-TeX file as part of
the submission. For repositories containing multiple papers, backups, review
artifacts, or other private files, this can include unrelated content in the
generated arXiv directory.

In addition, comments are removed from TeX sources but can remain in copied
bibliography files. Those comments may contain notes that should not be included
in a public arXiv submission.

The new option allows users to select an explicit entry point:

arxiv_latex_cleaner /path/to/latex --main_tex main.tex

When --main_tex is not supplied, the existing behavior is preserved for
backward compatibility.

Testing

  • Ran the complete unit and integration test suite: 102 tests passed.
  • Verified that the generated archive excludes unrelated root files,
    alternative TeX entry points, private notes, and shadowed figure files.
  • Verified that referenced TeX, class, bibliography, data, and figure files are
    retained.
  • Verified that escaped percent signs in bibliography contents are preserved
    while comments are removed.
  • Cleaned and successfully compiled a multi-file, 28-page LaTeX project using
    the new option.

@google-cla

google-cla Bot commented Jul 18, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@shlee-lab

Copy link
Copy Markdown
Author

@googlebot rescan

@shlee-lab
shlee-lab marked this pull request as ready for review July 22, 2026 15:10
@shlee-lab
shlee-lab marked this pull request as draft July 22, 2026 15:18
@shlee-lab
shlee-lab marked this pull request as ready for review July 22, 2026 15:18
@shlee-lab
shlee-lab marked this pull request as draft July 23, 2026 12:11
@shlee-lab
shlee-lab marked this pull request as ready for review July 23, 2026 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant