google-research / arxiv-latex-cleaner

arXiv LaTeX Cleaner: Easily clean the LaTeX code of your paper to submit to arXiv
Apache License 2.0
5.04k stars 318 forks source link

[Unexpected Behavior] Comments Not Removed on Lines with "auto-ignore" #93

Closed merajhashemi closed 3 months ago

merajhashemi commented 4 months ago

While fixing issue #91, I discovered that comments in lines containing the word auto-ignore are not being removed as expected. This behavior is not documented in either the README or the help message, which may lead to unexpected outcomes for users. I suppose there is a specific reason for this behavior as it is also being tested 🤔

Example

Input:

Foo auto-ignore Bar ... % Top Secret Comment

Output:

Foo auto-ignore Bar ... % Top Secret Comment

Expected Output:

Foo auto-ignore Bar ... %
jponttuset commented 4 months ago

Hi @merajhashemi! The rationale for this behavior is that arXiv uses this %auto-ignore comment to mark a file as not being the main tex file to be compiled. You can see more info here. We could definitely make the content matching more strict (e.g. there cannot be more text apart from "auto-ignore"), feel free to send a PR if you're up for it :)

merajhashemi commented 3 months ago

Hi @jponttuset! Thanks for letting me know about this! I didn't realize arXiv uses the %auto-ignore comment in that way. I've opened a pull request (#96) to tighten the content matching.

jponttuset commented 3 months ago

I made a small suggestion in the PR not to over-tighten the matching :)