-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Add cleanup action: "Make LaTeX ready: Escape $" #8673
Comments
Hello! I am a junior undergraduate cs student and I wanna have a try. Hope you can give me the chance, thank you! |
Hey @fly-ing-fish of course :-) Feel free to work on this. As a general advice: check out https://github.com/JabRef/jabref/blob/main/CONTRIBUTING.md for a start. Also, https://devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace is worth having a look at. Don't mind asking, if you have any questions here on GitHub or also at JabRef's Gitter chat. Try to open a (draft) pull request early on, so that people can see you are working on the issue and so that they can see the direction the pull request is heading towards. This way, you will likely receive valuable feedback. |
I just did a test to check how LaTeX/Biber behaves concretely: Test bibliography:
The .tex file used for the test:
Results: |
The solution may resemble the cleanup actions |
Check out page 15 and 16 of the comprehensive LaTeX symbols list! (https://www.ctan.org/tex-archive/info/symbols/comprehensive) I am not sure if all these other symbols in the above tables create problems when compiling with LaTeX nowadays (I would assume yes 😑). I am also not sure how many of these symbols the Since you are touching this code anyway, implementing a few more cleanup-actions (or merging a few of them together into ONE cleanup action) might be possible, no? If you can find out how to do one, the others will be only a few clicks and "copy paste" away, I assume 😁 |
Thank you for the reply and support with details! I am working on it. |
I followed the indications of the " Set up a local workspace" in the JabRef Development Documentation, but met a problem while doing "Build and run JabRef by double-clicking JabRef | Tasks | application | run.".
Execution failed for task ':generateBstGrammarSource'.
wrong path are generated automatically, like src-gen\main\java\org\jabref\logic\bst\G:\BstParser.java and src-gen\main\java\org\jabref\logic\bst\G:\Bst__.g. I have no idea to solve this right now, could you give me some advice, please? |
@fly-ing-fish is Jabref located directly under G:\Jabref? |
It works, thanks for your help! 😁 @Siedlerchr |
Hey, I just noticed: Obviously, JabRef can't know if the user wants to use special characters with or without backslash, but JabRef could NOTIFY the user that there are special characters present in an entry via "Integrity check". (JabRef's current integrity check does not check for this) When I tried to use a workaround and use "search" to search for a $ sign within the entry, it was not found. 😅 Yay. Another issue that lets me look forward to JabRef 6.x with Lucene search xD |
@fly-ing-fish I would appreciate it if you could add a hint to the devdocs https://github.com/JabRef/jabref/blob/main/docs/getting-into-the-code/guidelines-for-setting-up-a-local-workspace.md |
|
I finished my tests. Here my test library: test-8673-encoding of special characters.bib.txt I wrote some comments into this file. Most interesting results:
Will try to compile the rest of the symbols with Latex one of these days and see what happens |
Most of the characters are being converted nicely, so that's fine :)) |
Btw. during these tests, I encountered #8687, so testing this took more time that I intended to spend on this :/ |
As for the problem of |
For
@Siedlerchr do you know where the Unicode to LaTeX mapping comes from? Is is JabRef self made, or is it a dependency? Would we ever want to touch the Unicode to LaTeX converter? |
@fly-ing-fish No need to adapt the latex <> unicode conversion map. See the existing LatexCleanupFormatter with the regex pattern for ESCAPE_PERCENT_SIGN_ONCE that also works when the value is already escaped. @ThiloteE For unicode <-> latex it's kind of both. We use https://github.com/plurimath/unicode2latex |
Problem:
$
character in my bibliographyDescribe the solution you'd like
Make LaTeX ready: Escape $
Adds backslash to $ characters. \$ will be rendered by LaTeX as $ instead of starting math-mode. Do not use this cleanup action, if you have entries that require usage of LaTeX math-mode.
Additional context
Make LaTeX ready: Cleanup
orMake LaTeX ready: Unicode to LaTeX
? Both allow the usage of math-mode, which is fine. This seems to be a zero-sum game and there is no heuristic that can find out if the user wants to use math-mode or simply render the $.Related to #8490 (comment) and #8650
The text was updated successfully, but these errors were encountered: