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.23k stars 327 forks source link

comment symbol "%" remove #73

Open Zhonglu opened 1 year ago

Zhonglu commented 1 year ago

It is suggested that comments should not be replaced by blank, but be replaced by "%".

"%" can be important to hold some positions. Deleting it may cause error.

jponttuset commented 1 year ago

In principle, the behaviour of arXiv LaTeX cleaner does not affect the compiled results, since it keeps the "%" where needed. If you have an example that breaks, though, we can have a look at it

piperfw commented 5 months ago

Here's a minimal example that breaks due to removal of a % (note the spacing before '%' characters appears to be important?)

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
        %Z
     %Y
        X
\end{align}
\end{document}

With the result

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}

        X
\end{align}
\end{document}

Is is possible to at least disable the deletion of lines containing 'only' a %? I have hundreds of instances of it failing in compiling a large document.