JabRef / jabref

Graphical Java application for managing BibTeX and biblatex (.bib) databases
https://devdocs.jabref.org
MIT License
3.49k stars 2.45k forks source link

Citation key generator and Linked files #11368

Open NeymanDmitry opened 1 month ago

NeymanDmitry commented 1 month ago

A tabular construct similar to "Key patterns" is sometimes required for "Linked files (Filename format pattern)".

Some examples:

1) Book file names are not always long enough and can be fully described in the "title" including also the date and first author:

2024_Medium-length_booktitle (author's_last_name)

2) When considering a “PhD thesis” since titles can be quite long, you can limit yourself to the first few words of the “title” and add a note that this is a [PhD thesis], like here:

2024_A_few_words_from_thetitle..._[PhDthesis](author's_last_name)


For the examples discussed above, it is necessary to change the “Filename format pattern” pattern each time, although there is no such problem for “Key patterns” due to the tabular design.

Siedlerchr commented 1 month ago

Thanks for the suggestion, indeed: Just adding some context for others who want to work on this:

Preferences -> Linked Files currently looks like this:

grafik

It should have a similar UI: grafik

Code hints:

Create new Preferences, similar to CitationKeyPatternPreferences with a list of Patterns. Take a look at. AbstractCitationKeyPatterns FileUtil.createFileNameFromPattern - Current method for generating the filename based on a pattern. HInt, create a method simliar to the citattion key generat to get the pattern: CitationKeyPattern citationKeyPattern = citeKeyPattern.getValue(entryType);