Skip to content

Commit 09e2585

Browse files
authored
Add small text on BibTeX handling (#11946)
1 parent 4644e8d commit 09e2585

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

docs/code-howtos/bibtex.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
parent: Code Howtos
3+
---
4+
# JabRef's handling of BibTeX
5+
6+
The main class to handle a single BibTeX entry is `org.jabref.model.entry.BibEntry`.
7+
The content of a `.bib` file is handled in `org.jabref.model.database.BibDatabase`.
8+
Things not written in the `.bib` file, but required for handling are stored in `org.jabref.model.database.BibDatabaseContext`.
9+
For instance, this stores the mode of the library, which can be BibTeX or `biblatex`.
10+
11+
Standard BibTeX fields known to JabRef are modeled in `org.jabref.model.entry.field.StandardField`.
12+
A user-defined field not known to JabRef's code is modelled in `org.jabref.model.entry.field.UnknownField`.
13+
Typically, to get from a String to a `Field`, one needs to use `org.jabref.model.entry.field.FieldFactory#parseField(java.lang.String)`.
14+
15+
## Cross-references
16+
17+
BibTeX allows for referencing other entries by the field `crossref` (`org.jabref.model.entry.field.StandardField#CROSSREF`).
18+
Note that BibTeX and `biblatex` handle this differently.
19+
The method `org.jabref.model.entry.BibEntry#getResolvedFieldOrAlias(org.jabref.model.entry.field.Field, org.jabref.model.database.BibDatabase)` handles this difference.

0 commit comments

Comments
 (0)