Skip to the content.

Bibweb

Bibweb is a utility for generating HTML bibliographies from BibTeX source files. What it adds over similar tools is the ability to overlay BibTeX entries with additional information. It is quite flexible because it uses TeX-like macros to define all generated output.

Usage

To run Bibweb, it is given a Bibweb script as an argument:

bibweb example.bibweb

A minimal script that generates output from a BibTeX database looks like the following:

pubs: input.bib
generate {
    output: output.html
    section:
}

More involved script examples are included in the Bibweb distribution.

A script may read input from multiple BibTeX databases, and may add additional information to entries it has read. If a database is read using the pubs command, its entries are automatically selected for inclusion in generated output. The bibfile command can be used to read entries with selecting them.

A short summary of available commands is readily available:

bibweb --help

You can also see all the default macro definitions, which can be overridden:

bibweb --defns

Syntax

The script is a sequence of attributes, some of which are recognized as commands. An attribute can be declared on a single line:

bibfile: input.bib

or on multiple lines, delimited by braces.

bibfile {
    input.bib
}

Most attributes work with either syntax.

Top-level commands

At the top level of the script, ordinary attribute definitions simply define new macros or override the definition of existing macros. However, certain top-levels attributes are interpreted as commands.

bibfile

The command bibfile: <filename> reads the specified file and parses it as a BibTeX bibliography file. Entries in the file are not selected for use, however; a subsequent pubs command must be used to choose which entries to use.

pubs

The command pubs: <filename> reads the specified file just like bibfile, but it also selects all entries in the file for use.

In the multiline syntax, pubs is used to select entries from bibliography files that have been read, and to add or modify information about those entries.

  pubs {
    ...<publication>...
  }

The publication list consists of a series of attributes indexed by the key of each publication. Each attribute specified in the value adds to or modifies the information recorded about that publication.

include

The command include: <script> includes another Bibweb script at this point, its contents effectively replacing the include command.

generate

The generate command generates output to a file. The output contains some number of sections, each generated by a section subcommand.

Publication attributes

In addition to the standard attributes defined by BibTeX, Bibweb also treats the topic attribute as standard. It may specify a list of topics. Additional attributes may be freely added.

Output for each publication is generated by the \pubformat macro. All attributes of the current publication are available in the context when this macro is expanded.

Some BibTeX attributes are renamed to avoid collisions. Notably, the attribute url is renamed paperurl.

Generation commands

The following attributes are recognized as subcommands in a generate command.

output

The output attribute specifies the name of the output file. Example:

  output: papers.html

section

The section command specifies how to generate a section of the output, containing some subset of the publications in use.

Publications can be selected based on a variety of attributes

Important macros

The macros supported by Bibweb can be listed by the commands:

  bibweb --defns

\pubformat: This macro describes how to generate output for a single publication.