The margbib document style^{∗}

Karsten Tinnefeld

            tinnefeld@irb.cs.uni-dortmund.de

printed December 11, 1997

Abstract

This document describes the margbib document style. This style redefines the thebibliography environment in order to move the bibliography labels into the borders.

1 Introduction

Why the margbib style? Many typesetters say that text is only readable when it is not wider than, say, about 70 letters. This limit is very tight, provided typesetting on one column ISO A4 paper, the usual European paper size. Thus there is a tradeoff between readability in normal text paragraphs and the amount of trouble in line breaking especially of bibliographies, where masses of names and declarative title words discourage easy hyphenation. Large tags in all “speaking” citation styles such as alpha or abbrv make it even harder as the books’ label sizes increase.

Therefore, this style takes the label off the normal paragraph and places it right beside the text in the margin. Since the normal \marginpar command has problems with its output routine in case twoside is used—first the marginalium is set, then a compound paragraph is possibly put onto the next page—we employ the marn.sty created in 1993 by Donald Arseneau. It ensures right placing of the marginal note in this case. This is done utilising the .aux-file, but who does not reTEX each document twice or thrice?

This document style has been tested with the normal L^{A}TEX 2ε base, the AMS and the KOMA-Script documents. It works—most important—with the twoside option and the use of normal \marginpars, for problems therewith cf. the documentation to marn.sty. I have found one minor caveat: it does not print out this famous “labels have changed, please reTEX!” message in case of modifications, so my AUC TEX^{1} makes wrong proposals about what to do next. Minor, as I said.

∗This file has version number 1.0b, last revised 1997/11/10, documentation dated 1997/11/10.

1AUC TEX is Per Abrahamsen’s famous TEX mode for Emacs.

2 Remark

The AMS bibliography styles make the paragraph text some degrees smaller than regular. This package keeps this font size in paragraph text, but sets the margin labels in normal font. This does not look that great, but whoever wants to combine both is encouraged to fix it.

Example

[Knu86] Donald E. Knuth. The TEXbook, volume A of Computers & Typesetting. American Mathematical Society, Reading MA, 1986.

[Mit97] Frank Mittelbach. The doc and shortvrb packages. Gutenbach Universität Mainz, February 5th, 1997.

3 The Code

Let us look whether the document style marn by Donald Arseneau exists. This will avoid difficulties in twoside-mode. If so, we load the package, otherwise output a warning and make do with \marginpar.

 1 \IfFileExists{marn.sty}{%
 2 \RequirePackage{marn}
 3 }{%
 4 \PackageWarning{margbib}{%
 5  marn package unavailable -- using \string\marginpar}%
 6 \let\marn\marginpar}

\bibitem This redefines \bibitem and the two subcommands (with and without the optional tag) to move our label information into the borders. We could leave out the first line of the following code for all the examined styles, after all, but since the @- commands are not said to persist, this redundancy may be future’s benefit.

 7 \def\bibitem{\@ifnextchar[\@lbibitem\@bibitem}
 8 \def\@lbibitem[#1]#2{\item[]\if@filesw
 9 {\makebox{}\marn{\@biblabel{#1}}%
10  \let\protect\noexpand
11  \immediate
12  \write\@auxout{\string\bibcite{#2}{#1}}}\fi\ignorespaces}
13 \def\@bibitem#1{\item[]\if@filesw\immediate\write\@auxout
14 {\string\bibcite{#1}{\the\value{\@listctr}}}\fi\ignorespaces}

thebibliography In order to broaden our text to the whole \itemless width, we have to redefine the thebibliography environment. For the sake of its document-dependent facilities, we first steal the code and then manipulate it: The shape of the paragraph is simply reset.

Why override the given environment instead of defining a new? For those who write bibliographies one after the other by themselves, this is no problem. But BibTEX generates thebibliography environments, and nothing else. Thus it is only a question of working with margbib.sty or without. Whoever wanted to have different forms of bibliographies in one document, e. g. using chapterbib, might possibly have cramped her style.

15 \let\m@rgbib=\thebibliography
16 \let\endm@rgbib=\endthebibliography
17 \renewenvironment{thebibliography}[1]{%
18 \begin{m@rgbib}{#1}
19  \parshape=0\relax
20  }{%
21 \end{m@rgbib}

22 }