Splitting your inputMoving information aroundLinks into your documentBibliography and citationContentsIndex

Bibliography and citation

Hyperlatex understands the thebibliography environment. Like LaTeX, it creates a chapter or section (depending on the document class) titled "References". The \bibitem command sets a label with the given cite key at the position of the reference. This means that you can use the \link command to define a hyperlink to a bibliography entry.

The command \Cite is defined analogously to \Ref and \Pageref by \link. If you define a bibliography like this

   \begin{thebibliography}{99}
      \bibitem{latex-book}
      Leslie Lamport, \cit{\LaTeX: A Document Preparation System,}
      Addison-Wesley, 1986.
   \end{thebibliography}

then you can add a reference to the LaTeX-book as follows:

   ... we take a stroll through the
   \link{\LaTeX-book}[~\Cite]{latex-book}, explaining ...
Furthermore,

the command \htmlcite generates the printed citation itself (in our case, \htmlcite{latex-book} would generate "[1]"). The command \cite is approximately implemented as \link{\htmlcite{#1}}{#1}, so you can use it as usual in LaTeX, and it will automatically become an active hyperlink, as in "[1]". (The actual definition allows you to use multiple cite keys in a single \cite command.)

Hyperlatex also understands the \bibliographystyle command (which is ignored) and the \bibliography command. It reads the .bbl file, inserts its contents at the given position and proceeds as usual. Using this feature, you can include bibliographies created with BibTeX in your HTML-document! It would be possible to design a WWW-server that takes queries into a BibTeX database, runs BibTeX and Hyperlatex to format the output, and sends back an HTML-document.

The formatting of the

bibliography can be customized by redefining the bibliography environment thebibliography and the Hyperlatex macro \htmlbibitem. The default definitions are

   \newenvironment{thebibliography}[1]%
      {\chapter{References}\begin{description}}{\end{description}}
   \newcommand{\htmlbibitem}[2]{\label{#2}\item[{[#1]}]}

If you use BibTeX to generate your bibliographies, then you will probably want to incorporate hyperlinks into your .bib files. No problem, you can simply use \xlink. But what if you also want to use the same .bib file with other (vanilla) LaTeX files, which do not define the \xlink command? What if you want to share your .bib files with colleagues around the world who do not know about Hyperlatex?

One way to solve this problem is by using the BibTeX @preamble command. For instance, you put this in your BibTeX file:

@preamble("
  \providecommand{\url}[1]{#1}
  ")

Then you can put a URL into the note field of a BibTeX entry as follows:

   note = "\url{ftp://nowhere.com/paper.ps}"

Now your BibTeX file will work fine with any LaTeX documents, typesetting the URL as it is.

In your Hyperlatex source, however, you could define \url any way you like, such as:

\newcommand{\url}[1]{\xlink{#1}{#1}}

This will turn the note field into an active hyperlink to the document in question.


July 13, 2005

Splitting your inputMoving information aroundLinks into your documentBibliography and citationContentsIndex