Copyright © 2011 , Kurt Nørmark |
Please notice that this is still not a complete bibtex parser. We currently support only the most common and most used constructs. The Bibtex presentation functions are not complete either.
The LAML bibtex parser is not very fast. So we envision that the parser is activated every now and then on a bibtex file f.bib, in order to produce the parsed lisp file f.lsp. We recommend that you place an LAML command file together with you bibtex file which does that job. You can read such files using the function read-parsed-bibtex-files.
Usage:
It is possible to parse a bibtex file and get the list bibtex entries represented as association lists. This is done by parse-bibtex-file. The variable parse-result will contain the entries.
As an example, the parser is can be activated by
(parse-bibtex-file "file")where "file" is the file name without the bib extionsion.
Given the existence of a list of bibtex entries represented as a list of association lists bibtex-list, say parse-result, it is possible to HTML present this list by for instance
(present-bibtex-entries parse-result (p))Often it will be useful to extract some subset of a bibtex list. This can, of course, be done be filtering, but the following methods makes it possible to extract a subset given a key-list, for instance via
(bibtex-entries key-list bibtex-list warn-if-non-existing-entry)The keylist itself can be produced from a bibtext-list via the following call:
(key-list-matching "normark" bibtex-list)
Besides the general library, this library requires the collect-skip parsing library (not loaded by bibtex). The presentation part also assumes that the HTML mirrors are loaded.
There exists a function called bibtex in laml.scm which activates the bibtex parser, and which in addition presents the bibtex entries in HTML via LAML. The bibtex function should be activated in an interactive LAML session (from a Scheme prompt with LAML loaded).
This tool can be used together with the HTML4.01 and XHTML validating mirrors.
bibtex-entries | (bibtex-entries key-list bibtex-list non-existing-key) | Return a subset of bibtex-list, as ennumerated by key-list (a list of key strings), and in the order given by key-list. |
bibtex-entry-leq-by-time? | (bibtex-entry-leq-by-time? entry-1 entry-2) | A less than or equal predicate on parsed bibtex entries (association lists). |
bibtex-verbose | bibtex-verbose | A variable that controls whether bibtex-parse-file emits messages to standard output while parsing. |
get-bibtex-entry | (get-bibtex-entry key bibtex-list) | Access and return a bibtex entry (an association list) from bibtex-list (a parsed bibtex list). |
get-bibtex-field | (get-bibtex-field key entry . optional-parameters) | Get the field with key from the parsed bibtex entry. |
ignore-non-existing-entry | (ignore-non-existing-entry key) | A possible non-existing-key function to bibtex-entries. |
key-list-matching | (key-list-matching key-part bibtex-list) | Return a list of keys (string) which match partially or fully a key in bibtex-list. |
parse-bibtex-file | (parse-bibtex-file file) | Parses a bibtex file file.bib and delivers the parsed result on file.lsp. |
parse-result | parse-result | The result of bibtex-parsed can be accessed via the variable parse-result. |
present-bibtex-entries | (present-bibtex-entries entries sep) | Present a list of bibtex entries speparated by sep (a string). |
present-bibtex-entry | (present-bibtex-entry entry [trailing-presentation]) | The overall top-level function that presents a single bibtex entry. |
present-links-from-title? | present-links-from-title? | A boolean variable that controls if a link is to be generated from the title of a biblographic item. |
read-parsed-bibtex-file | (read-parsed-bibtex-file file) | Read and return the parsed entries of the bibtex file file, which is a full path without the trailing lsp extension. |
read-parsed-bibtex-files | (read-parsed-bibtex-files . file-list) | Read and return an appended list of parsed bibtex files. |
stop-if-non-existing-entry | (stop-if-non-existing-entry key) | A possible non-existing-key function to bibtex-entries. |
warn-if-non-existing-entry | (warn-if-non-existing-entry key) | A possible non-existing-key function to bibtex-entries. |