BIBTEXTOWORD

CLAUS GERHARDT

Date: May 22, 2012.

Contents

Contents
 1.  Introduction
 2.  Entering cite keys and running BibTeXtoWord
 3.  Requirements
 4.  Installation
 5.  Intel and PowerPC Macintoshes
 6.  Maintaining your data base
 7.  Some Recommendations
 8.  History
 9.  Download Links
 10.  Links

1. Introduction

BibTeXtoWord allows MS Word users to let bibtex handle the bibliographic references in the papers they are writing. For those who are unfamiliar with LATEX and bibtex let me explain how bibtex is used: The bibliographic references are contained in a .bib file which is simply a text file. Each entry in this data base is uniquely identified by a cite-key, which can be arbitrary with the exclusion of a few special characters. When you want to cite a bibliographic reference in LATEX you enter the command \cite{abc} in your file, which is called the source file, where „abc“ is the cite-key. In case you want to add a comment you enter \cite[myComment]{abc}. When bibtex is called, it checks which style file has been chosen, reads the cite-keys, looks up the corresponding references, sorts the references alphabetically and by year, replaces the cite-keys with the corresponding labels and prints a list of references at the end of your document. These changes do not take place in your source file but in the compiled output file which is nowadays a pdf file. References that should be part of the publications list but should not be referred to in the text have to be entered as \nocite{abc} in the source file.

With BibTeXtoWord this structure is mirrored when working with a Word document: There is a source file, which is your normal Word document, but the bibliographic references are entered in the same way as above. The underlying bibliographic style has to be defined in the file „bibliography.tex“ (press the button „open bibliography.tex“ ). The file will be opened in TeXShop and you can choose between two styles „amsplain“, which uses numerical labels, and „amsalpha“, which uses abbreviations of the author’s name and publication year as labels; for details see Section 2.

When BibTeXtoWord is then run by pressing either the button „amsplain“, „amsalpha“ or „apalike“, BibTeXtoWord will create a LATEX file that contains these commands, run bibtex, convert the output in a rtf file with the help of latex2rtf, and will then create and open a copy of your source file where all cite commands have been replaced by the corresponding labels and will finally open a file that contains the formatted list of references. These actions only take a few seconds.

The newly created Word file is named filename-final.docx if your source file has the name filename.docx. You can then copy and paste the formatted references into the new document. Finally you will have to choose a suitably tailored Word format for the items in bibliography.

There are predefined Word formats corresponding to the styles amsplain resp. amsalpha which can be accesssed by pressing the buttons „Word Format amsplain“ resp. „Word Format amsalpha“. The formats are named „bibitem“ resp. „bibitemalpha“, copy them to your globally available formats.

When these formats are globally defined in Word then they will be available in any new filename-final.docx document.

It is best to see an example: example amsplain, example amsalpha, example apalike resp. example apalike with footnotes, where the pdf files show a source file and the corresponding „final“ version. The style „apalike“ is new and its Word format „apalike“ is defined in „Bibliograhy-Test.docx“

The actual style file used is „capalike.sty“, a modified version of „apalike.sty“, such that the emphasized parts agree with those of the style „amsplain“.

2. Entering cite keys and running BibTeXtoWord

Each cite command may contain one or multiple cite-keys, where the cite-keys are separated by a comma without any space before or after a comma like \nocite{a1,...,an} , where the ai  ’s are cite-keys; similarly for the nocite command. I usually place all nocite references at the end of the text in the form \nocite{a1,...,an} .

You may add a comment to a cite command in the usual form

\cite[myComment]{ a1,...,an}

However, in case of multiple items, putting the comment in the text like …in a series of seminal papers \cite{ a1,...,an} seems to be more appropriate.

When BibTeXtoWord is run the source file should be the active document in Word and the corresponding formatted file, if it already exists, should not be open.

The main two buttons in BibTeXtoWord have already been explained, the others are self-explanatory: When the source file should be opened then the formatted file should be the active document and vice versa.

The file bibliography.tex is the tex file that is compiled by bibtex. It can be opened and edited in TeXShop, but those who are not familiar with LATEX should not edit the file except to define the style „amsplain“ resp. „amsalpha“ by commenting resp. uncommenting the corresponding lines—don’t forget to save the file afterwards.

The standard bibtex styles „plain“ resp. „alpha“ are also supported. They look a bit different compared with the AM S variants.

The style „apalike“ uses a different tex file „bibliography-apalike.tex“ which is not supposed to be modified by the user apart from renaming the „.bib“ file. Its default name is „publications“.

Other styles (.bst files) will probably also work, you should make yourself familiar with the possibilities. TeXLive already contains many .bst files. When you want to install a .bst file, that is not part of TeXLive, then it will suffice to copy that file to ~/Library/Bibliograpy.

BibTeXtoWord contains a Scripts menu with two commands „Word“ and „BibDesk“ which will bring the corresponding applications to the foreground. These commands can be called by pressing the keys „w“ resp. „b“ .

See Section 7 for the reciprocal commands in Word resp. BibDesk.

Let me recommend that the names of your Word documents as well as the path (folder names) leading to it should not contain spaces, since spaces have a special meaning in Unix and in TEX . Though I am pretty sure that bibtex and BibTeXtoWord will work properly even when the path contains spaces, since I took the proper precautions when writing the code, I didn’t test it with BibTeXtoWord.

I have to admit that I have no sympathy with those who insist to use paths containing spaces on a Unix machine.

3. Requirements

You need OS 10.5 or better and in addition

1
A TeXLive installation; I recommend TeXLive 2008.
2
TeXShop
3
Flashmode
4
Local Switcher

Flashmode and Local Switcher are part of the BibTeXtoWord download. Google for TeXLive and TeXShop, both can be comfortably installed with the MacTeX package. You should go for the full TeXLive version and not for the crippled basic version.

