The Communications of the TEX Users Group Volume 29 ... - TUG
The Communications of the TEX Users Group Volume 29 ... - TUG
The Communications of the TEX Users Group Volume 29 ... - TUG
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Languages for bibliography styles<br />
Jean-Michel Hufflen<br />
LIFC (EA CNRS 4269)<br />
University <strong>of</strong> Franche-Comté<br />
16, route de Gray<br />
25030 Besançon Cedex, France<br />
hufflen (at) lifc dot univ-fcomte dot fr<br />
http://lifc.univ-fcomte.fr/~hufflen<br />
1 Introduction<br />
Abstract<br />
Bib<strong>TEX</strong> is <strong>the</strong> most commonly used bibliography processor in conjunction with<br />
L A<strong>TEX</strong>. To put bibliography styles into action, it uses a stack-based language<br />
written with postfixed notation. Recently, o<strong>the</strong>r approaches have been proposed:<br />
some use a script programming language for designing bibliography styles, e.g.,<br />
Perl in Bibulus; some are based on converters to XML texts and use XSLT for<br />
bibliography styles; a recent proposal—<strong>the</strong> biblatex package—consists <strong>of</strong> using<br />
L A<strong>TEX</strong> commands to control <strong>the</strong> layout <strong>of</strong> generated references, and more. We<br />
propose a comparative study <strong>of</strong> <strong>the</strong>se approaches and show which programming<br />
styles are encouraged, from a point <strong>of</strong> view related to methodology. Finally, we<br />
explain how this study has influenced <strong>the</strong> design <strong>of</strong> MlBib<strong>TEX</strong>, our multilingual<br />
reimplementation <strong>of</strong> Bib<strong>TEX</strong>.<br />
Keywords Bibliographies, bibliography styles, Bib<strong>TEX</strong>, s<strong>of</strong>tware quality, bst,<br />
Bib<strong>TEX</strong>++, cl-bibtex, MlBib<strong>TEX</strong>, packages natbib, jurabib, and latexbib, Tib, XML,<br />
XSLT, nbst, Perl, DSSSL.<br />
Three decades ago, 1 some programming languages<br />
were designed to be universal, that is, to serve all<br />
purposes. All <strong>of</strong> <strong>the</strong>se languages—e.g., PL/1 [25],<br />
Ada [2]—have failed to be accepted as filling this<br />
role. Nowadays, only <strong>the</strong> C programming language<br />
[30] is still used for a very wide range <strong>of</strong> applications.<br />
Present-day programming languages are very diverse<br />
and put different paradigms into action: procedural<br />
programming, object-oriented programming, functional<br />
programming, process-oriented programming,<br />
logic programming, ... In addition, most <strong>of</strong> <strong>the</strong>se<br />
present languages are specialised, that is, designed<br />
for particular purposes, even if <strong>the</strong>y are not formally<br />
limited to only one class <strong>of</strong> applications: two good examples<br />
are Java [28] and C# [39], originally designed<br />
for client-server applications. But, if you are building<br />
a standalone application using <strong>the</strong> object-oriented<br />
paradigm and are especially interested in <strong>the</strong> efficiency<br />
<strong>of</strong> <strong>the</strong> resulting program, it is well-known that<br />
a better choice is C++ [47], even if code generated<br />
by Java and C# compilers have greatly improved<br />
since <strong>the</strong>ir first versions.<br />
<strong>The</strong> purpose <strong>of</strong> this article is nei<strong>the</strong>r a comparison<br />
<strong>of</strong> all programming languages — which would be<br />
1 That is, at <strong>the</strong> time <strong>of</strong> <strong>TEX</strong>’s first version. . . Let us recall<br />
that we are celebrating <strong>TEX</strong>’s 30th birthday.<br />
impossible—nor an absolute comparison <strong>of</strong> several<br />
programming languages — which would not be <strong>of</strong> interest<br />
—but a comparative study <strong>of</strong> languages used<br />
to develop bibliography styles. Bib<strong>TEX</strong> [42] is <strong>the</strong><br />
bibliography processor most commonly used in conjunction<br />
with <strong>the</strong> L A<strong>TEX</strong> typesetting engine [40], so<br />
most <strong>of</strong> <strong>the</strong> bibliography styles used for L A<strong>TEX</strong> texts<br />
are written using bst, <strong>the</strong> stack-based language <strong>of</strong><br />
Bib<strong>TEX</strong> [40, § 13.6]. But o<strong>the</strong>r proposals exist, based<br />
on o<strong>the</strong>r programming paradigms, and this article<br />
aims to study <strong>the</strong> advantages and drawbacks <strong>of</strong> <strong>the</strong>se<br />
approaches. We will not discuss <strong>the</strong> typographical<br />
conventions ruling <strong>the</strong> typesetting <strong>of</strong> bibliographies —<br />
readers interested in this topic can consult manuals<br />
like [5, § 10], [6, §§ 15.54–15.76], [16, pp. 53–54]—<br />
but are interested only in <strong>the</strong> development <strong>of</strong> bibliography<br />
styles — from scratch or derived from o<strong>the</strong>r<br />
existing styles—and <strong>the</strong> expressive power <strong>of</strong> languages<br />
used to do that.<br />
In Section 2, we recall <strong>the</strong> main quality factors <strong>of</strong><br />
s<strong>of</strong>tware, and show which factors are interesting from<br />
a point <strong>of</strong> view related to bibliography styles. <strong>The</strong>n<br />
Bib<strong>TEX</strong> is studied in Section 3, including some modern<br />
use <strong>of</strong> this program. O<strong>the</strong>r approaches are based<br />
on XML, 2 as shown in Section 4. This experience<br />
2 EXtensible Markup Language. Readers interested in an<br />
introductory book to this formalism can refer to [44].<br />
<strong>TUG</strong>boat, <strong>Volume</strong> <strong>29</strong> (2008), No. 3 —Proceedings <strong>of</strong> <strong>the</strong> 2008 Annual Meeting 401