Bibtex4Word - User Guide


Contents: Quick Start - Citing References - BibTeX Styles = Installing New Styles = Sort Order = Style Flags = Paragraph Formatting - Setting Defaults - Saving A Database


Quick Start

  1. Prepare a bibtex database file containing your references using JabRef or another reference manager.
  2. Open the document in Word that you want to add citations to.
  3. Press  and navigate to your bibtex database file.
  4. To add a citation, position the cursor at the appropriate place in your document and press . In the dialogue box that appears type one or more BibTeX keys separated by commas. Alternatively, you can right-click an entry in JabRef, select "Copy Bibtex key" and then paste it into the dialogue box. As the bibliography does not yet exist, the citation will be displayed as "[<bibtexkey>]"; this will be updated in the next step.
  5. Position the cursor where you would like your bibliography to be (usually at the end of your document but definitely not adjacent to a citation)  and press  to create it.

Citing References

To cite a reference, position the cursor at the appropriate place in the text and press . You can now type one or more BibTeX keys separated by commas. Initially, the citation will be displayed as its BibTeX key, but this will change to the citation label when you press  to create the bibliography. You can display the BibTeX keys at any time by pressing the  button.

Non-citing entries

If you precede a Bibtex key with "/" then the reference will be included in the bibliography but not cited in the text. If all the citations in a list are non-citing then the surrounding brackets will be omitted and the string will be invisible unless the button is pressed.

Searching for references

Bibtex4Word includes a primitive search facility which allows you to find entries in the BibTeX database that contain specific words. Searches begin with a @ or else x@ where x is one of a, b, t or j. The BibTeX entries found by some example searches are shown in the table below. If only a small number of matches are found, they will be listed explicitly for you to select, if a large number are found you will be asked to confirm that you want to include them all.

Search String BibTeX entries found
@ Smith Hot All entries containing both Smith and Hot in any order.
Searching is case insensitive and not restricted to whole words so Hot, hot and HOT are all equivalent and schott will also be found.
a@ Smith All entries with Smith in the author field
a@ Smith t@ Hot All entries with Smith in the author field and Hot in the title.
t@ Hot Cold a@ Smith All entries with Smith in the author field and Hot in the title and Cold in the title. Thus a field specifier a@ or t@ remains in force until another field specifier is encountered.
b@ Hot @ Cold All entries with Hot in the booktitle and Cold in any field.

Bibligraphy Style

The formatting of the bibliography and the way in which citations are indicated in the text of your document are controlled by two things: (a) your choice of BibTeX style and (b) your selection of style flags: these are explained in detail below.

Recommended style settings

The following three settings are the ones I use most often. They are written in the form "style/flags" where the flags are specific to Bibtex4Word and affect how the citations and bibliography appear. You will probably have to install the styles into MikTeX before you can use them (see below).

