JabRef / jabref

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

Enable shortcut access path for main file directory in linked files setting #9681

Open ehehela opened 1 year ago

ehehela commented 1 year ago

Here is a suggestion to support shortcut access path for main file directory in linked file setting. For example, we can use %homepath%\MAIN or %OneDrive%\MAIN for convenience, see figure below.

无标题

ThiloteE commented 1 year ago

% is a special character in TeX based typesetting systems, which is greatly supported by JabRef. Since JabRef stores the path to the file in the fiel field of the library (.bib file), any % would need to be escaped (like this: \%) to keep compatibility with TeX.

So, if this proposal were to be implemented, then at the very least in the actual .bib file, it probably would have to look something like this:

Also, i am not sure if using % as a form to denote shortcut paths is compatible with all Operating Systems. I know it can be used in Windows, but not sure about LInux and MacOS.

I know in Linux, the home directory can be replaced with ~

ehehela commented 1 year ago

@ThiloteE Thanks for your idea. The input box of main file directory cannot accept percent sign, but the general file directory in library properties can. So, I wrote %OneDrive%\Main in this input box, but Jabref did not put \ before % in .bib file. I have also tried to manually add \ in .bib file. However, Jabref automatically removed \ once it starts up. (See figure below) 屏幕截图 2023-03-18 184002

Luckily, I found another solution to locate main file in different PC. I use User-specific file directory rather than %OneDrive%\Main.