The package easybib

Enrico Bertolazzi

Department of Mechanics and Structures Engineering University of Trento via Mesiano 77, I – 38050 Trento, Italy

enrico.bertolazzi@ing.unitn.it

19th March 2002

Abstract The package easybib introduces new items for easy custom-made bib-

liographies.

Contents

1 The package easybib . . . . . . . . . . . . . . . . . . . . . . . 2 2 The command \moreref . . . . . . . . . . . . . . . . . . . . . 5 3 The command \endref . . . . . . . . . . . . . . . . . . . . . . 5 4 The command \refstyle . . . . . . . . . . . . . . . . . . . . 6 5 An example of bibliography from AMS-TEX documentation … 7 6 Modifying the appearance . . . . . . . . . . . . . . . . . . . . . 10 7 Changing the order of the items . . . . . . . . . . . . . . . . . . . 11 8 Citing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 9 Defining new styles . . . . . . . . . . . . . . . . . . . . . . . . . 12

1 The package easybib

The scheme of the bibliography in the package easybib was inspired by the bibliography system of AMS-TEX. For the sake of flexibility, the syntax is somewhat different, yet the functionality is similar (although not identical). For the use, load the package using the usual syntax:

  \documentclass{article}
  .
  .
  \usepackage[definethebibliography]{easybib}
  .
  .

The option \definethebibliography overrides the default thebibliography environment. In this case the environment thebibliography takes the form:

  \begin{thebibliography}``[optional name]''
                             ``(\cmd,space)''{99}
  .
  .
  .
  \end{thebibliography}

so that you can override the default name \refname with the name of your choice, you can change the default \section* with \cmd and add extra space space in front of the items. The syntax of the bibliography command is now the following

 \begin{thebibliography}{99}
 \bookref{label name}
   \by         Author(s) name
   \bysame
   \title      Title of the book
   \bookinfo  ...
   \publ       publisher
   \publaddr  publisher address
   \pages      pages number

\yr         year
\lang       ...
\transl     ...
\endref
\paperref{label name}
\by         Author(s) name
\bysame
\title      Title of the book
\transl     ...
\jour       Journal name
\toappear  ...
\inbook     ...
\publ       publisher
\eds        ...
\publaddr  publisher address
\vol        volume
\yr         year
\pages      number of pages
\finalinfo ...
\lang       ...
\endref
\end{thebibliography}

the command

\bookref``[display label]''{label} ... \endref

is used to refer to a book, while

\paperref``[display label]''{label} ... \endref

is used to refer to a paper.

When an item, for example \xxx, is encountered then the following text is expanded as follows

\xxx+text ==> punctation +
                begin commands +
text +
end commands

where the punctation is displayed unless \xxx is the first displayed item. The default values for the items in the \bookref environment are the following

command  punctation begin commands  end commands

\by         ,         \bfseries  nothing

\bysame

            ,

                      \hbox to3em
                      {\hrulefill\hskip.1em}

nothing

\title      ,         \scshape  nothing
\bookinfo   ,         \rmfamily  nothing
\publ       ,         \rmfamily  nothing
\publaddr   ,         \rmfamily  nothing
\pages      ,         \rmfamily  nothing
\yr         ,         \rmfamily  nothing
\lang  nothing  (                          )
\transl     ,         \rmfamily  nothing

The default values for the items in the \paperref environment are the following

command  punctation begin commands end commands

\by           ,         \bfseries  nothing

\bysame

              ,

                        \hbox to3em {\hrulefill \hskip.1em}

nothing

\title        ,         \itshape  nothing
\transl       ,         \rmfamily  nothing
\jour         ,         \rmfamily  nothing
\toappear  nothing  (to appear      )
\inbook       ,         \rmfamily  nothing
\publ         ,         \rmfamily  nothing

\eds nothing

                        (

                                       \@killglue, eds.)

\publaddr     ,         \rmfamily  nothing

\vol  nothing  \bfseries  nothing
\yr  nothing  (               )

\pages        ,         \rmfamily  nothing
\finalinfo    ,         \rmfamily  nothing
\lang  nothing  (               )

2 The command \moreref

In the case of more than one reference of the same author or in the case of a series of papers or books on the same argument, it may be useful to use the \moreref command. The syntax is the following

  \paperref{label name} or \bookref{label name}
  items
  \moreref`[punctation]'{book or paper}
  items
  \moreref`[punctation]'{book or paper}
  .
  .
  \endref

The effect is to use a single label reference for more than one book or paper. The optional command “[punctation] ” can be used to change the default punctation “;” to something else, for example you can use \moreref[, see also:]{book} .

3 The command \endref

The command \endref closes the definition of a reference. By default the reference is closed by the semicolum ;. It is possible to change the default value as follows

  \endref[punctation], for example \endref[.]

This is useful for the last reference, for example

 \begin{thebibliography}{99}
 \bookref{aaa}
 \by      J. Free
 \title  A book title
 \publ   A publisher
 \yr      1970
 \endref
 \bookref{bbb}

\by      B. New
\title  Another book title
\publ   Another publisher
\yr      1992
\endref
\bookref{ccc}
\by      C. Old
\title  Yet another book title
\publ   Again a publisher
\yr      1986
\endref[.]
\end{thebibliography}

References

1. J. Free, A book title, A publisher, 1970;

2. B. New, Another book title, Another publisher, 1992;

3. C. Old, Yet another book title, Again a publisher, 1986.

4 The command \refstyle

There are many styles for display the labels of the bibliography. The standard L^{A}TEX way of changing the appearance is to modify the \@bibitem macro. A easiest

way in easybib is to use \refstyle before \begin{thebibliography} .

The syntax is the following:

 \refstyle{A} or \refstyle{B}  or  \refstyle{C}

the effect is to change \@bibitem as follows

command  \@bibitem definition  sample output

    \refstyle{A}    \def\@bibitem#1{#1.}  1.
    \refstyle{B}    \def\@bibitem#1{[#1]}  [1]
    \refstyle{C}    \def\@bibitem#1{}  nothing

5 An example of bibliography from AMS-TEX documentation

The following complex example shows the features of easybib and is essentially the example showed in the AMS-TEX documentation translated in the language of easybib.

\begin{thebibliography}{99}
\bookref{abc}
\by     V. I. Arnol$'$d, A. N. Varchenko,
        and S. M. Guse\u\i n-Zade
\title Singularities of differentiable maps.~{\rm I}
\publ  ``Nauka'' \publaddr Moscow
\yr     1982
\lang  Russian
\endref
\bookref{def}
\bysame
\title Singularities of differentiable maps.~{\rm II}
\publ  ``Nauka'' \publaddr Moscow
\yr     1984
\lang  Russian
\endref
\bookref{ghi}
\by     O. A. Ladyzhenskaya
\title Mathematical problems in the dynamics of a
        viscous incompressible fluid
\bookinfo 2nd rev. aug. ed.
\publ  ``Nauka'' \publaddr Moscow
\yr     1970
\lang  Russian
\transl English transl. of 1st ed.
\moreref{book}
\title The mathematical theory of viscous
        incompressible flow
\publ  Gordon and Breach \publaddr New York
\yr     1963; rev. 1969
\endref
\bigskip

\paperref{bib:4}
\by     P. D. Lax and C. D. Levermore
\title The small dispersion limit for
        the KdV equation.~{\rm I}
\jour  Comm. Pure Appl. Math.
\vol 36 \yr 1983 \pages 253--290
\finalinfo (overview)
\moreref[, see also:]{paper}
\title {\rm II}
\jour   Comm. Pure Appl. Math.
\vol 36 \yr 1983 \pages 571--594
\moreref[, see also:]{paper}
\title {\rm III}
\jour  Comm. Pure Appl. Math.
\vol 36 \yr 1983 \pages 809--829
\endref
\paperref{bib:5}
\by     S. Osher
\title Shock capturing algorithms for equations
        of mixed type
\inbook Numerical Methods for Partial
         Differential Equations
\eds   S. I. Hariharan and T. H. Moulton
\publ Longman \publaddr New York
\yr 1986 \pages 305--322
\endref
\paperref{bib:6}
\by     G. S. Petrov
\title Elliptic integrals and their
        nonoscillatory behavior
\jour  Funktsional. Anal. i Pri\-lo\-zhen.
\vol 20 \yr 1986 \pages 46--49
\moreref{paper}
\transl English transl. in Functional
         Anal. Appl. \vol 20\yr 1986
\endref[.]
\end{thebibliography}

References

1. V. I. Arnol′d, A. N. Varchenko, and S. M. Guseĭn-Zade, Singularities of differentiable maps. I, “Nauka”, Moscow, 1982 (Russian);

2. , Singularities of differentiable maps. II, “Nauka”, Moscow, 1984 (Russian);

3. O. A. Ladyzhenskaya, Mathematical problems in the dynamics of a viscous incompressible fluid, 2nd rev. aug. ed., “Nauka”, Moscow, 1970 (Russian), English transl. of 1st ed.; The mathematical theory of viscous incompressible flow, Gordon and Breach, New York, 1963; rev. 1969;

4. P. D. Lax and C. D. Levermore, The small dispersion limit for the KdV equation. I, Comm. Pure Appl. Math. 36 (1983), 253–290, (overview), see also: II, Comm. Pure Appl. Math. 36 (1983), 571–594, see also: III, Comm. Pure Appl. Math. 36 (1983), 809–829;

5. S. Osher, Shock capturing algorithms for equations of mixed type, Numerical Methods for Partial Differential Equations, Longman (S. I. Hariharan and T. H. Moulton, eds.), New York (1986), 305–322;

6. G. S. Petrov, Elliptic integrals and their nonoscillatory behavior, Funktsional. Anal. i Prilozhen. 20 (1986), 46–49; English transl. in Functional Anal. Appl. 20 (1986).

\refstyle{B}
\begin{thebibliography}{AAAA}
\bookref[C1]{C1}
\by      B. Coomes
\title  Polynomial flows, symmetry groups, and
      conditions sufficient for injectivity of maps
\bookinfo Ph.D. thesis, Univ. Nebraska--Lincoln
\yr 1988
\endref
\paperref[C2]{C2}
\bysame % B. Coomes
\title The Lorenz system does not have
     a polynomial flow
\jour  J. Differential Equations
\toappear

\endref
\paperref[GHMR]{GHMR}
\by     J. Guckenheimer, P. Holmes,
        M. Martineau, and L. P. Robinson
\title Nonlinear oscillations, dynamical systems, and
        bifurcations of vector fields
\publ Springer-Verlag \publaddr New York
\yr 1983
\endref[.]
\end{thebibliography}

References

[C1] B. Coomes, Polynomial flows, symmetry groups, and conditions sufficient for injectivity of maps, Ph.D. thesis, Univ. Nebraska–Lincoln, 1988;

[C2] , The Lorenz system does not have a polynomial flow, J. Differential Equations (to appear);

[GHMR] J. Guckenheimer, P. Holmes, M. Martineau, and L. P. Robinson, Nonlinear oscillations, dynamical systems, and bifurcations of vector fields, Springer-Verlag, New York (1983).

6 Modifying the appearance

You can control the default formats by the command

 \bibsetfmt[group name,item]{punctation}
                                {begin commands}
                                {end commands}

for example

 \bibsetfmt[paper,by]{,}{\textit}{:}

This way you can easily modify the appearance of the bibliography.

7 Changing the order of the items

The order of the items:

for `paper' group:
by,bysame,title,transl,jour,toappear,
inbook,publ,eds,publaddr,vol,
yr,pages,finalinfo,lang
for `book' group:
by,bysame,title,bookinfo,publ,publaddr,
pages,yr,lang,transl

can be changed defining the macro \paperlist and \booklist. For example to have the yr item displayed after pages item in the paper group define:

\def\paperlist{by,bysame,title,transl,jour,%
                 toappear,inbook,publ,eds,%
publaddr,vol,pages,yr,%
finalinfo,lang}

8 Citing

The following segment of code

\citestyle{A}
Cite mode A \cite{book:1,art:1,art:2}. \\
\citestyle{B}
Cite mode B \cite{book:1,art:1,art:2}. \\
\citestyle{C}
Cite mode C \cite{book:1,art:1,art:2}.

Cite mode A [?, ?, ?]. Cite mode B^{[?, ?, ?]}. Cite mode C^{?, ?, ?}.

for the previous bibliography

9 Defining new styles

If you do not like the predefined styles paper and book you can easily define new ones. For example suppose you want to define a new style tales with the

item \author, \title, \year with:

\author in smallcaps style surrounded by a box

\title in italic style

\year in bold style within (...)

you must follow the following steps

define the list of items

       \def\taleslist{author,title,year}

define the command \talesref with the items

       \bibdefinestyles{tales}

it defines the items \author, \title, \year with the default format and the command \talesref.

change the default formatting \bibsetfmt[tales,author]

         {,}
         {\setbox0\hbox\bgroup\scshape}
         {\egroup\fbox{\box0}}
       \bibsetfmt[tales,title]{}{\itshape}{}
       \bibsetfmt[tales,year]{}{\bfseries(}{)}

The following example (which uses [definethebibliography]) shows the effect:

 \def\taleslist{author,title,year}
 \bibdefinestyles{tales}
 \bibsetfmt[tales,author]{,}
   {\setbox0\hbox\bgroup\scshape}
   {\egroup\fbox{\box0}}
 \bibsetfmt[tales,title]{}{\itshape}{}
 \bibsetfmt[tales,year]{}{\bfseries(}{)}
 \begin{thebibliography}[Tales](\section*,1cm){99}
     \talesref{A}

\author Isaac Asimov
\title  Nemesis
\year   1989
\endref
\talesref{B}
\author Roger Zelazny
\title  Nove principi in ambra
\year   1970
\endref
\talesref{C}
\author Dean R. Koontz
\title  Strangers
\year   1986
\endref[.]
\end{thebibliography}

Tales

[1] Isaac Asimov Nemesis (1989);

[2] Roger Zelazny Nove principi in ambra (1970);

[3] Dean R. Koontz Strangers (1986).