Jump to navigation Jump to search
3,366 bytes added ,  14:55, 25 April 2007
active hyperlinks section
== Active URLs ==
If you want active (clickable) URLs in the references, you need to do a few steps. [Thanks to Tobias Burnus for the working minimal example, which I've modified only slightly.]
* Use a patched <code>t-bib.tex</code> (until the next ConTeXt release sometime in May 2007 that will contain the patch).
* Use the <code>url</code> field in the <code>bibtex</code> entries.
* Setup a publication layout (for those types of <code>bibtex</code> entries) that knows how to include a URL.
The minimal example is in [[]], which includes the patched <code>t-bib.tex</code>. But here are the details of steps 2 and 3. A <code>bibtex</code> <code>book</code> entry using the <code>url</code> field looks like:
editor = {John D. Barnsford and Ann L. Brown and Rodney R. Cocking},
title = {{How people learn: Brain, mind, experience, and school}},
publisher = {National Academy Press},
year = 2000,
address = {Washington, DC},
edition = {expanded},
url = {}
The modified <code>\setuppublicationlayout</code>, which goes into an environment file or in the preamble of the <code>.tex</code> file, includes lines to use the <code>url</code> field. Since I use the <code>num</code> style for the publication list, with <code>\setuppublications[alternative=num]</code>, I take the <code>book</code> layout from the <code>bibl-num.tex</code> source file and modify it by adding two lines:
% copied from bibl-num.tex and added
% \inserturl and \insertdoi
\insertauthors{}{\unskip. }{\inserteditors{}{\unskip, editor%
\ifnum\getvalue{editor@num}> 1 s\fi.%
\ \global\editedbooktrue
}{\insertthekey{}{\unskip. }{}}}%
{\bgroup\it }%
{ Number~}%
{ in~\bgroup}%
{\egroup. }%
{\insertcrossref{ in~}{}{. }}}%
{\insertseries{ }{.}{} }%
{\insertchap{, }{}{}%
\insertpages{, pages }{. }{. }%
\insertvolume{Volume~}{ of~}{}%
{, volume~}%
{ of~\bgroup\it}%
\insertchap{, }{}{}%
\insertpages{, pages }{.}{.}%
{ }%
{\insertedition{, }{ edition}{}%
\insertpubyear{, }{.}{.}}%
{\insertedition{, }{ edition}{}%
\insertpubyear{, }{.}{.}}%
\insertpages{ }{p.}{}%
\insertdoi{ }{.}{}%added
\insertbiburl{ }{.}{}%added
\insertnote{ }{.}{}%
When running 'texexec', check the terminal output (or logfile) to ensure that texexec finds the modified t-bib.tex (which I have been keeping in the current directory) rather than the system-supplied t-bib.tex. Once the patched t-bib.tex becomes the official release (Taco says sometime in May 2007), that step won't be necessary.
== Other tips ==


Navigation menu