Dear Friends who want to prepare LaTeX documents:

Since I notice regular LaTeX entries in the Political Methodologist,
perhaps some of you will find this of interest.

I am strongly recommending to all my friends that they prepare LaTeX
documents with LyX. LyX is a GUI document preparation program (http://www.lyx.org). It works great,
rather like a "word processor,"
and the author's productivity (at least mine) is increased several fold
by using LyX as opposed to writing directly into LaTeX, especially
where mathematics is concerned. (See example pdf output on http://lark.cc.ku.edu/~pauljohn/stats). I run LyX in Linux, but I have tested the Windows native version and it runs well enough, and there are plenty of Mac users in the LyX email list, so I imagine it is OK there too. There are great free LaTeX distributions for all system. On Windows, the MikTeX distribution is fine and easy to install and maintain. Basically, if your platform supports the GNU compilers and the qt programming library, LyX can be compiled. Most importantly, this is free, open source software, so if you invest the time in learning about it, you will never be pressured to buy an upgrade.

Recently, I worked really hard on bibliography style in LyX and LaTeX. I have learned how to produce the biblio styles of AJPS, APSR, and so forth. Before I forget, I'm trying to write this all down and I'm sharing to you with the hope that, when I forget, you will have a copy of this note for me :) The most difficult thing is that there are several competing methods, various packaages and programs have fallen into disuse and disrepair, but nobody stops to tell the clueless user (raise your hand please) that he/she is barking up the wrong outdated tree. So, to make it simple, I'm saying this to you. Use LyX. Use natbib extensions, and learn to prepare the style file (*.bst) to customize your output. Do not bother trying to write native bibtex configuration files. Do not bother trying to customize bibliography formats in other traditions.

In the end, I used a program package "custom-bib" and it produces a biblio style file that works within the natbib framework. natbib is the most modern extension of bibtex and it is most easy to integrate with LyX. In LyX, there's just one button to click and then the power of natbib is instantly available. If instead one uses the pa.bst file circulated on the Political Methodology web site, one cannot use natbib. pa.bst relies on the harvard style package, so one must track down the (increasingly antiquated) harvard.sty file, which is surprisingly difficult to find. The links to the 2.0.6 edition are dead on the author's web page, and one has to wonder why harvard.sty on CTAN (the comprehensive TeX archive network) has not been updated since 1993. Inside LyX, the natbib framework is much much nicer because it gives the author control of the final presentation of citations inside the text. One controls whether the citation appears as (Jones, 1987) or Jones (1987) or Jones (1977, p. 55).

How to do this? Try out LyX, see if you think it is fun. If you can find somebody who has LyX already, they will probably be glad to let you try it out. On Linux,the installation is extremely easy. On Windows, it might take an hour or two, but there is an intricate step-by-step installation guide. It takes a while because one must install LaTex, which can be large-ish.

To make the biblio work, you need a bibliography style file (a file with a name like apsa2.bst). You need to copy the bst file you want into your LaTeX installation. I use TeTeX, which has been distributed with RedHat & Fedora Linux as long as I can remember. The bst file can be copied under your system's bibtex configuration, which in my system is

/usr/share/texmf/bibtex/bst/natbib

The shortcoming with that is that you might lose your customizations if you upgrade your TeX installation. To prevent that, I maintain a parallel customized directory here:

/usr/local/share/texmf/bibtex/bst/natbib

Assuming that your TeTeX is configured in the normal way, when you run the command

> texhash

the system will scan all of the configuration files and it will notice you have added a bst file. If you want to see your configuration, look at this file /usr/share/texmf/web2c/texmf.cnf . That one has variables

TEXMFMAIN = /usr/share/texmf
HOMETEXMF =$HOME/texmf
TEXMFLOCAL = /usr/local/share/texmf
TEXMF ={$HOMETEXMF,!!$TEXMFLOCAL,!!$TEXMFMAIN}

So that when you run texhash, it scans through the tex config in your home directory, in /usr/local/share/texmf, and also in /usr/share/texmf.

I have prepared 2 files to support this exercise. They are posted on http://www.ku.edu/~pauljohn/latex.

One is an example bst file (apsr2.bst) that I **believe** gives correct formatting for the American Political Science Review. Drop that into your natbib directory, run texhash.

Then start LyX, and:

1. In Layout / Bibliography, tell it to use natbib with author-year style.

2. In your document, use the LyX menu to insert references where you want them. Do
Insert / Citation Reference.

A list of all items in your bib file will pop up. Choose some. It is all very pointy clicky.

3. In your document, when you want to insert the references, click on
Insert / Lists&TOC / Bibtex References. In there, you tell it the name of your reference collection, a bib file (a BibTeX bibliography file).

4. Only the citations that you refer to in your text will be included in your reference list. If you just want to dump out all references, do this right before your bibliography list was inserted in the text. Hit the TeX button to insert ERT (evil red text!) and type
\nocite{*}
That means print all references.

When you view your doc, you will see this all works.

There is also a way to force citations into LyX from various graphical bibliographic editors. Apparently, the endnote crowd in MS Windows likes that idea, but I've never seen much value in it.The insertion relies on a pipe between the two running programs that is described in the documentation.

The second file I attached is called apsa2.dbj. This is a bibliographic configuration database file that is produced by the custom-bib package. If you read apsa2.dbj, you will see it is full of options for formatting of references. The ones that have % in the first column are "commented out" and the ones with the % removed are selected options. You can test out the impact of format changes by fiddling apsa2.dbj and saving it, and then run the command

> latex apsa2.dbj

That will create a new apsa2.bst file, which you can then move into your natbib installation.

It appears to me that, if you want to format for AJPS, all you need to do is make a few itty bitty changes in apsa2.dbj and re-run latex. Suppose the AJPS wants parentheses around the year.

In apsr2.dbj, you now see this:
%>>DATE FORMAT (if non author-year citations)
%<<DATE FORMAT (if author-year citations)
% %: (def) Year plain without any brackets
% yr-par,%: Year in parentheses as (1993)
% yr-brk,%: Year in brackets as [1993]
% yr-col,%: Year preceded by colon as `: 1993'
yr-per,%: Year preceded by period as `. 1993'
% yr-com,%: Date preceded by comma as `, 1993'
% yr-blk,%: Year preceded by space only, as ` 1993'

It is pretty obvious that, if you want parentheses, you should make it
look like this.

%>>DATE FORMAT (if non author-year citations)
%<<DATE FORMAT (if author-year citations)
% %: (def) Year plain without any brackets
yr-par,%: Year in parentheses as (1993)
% yr-brk,%: Year in brackets as [1993]
% yr-col,%: Year preceded by colon as `: 1993'
% yr-per,%: Year preceded by period as `. 1993'
% yr-com,%: Date preceded by comma as `, 1993'
% yr-blk,%: Year preceded by space only, as ` 1993'

Sorry if that insults your intelligence. Save that, rerun latex on it, and a bst file pops out. Copy it into your LaTeX installation, and run texhash. That may cause some wrinkles you need to iron out. After you run your document and review the reference output, you will see what I mean.

Here's a piece of vital advice about how to prepare the bib file.

Ignore the advice on capitalization that comes from many experts (and the KU library system, and the systems of other universities). For journal titles and article titles and book titles, please enter bib items with capitals, as in

My Favorite Book

The political science journals do not follow the widespread "sentence style" for titles. Instead, they want capitals for all words, not just the first. I have configured the bibliographic style file so that it will respect your capitalization in the bib file.

In case you change your mind, and want the sentence style, you can have the bibtex processor make that conversion for you. The bibtex processor can convert the capitals to smalls if that is what you really want, but, surprisingly, there's no good way to convert the other way. There are comments to this effect in the pa.bst file and although that file is somewhat dated, I have found no newer information to contradict it. So some entry for a title without capitals, like

My favorite book

can't be automatically translated so that it prints out like

My Favorite Book

I've not completely comprehended why they have the system set up in this way and why there is so much divergent advice on the internet about how one ought to enter bibliographic items. I suspect there's some more powerful tool that can deal with it, but I did not find it yet. If you look in apsa2.dbj, for example, you see there are only two options, one is capitalize the first word only (sentence style), the other is print titles as in the bib file.

Now, finally, you are asking me "how am I supposed to create the bib file"? That's a tough one. Get some example bib files, you see it is a simple format. The only problem is that one must type in things exactly. There is always the pioneer explorer option of using Emacs, the world's finest text editor, and typing the entries out by hand. The LaTeX Companion, which was recently updated, gives advice on that, and there are also countless web sites that you find if you search for "bibtex reference format".

That's a little bit Spartan for many of us, and there are various free beautiful graphical bibliography editors that can be used to produce bib files. For a long time, I've used tkbibtex (http://www.cat.csiro.au/cmst/staff/pic/tkbibtex.html) and Pybliographic (http://pybliographer.org/). The downside on Pybliographic is that it relies on the GNU recode library, and there are some longstanding flaws in recode. There are patches available, but one is not left with a feeling of confidence. tkbibtex carries with it the horror of the tk graphical library, which gets me down.

More recently, I have found a Java program called "JabRef" that works very well. (http://jabref.sourceforge.net). Since it is a java program, one can use it on any platform. It is currently maintained and undergoing enhancement, but it works great as it stands. Among these free programs, it is relatively unique because it has import filters for Endnote export files. So if you are using Endnote, there's a way out!

Many people are now accustomed to browsing the university online catalog and grabbing citations eletronically. This is convenient, but somewhat problematic. My library system subscribed to a system called RefWorks, and the appeal of it is that it is all web-based, so it works on any operating system that has a web browser. It is a somewhat tedious way to browse the card catalog and save formatted bibliographic items on the RefWorks server. Instead of browsing the university catalog directly, one logs into the RefWorks web site and then views the catalogue through their filter, marking and saving items. Then you can export those into bibtex format and import with jabref. The only problem I see so far is that only the first word in titles is capitalized. I'm looking into it. Into every life, a little rain must fall.

If you try this out and it works great, let me know. It boosts my sense of efficacy :> I know for a fact this all works great in Linux/Unix, and I'd be interested to hear of the experience of Windows users (who probably use the MikTeX distribution of LaTeX). I know that MikTeX does include natbib capability and the bst file is used, but don't know what steps are necessary to make the system aware of that new file after it is installed.

Paul Johnson
Dept of Political Science
University of Kansas



--
Paul E. Johnson email: pauljohn@ku.edu
Dept. of Political Science http://lark.cc.ku.edu/~pauljohn
1541 Lilac Lane, Rm 504
University of Kansas Office: (785) 864-9086
Lawrence, Kansas 66044-3177 FAX: (785) 864-5700