abbrvnat/ndusch
is a good general purpose numeric style with labels of the form [1]. I like it because it includes DOI references which I find useful. The "n" flag forces numeric labels, the "du" flags mean that DOI and URL links will be turned into hyperlinks, the "sc" flags mean that where multiple documents are cited at the same place in the text, their numeric references will be sorted and compressed (e.g. [5-9] instead of [5,6,7,8,9]) and, finally, the "h" flag means that each citation in the text is a hyperlink to the appropriate point in the bibliography. The style abbrvnat may be replaced by plainnat in order to show the full first names of authors instead of just their initials or by unsrtnat which, as well as showing full first names, lists the bibliography in the order references are cited in the text instead of sorting it alphabetically by author.
IEEEtranSA/ush
creates short mnemonics for the labels of the form [ABC01] which indicates the initial letters of the authors' surnames and the last two digits of the publication year. I like these because they are compact but yet remind me of the paper being cited. Unfortunately, this style does not support DOI fields although URL fields appear as hyperlinks. As in the previous example, the "sh" flags mean that multiple citations are sorted into the correct order and that each citation in the text is a hyperlink to the appropriate point in the bibliography. Substituting alpha for IEEEtranSA gives a slightly less verbose bibliography entry.
agsm/(l2ysh
is an example of the "Harvard" bibliography style with citations of the form (Smith et al. 2001); this style is widely used in medicine and other sciences. Here the flag "(" specifies the use of parentheses rather than square brackets, the "l" flag supresses the label from appearing in the bibliography and the "2y" flag determines the date format (i.e. follow the author's name by a space and then the year of publication). With this style, long author lists will be abbreviated in the text as "et al." but you can force the inclusion of all the author names by specifying the "a" flag in addition. This style displays URL fields but cannot turn them into hyperlinks: if DOI/URL hyperlinks are important to you, you can use plainnat/(l2ydush but I think the bibliography formatting is a bit less pretty.

BibTeX Style

The formatting of the bibliography and the way in which citations are indicated in the text of your document are controlled by the "bibtex style". Thus, for example the same citation in styles "IEEEtran" and "alpha" would appear in the bibliography as:

where the differences include the use of first names, the quoting of the title and the way in which the volume and issue numbers are shown. The initial portion of the entry, enclosed in [...] is the "label" and will appear in the text whenever the reference is cited. Most styles have numeric labels as with the first example above while a few, known as alpha styles, have labels constructed from the authors' names and the year of publication as in the second example; this provides a useful mnemonic in the text. Some disciplines prefer "Harvard" styles which include the author's name and publication year in the citation.

To choose the style, press the button and then type in the name of the style you want to use. There are several hundred different styles available in MiKTeX and it can be difficult to choose between them. A good guide is available from Reed College and an extensive list has been put together by Ken Turner. Most journals have their own ready-made style which formats the references exactly as their editors' prefer.

The Bibtex4Word package includes a Word document "StyleTable.doc" which lists a number of Bibtex styles. By following the instructions in this document you can create your own style table that includes any styles you wish.

Installing New Styles

Only a few styles are initially installed in MiKTeX, so if you want a specific style, you will have to install it first as follows:

  1. Open the MiKTeX package manager (Programs->MiKTeX x.y->Browse Packages)
  2. Type "xxx.bst" in the "Filename:" box where "xxx" is the style you want to install and click "Filter".
  3. If the package has not yet been installed, the column headed "Installed on" will be blank; right click the package and select "Install".
  4. You may need to change the server from which to download by selecting Repository->Change Repository: select "Packages shall be installed from the Internet", click "next" and then select a server from a nearby country.

You can set MikTeX so that any missing style files will be installed automatically as required. This sounds like a good idea, but I do not recommend it for two reasons: (a) BibTex4Word will appear to freeze while the new style is installed with no explanation of what is going on and (b) if the server that you have chosen is broken, which happens quite often, BibTeX4Word will freeze forever.

Sort Order

One of the ways in which styles differ is the order in which the cited references are listed in the bibliography. References may be ordered by any combination of: A=author, C=citation order within your document, D=publication date, K=BibTeX key, L=citation label used within the text of your document and T=document title. The priority order of these criteria used for some common styles is given below:

AC

plainnat, abbrvnat

ADC

jbact

ADTC

aaai-named, abbrv, acm, agsm, amsplain, annotation, apa, chicago, IEEEtrans, is-abbrv, is-plain, named, phrmp, plain, siam [and many more]

C

IEEEtran, is-unsrt, nar, nature, phjcp, unsrt, unsrtnat

DATC

plainyr

K

abstract

LDATC

alpha, annotate, IEEtranSA

The Bibtex4Word package includes a Word document "SortOrder.doc" which allows you to determine the bibliography sort order for any Bibtex styles. Instructions for doing so are included in the document itself.

Style Flags

The selected style can be modified by the inclusion of one or more style flags following the bibtex style e.g. BIBSTYLE=alpha/n. You can have as many style flags as you want following the "/" character. The table below lists the available style flags; some flags are preceded by an optional integer, n, whose meaning is explained in the table; if n is omitted it is taken to equal 1 unless otherwise specified. Specific styles to which an option applies are shown in brackets.

The following flags affect how references appear in the bibliography:

a

Use full instead of abbreviated author names in label [chicago, named, plainnat, agsm]

d

Convert DOI references into hyperlinks [plainnat]

nf

Insert a line feed in the bibliography after any label that is more than n characters long.

l [lower case "L"] Omit the labels from the bibliography entries (normally needed for Harvard style bibliographies). If this option appears not to work, you may need to turn off "hidden text"; to turn off hidden text select Tools>>Options>>View (Word 2003) of Office-Button>>Word-Options>>Display (Word 2007) and make sure that both "Hidden Text" and "All" are unchecked.
nm n gives number of cross-references (instead of the normal 2) needed to trigger insertion of the parent entry into the bibliography  [default n=999].

n

Force the reference list to be numbered even if the bibtex style normally uses labels based on author names.

nu

Convert URLs into hyperlinks [plainnat, ieeetran]
n is the sum of the following options: 1=convert to hyperlinks [default], 2=do not insert discretionary hyphens after each "/" character, 4=replace the url with the text "<url>"

]

Omit the square brackets from the bibliography label.

)

Use parentheses instead of square brackets in the bibliography.

.

Omit the square brackets from the bibliography and follow the label with a "." instead.

n~

Put n non-breaking spaces after the bibliography label in place of a tab.

n& Select the form of "and" in the author list for harvard styles [agsm]. 0 = "&" [default], 1="and", 2="et", 3="en", 4="und".

The following flags affect how references are cited in the text of the document:

c

Compress cited references by writing [1-4] instead of [1, 2, 3, 4]. Normally used in combination with the s option.

h

Make the citations into clickable hyperlinks that take you to the corresponding entry in the bibliography. To return to the text type "Alt+Left Arrow" or use the back button on the "Web" toolbar if it is displayed.

s

Sort the references in a citation list thereby writing [1,2,3,4] instead of [2,4,1,3]. Often used in combination with the c option.

ny year formatting in the label [chicago, named, plainnat, agsm]
n: 0="Smith (2000)"; "1=Smith"; 2="Smith 2000"; 3="Smith, 2000"; 4="(2000)"; 5="2000"