The latex2rtf shell script, which is also needed, is contained in Flashmode.

All applications will run on PPC or Intel Macs.

4. Installation

Install BibTeXtoWord, Flashmode and Local Switcher in the Applications folder.

Open Flashmode once so that it can place a symbolic link in ~/Library/, thereafter it only has to stay in the Applications folder.

Use Local Switcher to create a symbolic link to the TeXLive folder in /usr/local/. It is a no-brainer, read Local Switcher’s instructions.

In case that latex2rtf has not been installed on your machine the configuration files for latex2rtf will be missing. In this case BibTeXtoWord will ask you if it can install the configuration files in /usr/local/share. If you agree you will have to enter your administrator password during the installation process.

5. Intel and PowerPC Macintoshes

The Intel and PowerPC Macintoshes need different versions of latex2rt. The default version is the one for IntelMacs. If you use a PowerPC you have to click on the menu item BibTeXtoWord/Install latex2rtf ppc to replace the Intel version by the PPC version. Note that Flashmode has to be opened once before that action can take place.

In case you replaced the Intel version erroneously, simply replace the application Flashmode by the original version from the TeXHelpers dmg.

6. Maintaining your data base

For the maintenance of your .bib file I recommend the application BiBDesk which is supposed to be a front end for your bib file and which allows you to browse your data base, look up and export cite keys, import new entries, etc. BiBDesk will automatically be installed by the MacTeX package.

It is recommended that new data should not be entered manually but via copy and paste or with the help of a script. Most libraries offer a bibtex export option so that the result can be copied and pasted into BiBDesk, multiple items can be entered in a single action.

You should read BibDesk’s instructions.

BibTeXtoWord comes with a preconfigured bib file, publications.bib, which contains roughly 75 entries, so that you can get acquainted with it and play with the provided example.

Both the bib file and the example are located in ~/Library/Bibliography/, a folder that BibTeXtoWord will look for whenever it is started, and if it doesn’t find one, a copy will be installed. This folder is essential for BibTeXtoWord to operate properly. Hence, if you have already a folder or file with this name installed in ~/Library/, then you should rename it, since BibTeXtoWord will not overwrite any files or folders.

Let me also emphasize that the bib file should be encoded in UTF-8, then you can enter Umlaute either as non-ascii characters, e.g., like „Hölder“, in your database, but only if you enter the data in BibDesk, since BibDesk saves these data in a form TEX can understand, i.e., as H{\"o}lder; of course you can also enter the name „Hölder“ in that particular form directly in BibDesk.

A title should be enclosed by braces like {A proof of the Riemann hypothesis} otherwise the title will be printed as „A proof of the riemann hypothesis“.

When a bibtex entry is downloaded from an external data base, like a library, this is already taken care of, at least in most cases.

My personal bib file contains over 1500 entries and BibDesk and bibtex run smoothly and fast.

Let me also mention that the default location of the bib file is

~/Library/texmf/bibtex/bib/

with a symbolic link ~/texmf to the texmf folder in your Library, but that it will suffice when the bib file is in ~/Library/Bibliography/ which is the case with the provided publications.bib.

7. Some Recommendations

1
When Word and BibDesk are both open, you can use the keyboard shortcut „cmd-tab“ to switch between both applications. Note however that this command only switches back to the last used application.
2
The folder ~Library/Bibliography has a subfolder „Scripts“ containing three Applescripts „Word“ , „bibtextoword“ and „BibDesk“ with the help of which switches from
∙
BibDesk → Word (Word.scpt)
∙
Word → BibDesk (BibDesk.scpt)
∙
Word → BibTeXtoWord (bibtextoword.scpt)

are possible. Word.scpt has to be copied to the Scripts folder of BibDesk and the other two scripts in the Scripts folder of Word. Read the corresponding instructions in these applications where the respective Scripts folders are located.

In case of BibDesk the path to the folder is

~/Library/Application Support/BibDesk/Scripts/

However, in case of Word I am not sure that the my path is universally valid.

3
Define in System Preferences keyboard shortcuts to call these scripts, cf. the screen shot.
4
Define in System Preferences a keyboard shortcut for BibDesk to copy the cite-keys of selected publications to the clipboard, cf. the screen shot.

8. History

∙
Version 1.10: The code has been modified to accommodate some custom style files.
∙
Version 1.9: The citations may now include comments.
∙
Version 1.8: Added a version of the style „apalike“ where the citations are inserted as footnotes.
∙
Version 1.7: The cite command now may contain multiple items.
∙
Version 1.6: The style „apalike“ has been added.
∙
Version 1.5: A Scripts menu with additional commands has been added.
∙
Version 1.4: Two bibliographic styles „amsplain“ and „amsalpha“ are now supported.
∙
Version 1.3: Different versions of latex2rtf for Intel or PowerPC Macs are provided.
∙
Version 1.2: BibTeXtoWord now checks if the configuration files for latex2rtf are present, and if not, it will ask your permission to install them.
∙
Version 1.1: Code rewritten, it now runs faster. The formatted references appear in a separate window.

9. Download Links

1
BibTeXtoWord, Flashmode and Local Switcher are part of the bundle TEXHelpers.
2
The download information for MacTeX is here MacTeX.

10. Links

Home page, TEXHelpers, TEX Switcher, pdfselect, TEX Scripts, BibTeXtoWord,Books, Preprints, Former Students, Veranstaltungen, Lecture Notes

Ruprecht-Karls-Universität, Institut für Angewandte Mathematik, Im Neuenheimer Feld 294, 69120 Heidelberg, Germany

URL: http://www.math.uni-heidelberg.de/studinfo/gerhardt/