[pmwiki-users] Bibliography: @STRING-macros and cross-references in BibTeX

christian.ridderstrom at gmail.com christian.ridderstrom at gmail.com
Sun Oct 1 13:04:23 CDT 2006


I think I should perhaps explain what a @STRING-macro is as related to 
BibTeX. Instead of coming up with a theoretical example I did a quick 
google and found a real example, to which I've added some explanations:

The file "string.bib" defines the macro POPL like this:	

	@string{POPL="Symposium on Principles of Programming Languages"}

A file "crossref.bib" may use it as in the following example that referes 
to an entire conference proceedings:

	@PROCEEDINGS{popl89,
	   title = {16th Annual } # POPL,
	   year = {1989},
	   publisher = {ACM Press},
	   booktitle = {16th Annual } # POPL}

Note the part "# POPL" appended at the end of the field 'title'. This will 
expand the macro POPL and append it to "16th Annual ", resulting in a 
title like this:

	16th Annual Symposium on Principles of Programming Languages

I think you can see why it can make sense to define the common part of a 
title only once, instead of 16 times. (Much less typos for one...)

Note that in order to use the above, the BibTeX system has to use both the 
file "string.bib" and the file "crossref.bib". 

I've used @STRING quite extensively in my personal .bib-files. It has 
several benefits, for instance:
* Reduces the risk of writing the name of a journal or a conference 
  proceedings differently.
* Makes it easier to search your .bib-files for citation entries that
  you have that refer to a specific journal. (Because if the name of
  the journal is written differently in the different entries, a search
  may not show you the entries where the name is spelled differently)
* When you have more than three citation entries, I found it is actually 
  quicker to add new entries if you already have a string macro for
  the name of the journal.
* Makes it easier to get a consistent style across the names of 
  *different* journals.

Some bibliographic style (or journals) assume you use abbrievations in 
your bibliography - it can get long otherwise. By having yet another 
BibTeX file 'string-abbrv.bib' that defines POPL like this:

	@string{POPL="Princ. Prog. Lang."}

you can get the citation entry defined in "crossref.bib" to produce a 
title like this instead:

	16th Annual Princ. Prog. Lang.

where you'd have to tell BibTeX to use the files "string-abbrv.bib" 
together with "crossref.bib.". The resulting title might not be that 
pretty, but it is shorter.

As a bonus, I'll explain why the second file is called "crossref.bib". A 
publication that is a "proceedings" is typically the resulting publication 
of a conference, and it can contain many hundreds of conference papers. So 
when you refer to a paper from a conference, the citation entry needs to 
contain not only the authors of the paper, but also a reference to the 
conference itself. Now, if you are citing several papers from one and the 
same conference, and you for each citation entry write down the same 
bibliographic information about the conference, you can end up doing a lot 
unnecssary work. BibTeX provides a better solution in the form of cross 
references. Here's how a citation entry for a conference paper from the 
16th POPL conference can look like - let's say it is in a file called 
"refs.bib".

	@InProceedings{wadler-ad-hoc,
	   author= {Philip Wadler and Stephen Blott},
	   title= {How to Make Ad-Hoc Polymorphism Less Ad Hoc},
	   crossref= {popl89},
	   pages= {60-76}
	}

Note the field 'crossref', which uses the citation key 'popl89' to refer 
to that citation entry. BibTeX will then be clever enough to go to the 
popl89-entry and fetch whatever information it can't find in the entry for 
'wadler-ad-hoc'.

So in this case BibTeX uses the files:
* Either "string.bib" or "string-abbrv.bib"
* "crossref.bib"
* "refs.bib"

Note that it's perfectly fine to put cross-reference entries and "normal" 
entries in the same file. The entry for 'popl89' could simply have been 
stored in the same files as the entry for 'wadler-ad-hoc'.

This is how I've used cross references btw. I've stored them in the same 
file as many of the other citation entries. Primarily I've used 
cross-reference entries for conference proceedings, but also for books 
that contain chapters by different authors.

cheers
/Christian

-- 
Christian Ridderström, +46-8-768 39 44               http://www.md.kth.se/~chr


More information about the pmwiki-users mailing list