From 09e25858e203450255f9e8d4cc19504b7ab5b474 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Sun, 13 Oct 2024 18:59:35 +0200 Subject: [PATCH] Add small text on BibTeX handling (#11946) --- docs/code-howtos/bibtex.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 docs/code-howtos/bibtex.md diff --git a/docs/code-howtos/bibtex.md b/docs/code-howtos/bibtex.md new file mode 100644 index 00000000000..1ab3f3e7a73 --- /dev/null +++ b/docs/code-howtos/bibtex.md @@ -0,0 +1,19 @@ +--- +parent: Code Howtos +--- +# JabRef's handling of BibTeX + +The main class to handle a single BibTeX entry is `org.jabref.model.entry.BibEntry`. +The content of a `.bib` file is handled in `org.jabref.model.database.BibDatabase`. +Things not written in the `.bib` file, but required for handling are stored in `org.jabref.model.database.BibDatabaseContext`. +For instance, this stores the mode of the library, which can be BibTeX or `biblatex`. + +Standard BibTeX fields known to JabRef are modeled in `org.jabref.model.entry.field.StandardField`. +A user-defined field not known to JabRef's code is modelled in `org.jabref.model.entry.field.UnknownField`. +Typically, to get from a String to a `Field`, one needs to use `org.jabref.model.entry.field.FieldFactory#parseField(java.lang.String)`. + +## Cross-references + +BibTeX allows for referencing other entries by the field `crossref` (`org.jabref.model.entry.field.StandardField#CROSSREF`). +Note that BibTeX and `biblatex` handle this differently. +The method `org.jabref.model.entry.BibEntry#getResolvedFieldOrAlias(org.jabref.model.entry.field.Field, org.jabref.model.database.BibDatabase)` handles this difference.