[

Omit the square brackets surrounding the citation.

(

Use parentheses instead of square brackets to surround the citation.

^

Write citation list as superscript like this1,2,3.

,

Omit spaces after commas in the citation list e.g [1,2,3] rather than [1, 2, 3]

;

Use semicolons instead of commas in the citation list.

The following flags affect the system operation:

b Instead of scanning the citations in the document, use an existing file in the same folder as the document with name ****.bbl where **** is the name of the document.
np Set the code page of the bibtex database. If no p flag is given, the ANSI code page of your system locale will be used. If n is omitted, it is taken to be 65001 which corresponds to UTF8 encoding.
nt Create a style table. The last table in the document is assumed to contain a list of styles in the first column; the formatted output will be placed in the last column. The first n lines are assumed to contain header information. If the style in the first column omits either the style name or the style flags, then the corresponding values will be taken from the main style specification.

nz

n is the sum of any combination of: 1=allow undo to reverse changes made to a bibliography (this may result in "insufficient memory" warnings"); 2=always save bibtex database filename as a full path (the default is to save it as a relative path if it is in or below the folder containing your word document)

n# Indicate special features of the bibtex style; n is the sum of any combination of: 1=bibitem entries use the natbib format; 2=citeauthoryear command uses the chicago format.
The default value depends on the bibtex style selected: 0 for most syles, 1 for abbrvnat, elsarticle-harv, plainnat, unsrtnat; 2 for chicago.
+ Use bibtex8, the extended version of bibtex instead of the normal version. This flag will be ignored if the BIBEXE environment variable is set.

  There are some special "style commands" which can be entered instead of a style.

//b

Open the BibTeX database. The style is not changed.

//t

Use notepad to open the four temporary files that BibTex4Word uses. These files contain useful information if it becomes necessary to figure out why something is not working. The style is not changed. The files are
(a) bibtex4word.aux, a list of the citations found in the document,
(b) bibtex4word.blg, a list of error and status messages from BibTeX,
(c) bibtex4word.log, a list of error and status messages from BibTex4Word and
(d) bibtex4word.bbl, the contents of the bibliography in LaTeX format which BibTex4Word converts into Word and writes to your document.

Paragraph Formatting

To select the character and paragraph formatting of the bibliography, select the entire first entry (conveniently by double-clicking in the left margin) and apply whatever formatting you wish. Click on  again to rewrite the entire bibliography in your chosen format. It is often convenient to include a hanging indent in the format; Bibtex4Word will, by default, put a Tab character after printing the label.

Setting a Default Database and Style

Default Style and BibTeX Database

If you always use the same BibTeX database and the same style, it is annoying to have to define them afresh for each new document. You can define the default values for these as environment variables.

BIBFILE
Defines the default bibtex database (e.g. BIBFILE=C:\data\file.bib)
BIBSTYLE
Defines the default bibtex style, style flags and "magic" characters (e.g. BIBSTYLE=plainnat/ndu @/). The "magic" characters are discussed elsewhere; you will not normally need to change them.
BIBEXE
Defines the bibtex executable program (e.g. BIBEXE=C:\Program Files\MiKTeX 2.8\miktex\bin\bibtex.exe). Setting this environment variable overrides the "+" style flag and is only necessary if you have problems with the call to BibTeX.
BIBTEMP
Defines the folder that Bibtex4Word will use for temporary file (e.g. BIBTEMP=C:\xxx\dirname). It is only necessary to set this explicitly if, for some reason, you don't have a writable system temporary folder defined already.

To define any or all of these environment variables, do the following:

Windows XP: Start>>Settings>>Control Panel>> System>>Advanced>>Enviromental Variables>>User Variables>>New
Windows Vista: ??
Windows 7: Start>>Control Panel>>System and Secutiry>>System>>Advanced System Settings>>Environment Variables>>User Variables>>New

You can shortcircuit several of these steps by right-clicking "My Computer" on the desktop and selecting "Properties".

Default Paragraph Formatting

Default formatting of the bibliography (font, font size, intenting etc) can be specified by creating a "Word Style"; this is nothing whatsoever to do with a BibTeX style. You can define a default Word Style called Bibtex (Windows XP: Format>Styles and Formatting>New Style) with the style features of your choice. You can define different formatting for different BibTeX styles by defining Bibtex plain, Bibtex alpha etc where the BibTeX style name is separated from the word Bibtex by a space.

Creating a BibTeX database for the document

If you click , you can create a small BibTeX database containing only the references that are cited in your document. This is useful if you want to send your document to someone else to edit. For obscure Microsoft reasons (or my incompetence as a Visual Basic programmer), the file dialog box has to use one of the standard Word file extensions (I have chosen .MHT) but the file will nevertheless be saved with the correct .BIB extension. A side-effect of this is that you will not be able to see whether or not the file you specify exists already. You will however be warned before overwriting an existing file.


This page is part of the Bibtex4Word documentation. Copyright © 2006-2013 Mike Brookes, Imperial College, London, UK. See the file gfl.html for copying instructions. Please send any comments or suggestions to "mike.brookes" at "imperial.ac.uk".
Updated: $Id: b4w_using.html 2855 2013-03-28 17:18:47Z dmb $