-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Abstract should omit LaTeX comments #58
Comments
Make sure to also filter out "comments" produced by other means such as \iffalse blocks. |
There is a python library that does something like this, and I think we should use that. It can filter out things like \begin{comment} ... \end{comment} that is present in the latex comments package. |
Someone could have used the todonotes package with \usepackage[disable]{todonotes} and have their todo notes not show up. One easy way to overcome this is to remove everything like \todo{...} but I'm not sure if the arxiv_latex_cleaner handles optional arguments on a macro. |
This issue is solved by downstream processing of the \jobname.abstract file. It turns out that \todo[inline]{this is a todo} will not be removed, because arxiv_latex_cleaner does not support this. |
This issue was moved because it's not easy to clean up abstracts within the LaTeX programming environment, so it's better left to the downstream processing. As it turns out, we now use The purpose of extracting the abstract is to fulfill multiple purposes in downstream processing. The abstract will be used as follows:
In each case we require different kinds of escaping for special characters. For example, in XML or HTML, we need to escape a < character so that it isn't confused with the beginning of an XML tag. This can be accomplished with a CDATA section in XML, and use of < in HTML. Note that the subtags in them to separate paragraphs. At the current time I split on '\n\n' and join them with tags. In this case we should probably remove any trailing % symbol that is not preceded by . Perhaps the most difficult part is to display the abstract in a sensible way in the web page for the paper. We typically use MathJax to render mathematics, so that simple things like |
The current implementation of iacrcc.cls does a direct copy of the contents of the
abstract
environment into the \jobname.abstract file. As a result, it captures LaTeX comments, which is unfortunate. The implementation uses the\Verbatimout{}
macro from fancyvrb, which does a complete copy. Thefancyvrb
package has thecommentchar
argument to theVerbatim
environment, but that doesn't work on the\Verbatimout
environment (it works on\Verbatiminput
)There are several possible solutions:
fancyvrb
.\commentchar
option to\Verbatimout
. This is risky and not advisable in case fancyvrb is updated.%
as starting a comment but not\%
. We could usere.split(r'(^%|[^\\]%)', line)
on all of the lines in the file, and just take the first part if it's nonempty.The text was updated successfully, but these errors were encountered: