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

Allow - in citaton keys #12144

Merged
merged 6 commits into from
Nov 10, 2024
Merged

Allow - in citaton keys #12144

merged 6 commits into from
Nov 10, 2024

Conversation

koppor
Copy link
Member

@koppor koppor commented Nov 3, 2024

Doesn't fully work, needs some more polishing.

Follow-up to #9703

Mandatory checks

  • I own the copyright of the code submitted and I licence it under the MIT license
  • Change in CHANGELOG.md described in a way that is understandable for the average user (if change is visible to the user)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

@koppor koppor marked this pull request as draft November 3, 2024 16:42
@koppor koppor marked this pull request as ready for review November 3, 2024 21:11
@koppor koppor added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Nov 3, 2024
@ThiloteE
Copy link
Member

ThiloteE commented Nov 4, 2024

The most credible source for allowed / unallowed characters does not list - and :: https://tex.stackexchange.com/questions/408530/what-characters-are-allowed-to-use-as-delimiters-for-bibtex-keys

But there are some mentions of possible complications here:

For example:

In general, however, it is a good idea to only use ASCII letters (lowercase a-z and uppercase A-Z; keep in mind that the names are case sensitive), digits and a few special characters such as ., -, :, _, /.

`

Bezeichnung Ausgabe LaTeX-Code
Bindestrich (auch Viertelgeviertstrich) - -
`

`

Command Sample Character
\textendash n/a
\_ _ _
`

But I don't know, if this still holds in the current bibtex, biblatex, biber, ecosystem.
We could test random applications and packages and if we find no complications, then updating those wiki/stackoverflow pages could be good. Or we merge and let users report issues...

@ThiloteE
Copy link
Member

ThiloteE commented Nov 4, 2024

Ah and if you use your citationkey to name your linked files (which is something that JabRef supports), then : is not good on Windows Operating system ...

Example for how people use linked files with citationkeys: https://discourse.jabref.org/t/link-a-directory-to-entries/5261/4

@koppor
Copy link
Member Author

koppor commented Nov 4, 2024

Note that we remove characters not allowed on a file system while generating a file name. Moreover, I saw : only when JabRef issued Problem: somewhere in the code.


We distinguish between un-wanted and forbitten characters:

unwanted: perfeclty legal, but disturbing:

public static final String DEFAULT_UNWANTED_CHARACTERS = "`ʹ!;?^";

forbidden - not working with BibTeX:

 /// Source of disallowed characters: <https://tex.stackexchange.com/a/408548/9075>
 /// These characters are disallowed in BibTeX keys.
 private static final List<Character> DISALLOWED_CHARACTERS = Arrays.asList('{', '}', '(', ')', ',', '=', '\\', '"', '#', '%', '~', '\'');

Public sources use : and / in the key:

Example:

@phdthesis{DBLP:phd/de/Kopp16,
  author       = {Oliver Kopp},
  title        = {Partner{\"{u}}bergreifende Gesch{\"{a}}ftsprozesse und ihre
                  Realisierung in {BPEL}},
  school       = {University of Stuttgart},
  year         = {2016},
  url          = {https://nbn-resolving.org/urn:nbn:de:bsz:93-opus-105304},
  urn          = {urn:nbn:de:bsz:93-opus-105304},
  timestamp    = {Sat, 17 Jul 2021 09:07:39 +0200},
  biburl       = {https://dblp.org/rec/phd/de/Kopp16.bib},
  bibsource    = {dblp computer science bibliography, https://dblp.org}
}

Fun fact: We allow forward-slash. Thus, the discussion on : seems to be odd to be.


I am aiming to make JabRef "knobless" so that it works well in a default-configuration without WTFs. - And I found removing dashes (and somehow also colons) a WTF. I saw these characters often when working with LaTeX and BibTeX.

@Siedlerchr
Copy link
Member

need to think about it why we inlcuded the minus there.

@mlep
Copy link
Contributor

mlep commented Nov 7, 2024

@Siedlerchr Explanation may start from here: #4709

@koppor
Copy link
Member Author

koppor commented Nov 8, 2024

@mlep Thank you for the pointer. I refined the documentation at JabRef/user-documentation#538.

Since we are working towards an alpha and can IMHO experiment, we should give this a "go". @Siedlerchr

Copy link
Contributor

github-actions bot commented Nov 8, 2024

The build for this PR is no longer available. Please visit https://builds.jabref.org/main/ for the latest build.

@koppor koppor added this pull request to the merge queue Nov 10, 2024
Merged via the queue into main with commit d68e7e5 Nov 10, 2024
26 checks passed
@koppor koppor deleted the add-regex-example branch November 10, 2024 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants