ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* active urls in bibliographies
@ 2007-04-24  2:44 Sanjoy Mahajan
  2007-04-24  7:26 ` Tobias Burnus
  0 siblings, 1 reply; 5+ messages in thread
From: Sanjoy Mahajan @ 2007-04-24  2:44 UTC (permalink / raw)
  To: ntg-context

[This must be a FAQ, and if so I'll put it on the wiki]  

I tried to force an active hyperlink to be part of a bibliography entry.
If the bibliography style file for that entry type uses it, maybe it
will work.  But I wanted to put it in the 'note' field so that I could
add it to most entries.  e.g.

@Book{HPL:2000,
  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},
  note =	 {http://www.nap.edu}
}

As above, the URL comes out normal (i.e. not hyperlinked).  I couldn't
get the 'biburl' field to do the magic (even with \setupinteraction
started), maybe because I'd need to reprogram the .bst to use it.  Also
various combinations of \useURL and \goto did not work.  e.g. This
failed:

\useURL[someurl][http://www.someurl.org][][http://www.someurl.org]

@Book{HPL:2000,
{...
  note =	 {\goto[someurl]}
...
}

That fails with

! Argument of \dogoto has an extra }.
<inserted text> 
                \par 
<to be read again> 
                   }
\doattributes ...name #1#2\@EA \endcsname \fi {#4}
                                                  \dostopattributes 
<argument> ...esetapublication {HPL:2000}\strut }}
                                                  \egroup \ifdim \wd 4=\zero...

\secondoftwoarguments #1#2->#2
                              
\dosomelistelement ...hss \dostoplistattributes }}
                                                  \endgraf \nointerlineskip ...
...
l.208 \placepublications[criterium=all]


Any thoughts appreciated!

-Sanjoy

`Intellectual property is intellectual theft.'
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: active urls in bibliographies
  2007-04-24  2:44 active urls in bibliographies Sanjoy Mahajan
@ 2007-04-24  7:26 ` Tobias Burnus
  2007-04-24  7:57   ` Taco Hoekwater
                     ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Tobias Burnus @ 2007-04-24  7:26 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Sanjoy,

Sanjoy Mahajan wrote:
> I tried to force an active hyperlink to be part of a bibliography entry.
> If the bibliography style file for that entry type uses it, maybe it
> will work.  But I wanted to put it in the 'note' field so that I could
> add it to most entries.  e.g.
>
> @Book{HPL:2000,
>   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},
>   note =	 {http://www.nap.edu}
> }
>   
Well, I use
   url = {http://www.nap.edu}
and have in my local environment something like:

%copied from bibl-a*.tex
\setuppublicationlayout[article]{% in your case book
[...]
   \insertdoi{ doi:}{.}{}%
   \insertbiburl{ }{.}{}% <--- added
[...]
}

In addition, you need to patch t-bib.tex. I have the following changes
in mine which should be also (in some form) in the next release of
Taco's module:

--- /usr/share/texmf/tex/context/bib/t-bib.tex  2006-12-08 12:46:44.000000000 +0100
+++ /system/home/tob/texmf/tex/context/bib/t-bib.tex    2007-04-19 13:42:17.000000000 +0200
@@ -497,10 +497,15 @@

 \processcommacommand[\bibcommandlist]\simplebibdef

+\def\insertdoi#1#2#3%
+     {{\bibdoifelse{\@@pb@doi}%
+        {\edef\ascii{\@EA\detokenize\@EA{\@@pb@doi}}%
+         #1\expanded{\gotoDOI{\@@pb@thekey}{\ascii}}#2}{#3}}}
+
 \def\insertbiburl#1#2#3%
-    {{\bibdoifelse{\@@pb@biburl}%
-       {\edef\ascii{\@EA\detokenize\@EA{\@@pb@biburl}}%
-        #1\@EA\hyphenatedurl\@EA{\ascii}#2}{#3}}}
+     {{\bibdoifelse{\@@pb@biburl}%
+        {\edef\ascii{\@EA\detokenize\@EA{\@@pb@biburl}}%
+         #1\expanded{\gotoURL{\@@pb@thekey}{\ascii}}#2}{#3}}}

 \def\insertmonth#1#2#3%
   {\bibdoifelse{\@@pb@month}%
@@ -641,7 +646,7 @@
        \ifnum \numexpr\scratchcounter-1\relax<#2\relax
           \getvalue{\??pv data#1}##1%
           \ifnum \scratchcounter=#2\relax
-             \ifnum\etallimitcounter<\commalistsize \bibalternative{#1etaltext}\fi
+             \ifnum\etallimitcounter<\commalistsize\relax \bibalternative{#1etaltext}\fi
           \else \ifnum\numexpr\scratchcounter+1 = #2\relax
              \ifnum \commalistsize > \plustwo  \bibalternative\c!finalnamesep
              \else                            \bibalternative\c!lastnamesep \fi
@@ -1636,7 +1641,9 @@

 \def\gotoDOI#1#2%
   {\ifbibinteractionelse
-     {\useURL[bibfoo#1][http://dx.doi.org/#2]\goto{\url[bibfoo#1]}[url(bibfoo#1)]}
+     {\useURL[bibfooDoi#1][#2]%
+      \useURL[bibfoo#1][http://dx.doi.org/#2]%
+      \goto{\url[bibfooDoi#1]}[url(bibfoo#1)]}
      {\hyphenatedurl{#2}}}

 \def\bibdoiref[#1]%

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: active urls in bibliographies
  2007-04-24  7:26 ` Tobias Burnus
@ 2007-04-24  7:57   ` Taco Hoekwater
  2007-04-25  1:30   ` Sanjoy Mahajan
  2007-04-25 14:58   ` Sanjoy Mahajan
  2 siblings, 0 replies; 5+ messages in thread
From: Taco Hoekwater @ 2007-04-24  7:57 UTC (permalink / raw)
  To: mailing list for ConTeXt users



Tobias Burnus wrote:
> 
> In addition, you need to patch t-bib.tex. I have the following changes
> in mine which should be also (in some form) in the next release of
> Taco's module:

There will be a bugfix release a week or two after this year's
eurobachotex, with this patch included as well as a number of
other items in my backlog.

Best wishes,

Taco
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: active urls in bibliographies
  2007-04-24  7:26 ` Tobias Burnus
  2007-04-24  7:57   ` Taco Hoekwater
@ 2007-04-25  1:30   ` Sanjoy Mahajan
  2007-04-25 14:58   ` Sanjoy Mahajan
  2 siblings, 0 replies; 5+ messages in thread
From: Sanjoy Mahajan @ 2007-04-25  1:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Tobias,

Thanks for the patches.  I put them together but didn't get a url at
all in the reference.  But, the patch to t-bib.tex caused 'patch' to
complain:

  patching file t-bib.tex
  patch: **** malformed patch at line 3: --- 498,497 ----

So I patched it by hand, and maybe the problem lies in that I messed
up the hand patching of t-bib.tex.  Could you send me the patch
(either on- or off-list) as an attachment?  Then I'll try again, and
if that fails I'll post a minimal example and only wikify once it's
working.

-Sanjoy

`Not all those who wander are lost.' (J.R.R. Tolkien)
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: active urls in bibliographies
  2007-04-24  7:26 ` Tobias Burnus
  2007-04-24  7:57   ` Taco Hoekwater
  2007-04-25  1:30   ` Sanjoy Mahajan
@ 2007-04-25 14:58   ` Sanjoy Mahajan
  2 siblings, 0 replies; 5+ messages in thread
From: Sanjoy Mahajan @ 2007-04-25 14:58 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Thanks for the minimal example you sent me (offlist), which worked
great.

> If your question is of interest to others as well, please add an
> entry to the Wiki!

I modified it only slightly and have wikified it at
<http://wiki.contextgarden.net/Bibliography#Active_URLs>.  When the
patched t-bib.tex is part of the ConTeXt release, I'll modify the wiki
directions accordingly.

-Sanjoy

`Not all those who wander are lost.' (J.R.R. Tolkien)
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-04-25 14:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-24  2:44 active urls in bibliographies Sanjoy Mahajan
2007-04-24  7:26 ` Tobias Burnus
2007-04-24  7:57   ` Taco Hoekwater
2007-04-25  1:30   ` Sanjoy Mahajan
2007-04-25 14:58   ` Sanjoy Mahajan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).