Did you know ... Search Documentation:
Pack bibtex -- prolog/bibtex.pl
PublicShow source

Predicates that works on a whole BibTeX file. For example, return a particular entry, search for an author's entries or parse the file completely.

Useful compound terms

  • entry/3 is used as a BibTeX entry (a "@" entry in the file). entry(+Name: term, +Label: string, FieldList: list) where FieldList are field/2 terms.
  • field/2 is used as a fields key-value from a BibTeX entry. field(+Key: atom, Value: String). @author Gimenez, Christian @license GPLv3
 bibtex_file(+Path:term, -LstEntries:list)
Parse a whole file and retrieve its entries.

This is a slower predicate because it reads all the file into string codes. For bigger files use nth_bibtex_file/3.

 nth_bibtex_file(+Path:term, +Number:int, -Entry:term) is det
Search the nth arroba character and read that entry. This method is faster than parsing the whole file and retrieve then nth element of the list.
Number- An integer where 1 is the first entry. @return false if there's no nth entry or file couldn't be readed.
 bibtex_author(+File:term, +Author:string, -BibEntries:list)
Search in the BibTeX file all BibTeX entries related to the given author.
File- the filename.
Author- a string with the author name or surname word (just a word!).
BibEntries- a list of entry/3.
 bibtex_get_entries(+Path:term, +Lst_keys:list, -Lst_entries:list) is det
Search for the given BibTeX keys in the file and return their parsed entries.

Simmilar to nth_bibtex_file/3, walk through the file jumping from entry to entry and checking each one if its key is in the list. If the file is large, this is supposed to save more RAM memory than using bibtex_file/2.

Path- The filename path.
Lst_keys- A list of strings with the keys to search on the file.
Lst_entries- A list of entry/3 terms.