[OS X TeX] URLs in bibliographic entries
Claus Gerhardt
gerhardt at math.uni-heidelberg.de
Fri Dec 15 12:59:41 EST 2006
You can either add a new field or use the existing note field but in
any case you should use hyperref and add the reference by using its
command \href{}{} like in
\href{http://arXiv.org/abs/hep-th/0304033}{arXiv:hep-th/0304033}
To avoid any hiccups when hyperref is not loaded and also to calm
bibtex replace the preamble section in the chicago.bst by
FUNCTION {begin.bib}
{ preamble$ empty$
'skip$
{ preamble$ write$ newline$ }
if$
"\providecommand{\href}[2]{#2}"
write$ newline$
"\begin{thebibliography}{}" write$ newline$
}
EXECUTE {begin.bib}
EXECUTE {init.state.consts}
ITERATE {call.type$}
FUNCTION {end.bib}
{ newline$
"\end{thebibliography}" write$ newline$
}
I copied the whole preamble section with the new addition for \href
included.
Claus
On Dec 15, 2006, at 18:31, Adam R. Maxwell wrote:
>
> On Dec 15, 2006, at 09:11, Nathan Paxton wrote:
>
>> Hi all,
>>
>> Another question of basic difficulty. I've done some googling,
>> but it's not quite clear what I need to do.
>>
>> I have a number of biblio entries in BibDesk that have URLs to
>> WWW versions of the papers I cite. I'm using the natbib package,
>> with a chicago.bst reference style. How can I get the reference
>> list to print out the URLs of the papers (which it won't do right
>> now)? I've seen some stuff on the url.sty package, but I can't
>> figure out how to get that to work within my document.
>
> You'll have to modify a copy of the .bst file (rename it first).
>
> * In the beginning of the file, there should be an ENTRY list with
> all the fields. Add url to this.
> * Add a new function:
>
> FUNCTION {format.url}
> { url empty$
> { "" }
> { new.block "URL \url{" url * "}" * }
> if$
> }
>
> this should go with other functions (e.g. format.title).
>
> * For each type that can have a url field, add the following line
>
> format.url output
>
> at the appropriate location.
>
> This may require some experimentation, but should be enough to get
> you started. You'll also want to use either hyperref.sty or
> url.sty to give you a proper \url command.
>
> hth,
> Adam
>
> ------------------------- Helpful Info -------------------------
> Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
> TeX FAQ: http://www.tex.ac.uk/faq
> List Archive: http://tug.org/pipermail/macostex-archives/
> List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/
>
>
------------------------- Helpful Info -------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/
More information about the MacOSX-TeX
mailing list