Closed Processeer closed 1 year ago
Thank you for reporting this!
The tricky thing is that the character \
is used as LaTeX command prefix. Moreover, it is used as escape character if one wants to have a closing brace literally in BibTeX. Example:
@misc{test,
comment={The set \{\} denotes the empty set, too},
}
In your context, this surely makes no sence to interpret the backslash as escaping character. I am working on an improved parser.
Workaround: Until there is a fix, please replace \},
by },
in your BibTeX code.
Other thing, I never saw library
in BibTeX. @Processeer Is this the way your institution puts the file path into a BibTeX entry? (This somehow refs https://github.com/JabRef/jabref/issues/98).
JabRef itself offers another sophisticated method to denote file directories: https://docs.jabref.org/finding-sorting-and-cleaning-entries/filelinks#directories-for-files. @Processeer
Code comment: This is caused by https://github.com/JabRef/jabref/blob/92aee56bc801d502154bd84e69a7cdc06ab36bb4/src/main/java/org/jabref/logic/importer/fileformat/BibtexParser.java#L285. I wonder why the parser result is not displayed to the user. Think, we need to work on that (if JabRef reads a file from disk). Could be more complicated though.
Note that JabRef "simply" removed all entries following the inserted ones.
Example:
@Article{,
author = {test\},
journal = {Sci China Inf Sci},
title = {a\b\c\},
year = {2022},
month = sep,
annote = {lala},
fjournal = {IEEE Transactions on Medical Imaging},
}
@Article{ostgaard2002,
title = {energy},
month = sep,
year = {2012},
}
ostgaard2002
was also removed, because the closing brace of the first entry was not parsed "as intended" and thus the next @Article
was treated as belonging to the first article.
Maybe, we need to refine our parsing logic to "terminate" parsing the current entry and start parsing a new entry if @Article
or a similar token is found.
... we used this field exactly for this reason. The challenge was to be able to sort the files according to its "library" in a specific folder or subfolder on the hard drive. The library dependent folder does not work in this Case because we use only one Bib.
It works really nice until you copy the specific subfolder from Windows Explorer into the field. Then you get the backslashes automatically.
Thats the way it hapened.
I know, it might be a little far of the normal usage. I just wanted to report this behaviour. I know whats behind it now, so you can decide If its important enough to be tackled.
Am 17.03.2023 um 08:26 schrieb Oliver Kopp:
Other thing, I never saw |library| in BibTeX. @Processeer https://github.com/Processeer Is this the way your institution puts the file path into a BibTeX entry? (This somehow refs #98 https://github.com/JabRef/jabref/issues/98).
JabRef itself offers another sophisticated method to denote file directories: https://docs.jabref.org/finding-sorting-and-cleaning-entries/filelinks#directories-for-files. @Processeer https://github.com/Processeer
— Reply to this email directly, view it on GitHub https://github.com/JabRef/jabref/issues/9668#issuecomment-1473290721, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6OZQPFAZASX5KOR5SHJLHTW4QG3DANCNFSM6AAAAAAVZIBRLI. You are receiving this because you were mentioned.Message ID: @.***>
... we used this field exactly for this reason. The challenge was to be able to sort the files according to its "library" in a specific folder or subfolder on the hard drive.
JabRef offers the grouping feature. They can be hierarchical, too. I think, there should be work done to have groups synchronized with the file directories. I opened an issue at https://github.com/koppor/jabref/issues/638 to refine the requirements. Please comment there if you have more ideas.
Thats the way it hapened. I know, it might be a little far of the normal usage. I just wanted to report this behaviour.
We really thank you for this, because you surely are not the first one hitting that behavior - and would not have been the last one.
I know whats behind it now, so you can decide If its important enough to be tackled.
We already tackled it at https://github.com/JabRef/jabref/pull/9677. The build at https://builds.jabref.org/main/ contains the fix and should work.
@koppor with File Directory Pattern you can also use the group field
Since this is fixed in main
, I close this issue. Plrease reopen if the issue still persists.
JabRef version
5.9 (latest release)
Operating system
Windows
Details on version and operating system
Windows 11 Pro - 22H2
Checked with the latest development build
Steps to reproduce the behaviour
It took me a wile to check that the backslashes lead to this automatik removal of the entire entry. I would expect an error message or an automatic reeplacement into slashes.
Appendix