-
Notifications
You must be signed in to change notification settings - Fork 8
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
Option to display (unprocessed) unknown LaTeX commands #8
Comments
I second this! A simple boolean option that tells latex2unicode to either keep or discard unknown commands would be perfect! |
@olivierfruchart @lenhard Can you guys give a more specific description of the problem? e.g. a few examples in the form of:
Also I haven't touched the codebase or written Scala for quite a while, so I'll need to find some time and re-familiarize myself. A quick look suggests that I might need to make the logic here more flexible: latex2unicode/src/main/scala/com/github/tomtung/latex2unicode/LaTeX2Unicode.scala Line 98 in a3610c3
In the meantime, pull requests would also be appreciated :) |
From JabRef/jabref#3408
I think it wouldn't matter too much if the Also I am not sure how to treat input in the form I have no real experience with Scala yet, so a PR seems tempting :) Unfortunately, I am buried in work right now, so don't expect something in the near future. |
Apologies for my delayed answer. Yes lenhard, your example is exactly my issue. All other examples would be technically identical. In practice my issue is even worse because "\prl" is my full input, so that I get an empty output. I agree that keeping or removing the \ is a secondary issue. Maybe keeping it is better, so that we can keep track of what \prl{manuscript} means, for the issue of parameter that you raised. |
Should be fixed in the newest version. |
This is a proper fix for issue #8 In the last version, unknown commands would cause parsing failures. For simplicity we create a `PassWith(s)` object every time we encounter an unknown command. This might be a speed problem if it happens too often, and can be worked around at the cost of more complexity if necessary.
I report this issue related to the use of latex2unicode since version 4.0 in JabRef, and after a discussion with the JabRef developers team.
For a long time I have been using my own LaTeX functions in fields of JabRef, for instance \prl for the Journal, which upon compilation in LaTeX I translate to Phys. Rev. Lett. As \prl is not recognized as a standard LaTeX command, it is ignored by latex2unicode and removed. As a result, in my table of entries I do not see any more the fields which are coded as private LaTeX commands. For example, I lost completely the overview of the journals.
The developers of JabRef suggested that an option may be added to latex2unicode to specify how an unknown LaTeX command is processed, which is the option I also thought of. The minimum could be "Ignore" and "Display", the latter rendering either \prl or prl. This would be very helpful, possibly beyond JabRef.
The text was updated successfully, but these errors were encountered: