\documentclass[a4paper]{article}

\title{The \texttt{urlbst} package}
\author{Norman Gray \texttt{<norman@astro.gla.ac.uk>}}
\date{Version 0.2, April 2002}	%%VERSION%%

%\usepackage{times}
\usepackage{url}

% Avoid having to type \texttt all the time
\catcode`\|=\active
\def|#1|{\texttt{#1}}

% Not long enough to make it useful to number sections
\setcounter{secnumdepth}{0}

% Squeeze a bit more on to the page
%\addtolength\textwidth{1cm}
%\addtolength\oddsidemargin{-0.5cm}

\makeatletter
\renewcommand{\verbatim@font}{\normalfont\small\ttfamily}
\makeatother

\newcommand{\ub}{\texttt{urlbst}}
\newcommand{\BibTeX}{Bib\TeX}

\begin{document}
\maketitle

The \ub\ package consists of a Perl script which edits \BibTeX\ style
files (|.bst|) to add a `webpage' entry type, and which supports `url'
and corresponding `lastchecked' fields on all other entry types.

Usage is simple:
\begin{verbatim}
urlbst.pl [input-file [output-file]]
\end{verbatim}
where the |input-file| is an existing |.bst| file, and
the |output-file| is the name of the new style file to be
created.  If either file name is missing, the default is the
standard-input or standard-output respectively.

The output of the \ub\ script works as-is in the case of the four
standard \BibTeX\ style files |plain.bst|, |unsrt.bst|, |alpha.bst|
and |abbrv.bst|.  It also works as straightforwardly for many other
style files, but it does not pretend that it can do so for all of
them.  In some cases, such as the style files for the `refer' or
`koma-script' packages, the style files are not intended to be used
for formatting; others are sufficiently different from the standard
files that a meaningful edit becomes impossible.  For the remainder,
however, the result of this script will need only relatively minor
edits before being perfectly usable.

The generated references have URLs inside \verb|\url{...}|.  The best
way to format this this is with the |url.sty| package
(see~\cite{texfaq} for pointers), but as a poor alternative, you can
try \verb|\newcommand{\url}[1]{\texttt{#1}}|.

\section{New |.bib| entry and field types}

The new entry type |webpage| has required fields |title| and |url|,
and optional fields |author|, |editor|, |note|, |year|, |month| and
|lastchecked|.  The |url| and |lastchecked| fields are new, and are
valid in other entry types as well: the first, obviously, is the URL
which is being cited, or which is being quoted as an auxiliary source
for an article perhaps; the second is the date when you last checked
that the URL was there, in the state you quoted it, which is necessary
since some people, heedless of the archival importance of preserving
the validity of URLs, indulge in the vicious practice of reorganising
web pages and destroying links.  For the case of the |webpage| entry
type, the |editor| field should be used for the `maintainer' of a web page.

\section{Sources}

There are various sources which suggest how to format references to
web pages.  I have followed none specifically, but fortunately they do
not materially disagree.

ISO-690~\cite{url:iso690} is a formal standard for this stuff.  Walker
and Taylor's \emph{Columbia Guide to Online Style}~\cite{walker}
(which is itself an updated version of
\cite{walker-orig}) provides extensive coverage.  Emory University's
\emph{Citation Formats}~\cite{emory95} is a compendium of links rather
than a guide itself.  The APA has a couple of style guides, a proposed
one~\cite{url:weapas} and a style included in the published APA style
guide~\cite{apastyle} (I'm not sure of the relationship between these
last two).

\section{Hints}

If you use Emacs' \BibTeX\ mode, you can insert the following in your
|.emacs| file to add knowledge of the new |webpage| entry:
\begin{verbatim}
(setq bibtex-entry-field-alist
      (cons
       '("Webpage" ((("url" "The URL of the page")
                     ("title" "The title of the resource"))
                    (("author" "The author of the webpage")
                     ("editor" "The editor/maintainer of the webpage")
                     ("year" "Year of publication of the page")
                     ("month" "Month of publication of the page")
                     ("lastchecked" "Date when you last verified the page was there")
                     ("note" "Remarks to be put at the end of the entry"))))
       bibtex-entry-field-alist))
\end{verbatim}
After that, you can add a |webpage| entry by typing |C-c C-b webpage|
(or |M-x bibtex-entry|).

It is a \emph{very} good idea to use the |url| package: it deals with
the problem of line-breaking long URLs, and with the problem that
\BibTeX{} creates, of occasionally inserting \%-signs into URLs in
generated bibliographies.

See also the URL entry in the UK \TeX\ FAQ~\cite{texfaq}, and
references therein.

\bibliography{urlbst}
\bibliographystyle{plainurl}

\end{document}
