Skip to content
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

BibTeX Key Pattern results don't match with expectations #2604

Closed
RolfStarre opened this issue Mar 3, 2017 · 6 comments
Closed

BibTeX Key Pattern results don't match with expectations #2604

RolfStarre opened this issue Mar 3, 2017 · 6 comments

Comments

@RolfStarre
Copy link
Contributor

RolfStarre commented Mar 3, 2017

Hi!

I encounterd some unexpected behaviour in the creation of keys, I'm using JabRef 3.8.2 on windows 10 10.0 amd64 Java 1.8.0_121.

Steps to reproduce:

  1. In Preferences -> BibTeX key generator set the Default pattern field to [title][shorttitle]
  2. Generate the key, for example for the document in the screenshot

Based on the documentation on http://help.jabref.org/en/BibtexKeyPatterns I was expecting the following output:
For [title]: HeuristicsandUsabilityGuidelinesfortheCreationandEvaluationofFuninVideogames
For [shorttitle]: Heuristicsandusability

Intead I got Heuristicsandusabilityguidelinesforthecreationandevaluationoffuninvideogames
and Heuristicsusabilityguidelines.

image

Put the excerpt of the log file here
@lenhard
Copy link
Member

lenhard commented Mar 3, 2017

Related to #2589

Since this is the second report regarding key patterns in a short time, maybe there are some general issues with key patterns at the moment.

Edit: I just saw that you attempted to fix #2589 but did not propose the fix in this repo. You are very welcome to do so!

@RolfStarre
Copy link
Contributor Author

Hey, thanks for the response :)

I was working on it but I noticed afterwards that @Siedlerchr was already working on it as well in this pull request, so I wasn't sure if I should continue.

Fixing the [shorttitle] option shouldn't be too hard, but I was unable to find where the [title] option is handled in the function makeLabel in the class BibtexKeyPatternUtil.

@Siedlerchr
Copy link
Member

@RolfStarre Thanks for your interest, as I had not yet the time to investigate why the Google Guava solution does not really work as expected, you could take a look at it. Or we could use your solution, I saw that you already added a test for it... Feel free to propose your PR here.
We are always looking contributors...;)

Regarding the [title] option, it is handled implicity in the else-part where just the field content is returned:
return entry.getFieldOrAlias(val).orElse("");

@RolfStarre
Copy link
Contributor Author

Cool thanks, I'll continue working on it then :)

I'm going to try to fix the shortTitle and title cases as well then before I create the pull request.
I'll try to see what the Google Guava does and if I can use it.

@Siedlerchr
Copy link
Member

This can be closed right?

@RolfStarre
Copy link
Contributor Author

Yup 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants