-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Special field markers and modifiers #11367
Comments
Hello :-) I am not sure, but I assume the fieldmarkers are hardcoded and only provided for the most used fields. Please correct me, but I believe it is possible to achieve similar functionality than field markers by using Regular Expressions and modifiers. For example, |
For example, a construct like [title:truncate1] will only display the first letter of the corresponding token field, but what if I need to display only the first significant word or three words as "shorttitle"!? Let there be two books published in the same year with the main title or the title of the series as “Elements of Mathematics” by Nicolas Bourbaki and the usual titles: 1) Functions of a Real Variable; 2) General Topology. When referring to such books, for clarity, you can create the citationkey in the form ("Bourbaki_2004_Elements_Functions" and "Bourbaki_2004_Elements_General"). In the example above, you can use the "verishorttitle" marker to display the first word of the title (Functions or General), but which construct will help you display the first word of the main title or custom title (not including the function words like the, with, etc)? I'm not sure but an army knife won't work here! |
Please provide bibtex/biblatex source data, then I will play around with it. main title and user_title are not official bibtex/biblatex fields, but a custom field, right? |
Yes these are custom fields! About the sources. For example, let them be like this: @Book{Bamford_1972_Comprehensive_Reaction_V_7_EN,
language = {english},
maintitle = {Comprehensive Chemical Kinetics},
title = {Reaction of Metallic Salts and Complexes, and Oranometallic Compounds},
volume = {7},
year = {1972},
editor = {Bamford, C. H. and Tipper, C. F. H.},
}
@Book{Bamford_1972_Comprehensive_Reactions_V_6_EN,
language = {english},
maintitle = {Comprehensive Chemical Kinetics},
title = {Reactions of Non-Metallic Inorganic Compounds},
volume = {6},
year = {1972},
editor = {Bamford, C. H. and Tipper, C. F. H.},
}
@Book{Bamford_1972_Comprehensive_Decomposition_V_5_EN,
language = {english},
maintitle = {Comprehensive Chemical Kinetics},
title = {Decomposition and Isomerization of Organic Compounds},
volume = {5},
year = {1972},
editor = {Bamford, C. H. and Tipper, C. F. H.},
} |
TL;DR: Looks like this has to be fixed in JabRef code. I think, as you suggested, if it is possible, then extending some generic field markers like shorttitle or veryshorttitle to other or even all fields is a good idea. |
Hello can i take this issue ? I am a first time contributor |
Sure :-) 👍 |
Welcome to the vibrant world of open-source development with JabRef! Newcomers, we're excited to have you on board. Start by exploring our Contributing guidelines, and don't forget to check out our workspace setup guidelines to get started smoothly. In case you encounter failing tests during development, please check our developer FAQs! Having any questions or issues? Feel free to ask here on GitHub. Need help setting up your local workspace? Join the conversation on JabRef's Gitter chat. And don't hesitate to open a (draft) pull request early on to show the direction it is heading towards. This way, you will receive valuable feedback. Happy coding! 🚀 |
Hello i know it is not issue related but I am really struggling to clone the repository. I am always met with this error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly. I have tried all the recommended stuff from StackOverflow and I have tried ssh nothing helps so I am just wondering if anyone has any experience solving this ? Thank you |
@Mtjpp Such questions are better asked in our gitter chat: Try reducing the fetch depths while cloning: |
Just to understand: maintitle and maintitle
Just for the record: Our modifiers are listed at https://github.com/JabRef/user-documentation/blob/main/en/finding-sorting-and-cleaning-entries/saveactions.md#save-actions-as-modifiers. |
The issue is about the special field markers https://docs.jabref.org/setup/citationkeypatterns#special-field-markers |
And that
Meaning: Add new modifiers: https://docs.jabref.org/setup/citationkeypatterns#modifiers |
@NeymanDmitry I went into the code and got more claritiy, how things work. With #11967, the escaping is more easiy. This should be the pattern you are looking for:
The first "magic ingredient" is |
Implementation notes:
|
* Add references to other tests * Simplify code * Add test for extracting the first word * Relax escaping * Add link to PR * Add tests Refs #11367 * Refine CHANGELOG.md * Refine CHANGELOG.md
* Add references to other tests * Simplify code * Add test for extracting the first word * Relax escaping * Add link to PR * Add tests Refs JabRef#11367 * Refine CHANGELOG.md * Refine CHANGELOG.md
* Add references to other tests * Simplify code * Add test for extracting the first word * Relax escaping * Add link to PR * Add tests Refs JabRef#11367 * Refine CHANGELOG.md * Refine CHANGELOG.md
* Add references to other tests * Simplify code * Add test for extracting the first word * Relax escaping * Add link to PR * Add tests Refs JabRef#11367 * Refine CHANGELOG.md * Refine CHANGELOG.md
* Extended modifiers and added options for: CamelN Camel ShortTitleFormatter VeryShortTitleFormatter * Extended modifiers and added options for: CamelN Camel ShortTitleFormatter VeryShortTitleFormatter * Merge remote-tracking branch 'origin/main' # Conflicts: # src/main/java/org/jabref/logic/formatter/casechanger/CamelFormatter.java # src/main/java/org/jabref/logic/formatter/casechanger/CamelNFormatter.java # src/main/java/org/jabref/logic/formatter/casechanger/ShortTitleFormatter.java # src/main/java/org/jabref/logic/formatter/casechanger/VeryShortTitleFormatter.java * Small fix for get key and get name in camel formatters * Changed tests to have only one location inside BracketedPatternTest.java
Fixed by #12067 |
When forming a link or filename, constructs like "veryshorttitle" are sometimes required, but sometimes this type of marker is required for another field, such as [MAINTITLE] or [user_title] etc.
It might be better to use something like modifiers :veryshorttitle, :shorttitle, etc., for any field, rather than just field markers for title, authors, and editors only.
The text was updated successfully, but these errors were encountered: