Contents: Magic Characters - Bookmarks - Encoding BibTeX Keys - Citation Entries - Environment Variables - Document Properties - Toolbar - Debugging
Bibtex4Word uses two magic characters: "@" for searching and "/" to indicate style flags. You can change these to any two non-alphanumeric characters by listing them after the default style in the BIBSTYLE environment variable, e.g. BIBSTYLE=alpha$n :$. Note that, as in this example, changing the "/" character has an immediate effect and you must use the new character if you specify any default flags in BIBSTYLE. If you change the characters you should avoid characters that appear within BibTeX style names or BibTeX keys in your database.
For each entry in the bibliography, two bookmarks are created: BIB_xxxx and B4B_xxxx where xxxx is the bibtex key name (encoded as described below). The first of these bookmarks refers to the label of the bibliography entry excluding any enclosing brackets; the second bookmark just refers to the start of the label without including its text.
The bookmarks corresponding to a particular publication are of the form BIB_xxxx and B4B_xxxx where xxxx is normally the bibtex key name. However, if the bibtex key contains any non-alphanumeric characters, these are encoded as _hh where hh is the corresponding hexadecimal character code. This ensures that the bookmark names contain only legal characters.
A normal citation entry consists of a sequence of bookmark references of the form BIB_xxxx separated by commas and enclosed in square brackets. Non-citing references are always at the start of the list and use the alternate bookmarks B4B_xxxx which do not include the label text and are therefore invisible. If the "compress" style flag, , is selected, the intermediate values in a compressed sequence also use this alternate form.
You can define the default behaviour of Bibtex4Word by specifying some or all of the following environment variables. To do so, use Start>>Settings>>Control Panel>> System>>Advanced>>Enviromental Variables>>User Variables>>New.
Document-specific information is stored within the word document as custom properties and can be seen by selecting File>>Properties>> Custom.
BIBFILE Defines the bibtex database (e.g. BIBFILE=C:\data\file.bib) BIBSTYLE Defines the default bibtex style and style flags (e.g. BIBSTYLE=plainnat/ndu). The magic characters are computer-specific and are never stored in the Word document. BIBDISP Has the value ref or key according to the display mode selected by the button.
![]() |
Insert one or more comma-separated citations. Search the database using keywords. |
![]() |
The first time you press this, a bibliography is inserted at the cursor position. Subsequently, pressing this button will update the bibliography regardless of where the cursor is. |
![]() |
Toggles the display of citations within the text between their labels (e.g. [1], [2] etc) and their BibTex keys. When the file is printed (or whenever fields are updated) then the entries will revert to their labels. |
![]() |
Allows you to select the bibtex style in the form
style/flags that should be used to generate the bibliography. The style name
is not case sensitive. Special style entries: |
![]() |
Allows you to select the BibTex database that should be searched for references. At present you are not allowed to use multiple databases. |
![]() |
Creates a new BibTex database file containing only the entries that are cited in the current document. |
Although installing Bibtex4word.dot into the STARTUP folder (step 5 of the installation procedure above) is convenient, it makes the code invisible and impossible to debug. If you want access to the code, you need instead to install into your templates folder and using it as a template for a new document. You can find or change this folder by starting Word and selecting: [Word 2003]:Tools>Options>File Locations or [Word 2007]:Office Button>Word Options>Advanced>File Locations (at bottom of page).
BibTex4Word creates four temporary files in the folder defined by the TEMP environment variable (typically F:\Documents and Settings\*\Local Settings\Temp). If Bibtex4Word does not function as you expect, inspecting these files is the best way to find out why. The easiest way to view the files is to enter the special style “/t” which will open the four files using notepad. The files have the following fixed names and will be overwritten each time the bibliography is updated: