Re: [NTG-context] creating own hyperlinks in bibliography

2010-08-29 Thread Mojca Miklavec
On Sat, Aug 28, 2010 at 09:02, Otared Kavian wrote:
 Hi Mojca,
 Could you please post a full example where your newly defined biblio field
 works?

Sure.

In reality it's just two things that you need to do:
- \newbibfield[nameofyourkey]
- you need to change \setuppublicationlayout for all the
books/articles/etc. where you want to use that field

First a simple example of a new entity (webpage), not a new biblio
field. All the fields are already known though.

\setuppublicationlayout[webpage]{%
\inserttitle{\bgroup\it }{\egroup. }{}%
\inserturl{}{}{}%
}
\startpublication
[k=ESFRI,t=webpage,u=http://cordis.europa.eu/esfri/]
\biburl{http://cordis.europa.eu/esfri/}
\title{CORDIS: European Strategy Forum on Research Infrastructures}
\stoppublication

Here's an example of a new entity with a new field. I defined a new
entity conference with two new fields conference for conference
name and cobissid for unique slovenian identification of
publications:

\newbibfield[conference]
\newbibfield[cobissid]

% the date is formatted in Slovenian way (I just cloned one of my old examples):
\setuppublicationlayout[conference]{%
\insertartauthors{}{\unskip. }{}%
\insertarttitle{\bgroup }{\egroup. }{}%
\insertconference{\bgroup \it}{\egroup\insertday{, }{.
}{}\insertmonth{}{\ }{}\insertpubyear{}{}{}. }{}%
\insertcobissid{[\sc cobiss.si-id\ }{]}{}%
}

\startpublication
[k=biblioexample,
 t=conference,
 y=2010,
 s=,
 u=,
]
\artauthor[]{Otared}[O.]{}{Kavian}
\arttitle{Something about bibliography}
\conference{4th \ConTeXt\ meeting}
\pubyear{2010}\month{September}\day{13-19}
\cobissid{333}
\stoppublication

Now that I know how to do it, I would also add the following lines
which redefine the way how \insertcobissid works, but this is fully
optional and you would normally not need to do it:

\unprotect
\def\bibinsertcobissid#1#2#3%
 {{\bibdoifelse{\@@p...@cobissid}%
 {\edef\asci...@ea\detokenize\@EA{\@@p...@cobissid}}%
  #1\expanded{\gotoCOBISS{\@@p...@thekey}{\ascii}}#2}{#3}}}
\protect

\def\gotoCOBISS#1#2%
 {\ifbibinteractionelse
   
{\useURL[bibfoo#1][http://www.cobiss.si/scripts/cobiss?command=DISPLAYbase=cobibrid=#2]%
\goto{#2}[url(bibfoo#1)]}%
   {#2}}

Note that if you want to add a field to book, you need to completely
rewrite the part with
\setuppublicationlayout[book]{%
but that depends a lot on the style you want to use. You would
normally check one of tex files that comes with bib module and
copy-paste from that one. This is my example where I wanted to add
cobissid and isbn (and maybe other modifications that I don't
remember), but your example would probably differ considerably, so do
not blindly copy-paste from this example.

\newif\ifeditedbook
\setuppublicationlayout[book]{%
   \insertauthors{}{\unskip. }{\inserteditors{}{\unskip, editor%
 \ifnum\getvalue{edi...@num} 1 s\fi.%
 \ \global\editedbooktrue
 }{\insertthekey{}{\unskip. }{}}}%
   \inserttitle
{\bgroup\it }%
{\/\egroup
 \ifeditedbook.%
   \global\editedbookfalse
   \insertvolume
{ Number~}%
{\insertseries
{ in~\bgroup}%
{\egroup. }%
{\insertcrossref{ in~}{}{. }}}%
{\insertseries{ }{.}{} }%
\else
   \insertcrossref
{\insertchap{, }{}{}%
 \insertpages{, pages }{. }{. }%
 \insertvolume{Volume~}{ of~}{}%
 }%
{}%
{\insertvolume
   {, volume~}%
   {\insertseries
  { of~\bgroup\it}%
  {\egroup}
  {}}
   {}%
   \insertchap{, }{}{}%
   \insertpages{, pages }{.}{.}%
}%
\fi}%
{}%
   \insertpublisher
{ }%
{\insertedition{, }{ edition}{}%
 \insertpubyear{, }{.}{.}}%
{\insertedition{, }{ edition}{}%
 \insertpubyear{, }{.}{.}}%
   \insertpages{ }{p.}{}%
   \insertisbn{ {\sc isbn}: \bgroup\os}{\egroup.}{}%
   \insertcobissid{ {\sc cobiss.si-id}: \bgroup\os}{\egroup.}{}%
   \insertdoi{ {\sc doi}: }{.}{}%
   \insertnote{ }{.}{}%
}


 In some occasions I have had analogous needs (references to papers on
 arxive.org for instance, or other repositories. It would be handy to know
 how one can add such bibliography fields.

Mojca
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net

Re: [NTG-context] creating own hyperlinks in bibliography

2010-08-28 Thread Otared Kavian
Hi Mojca, 

Could you please post a full example where your newly defined biblio field 
works?
In some occasions I have had analogous needs (references to papers on 
arxive.org for instance, or other repositories. It would be handy to know how 
one can add such bibliography fields.

Best regards: OK

On 27 août 2010, at 18:02, Mojca Miklavec wrote:

 On Fri, Aug 27, 2010 at 15:40, Taco Hoekwater wrote:
 On 08/27/2010 01:00 PM, Mojca Miklavec wrote:
 
 Dear Taco,
 
 I would like to add some additional fields to bibliography.
 
 I would like to have
 
 \newbibfield[cobissid]
 
 \startpublication
 [...]
 ...
 \cobissid{70615}
 \stoppublication
 
 and then I would modify \setuppublicationlayout[book] to transform the
 number written above into cobiss.si-id: 70615 pointing to the
 following URL:
 
 http://www.cobiss.si/scripts/cobiss?command=DISPLAYbase=cobibrid=70615lani=EN
 
 The simple answer is: search for DOI in the bib module and do whatever
 that does. But, just in case:
 
  \unprotect
  \newbibfield[cobissid]
  \def\bibinsertcobissid#1#2#3%
{{\bibdoifelse{\@@p...@cobissid}%
   {\edef\asci...@ea\detokenize\@EA{\@@p...@cobissid}}%
#1\expanded{\goto{\@@p...@thekey}{\ascii}}#2}{#3}}}
   \protect
 
 should come close to what you had in mind, you hyst have to tweak the
 \goto arguments a bit.
 
 Thank you very much. It was of extreme help. I'm now using
 
 \unprotect
 \def\bibinsertcobissid#1#2#3%
  {{\bibdoifelse{\@@p...@cobissid}%
  {\edef\asci...@ea\detokenize\@EA{\@@p...@cobissid}}%
   #1\expanded{\gotoCOBISS{\@@p...@thekey}{\ascii}}#2}{#3}}}
 \protect
 
 \def\gotoCOBISS#1#2%
  {\ifbibinteractionelse

 {\useURL[bibfoo#1][http://www.cobiss.si/scripts/cobiss?command=DISPLAYbase=cobibrid=#2]%
 \goto{#2}[url(bibfoo#1)]}%
{#2}}
 
 and then
 
   \insertcobissid{ {\sc cobiss.si-id}: }{.}{}%
 
 (Just for a reference in case that any other Cobiss user will ever
 want to repeat the same.)
 
 Now I have just remembered something that has bothered me earlier, but
 I have never mentioned it so far. When interaction is off, DOI gets
 written in plain text which is perfectly OK, but when interaction is
 on, it gets written in typewriter font as if it was URL. I see no
 reason for writing out DOI number in typewriter font since it's not
 really URL on its own, it only points to some URL. This is exactly the
 modification that I have done above for COBISS numbers. What do you
 think about that aspect?
 
 Thank you very much,
Mojca
 ___
 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  : http://foundry.supelec.fr/projects/contextrev/
 wiki : http://contextgarden.net
 ___

%%
Otared Kavian
Département de Mathématiques
Université de Versailles Saint-Quentin
Bâtiment Fermat
45 aveue des Etats Unis
78035 Versailles cedex

Téléphone: +33 1 39 25 46 42
Secrétariat: +33 1 39 25 46 44 
Secrétariat: +33 1 39 25 46 46

e-mail: otared.kav...@math.uvsq.fr



___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] creating own hyperlinks in bibliography

2010-08-27 Thread Mojca Miklavec
Dear Taco,

I would like to add some additional fields to bibliography. I know
that I have already asked the same question twice (for url and doi)
and each time it has been built into the core functionality, while my
current request is too local to do that.

I would like to have

\newbibfield[cobissid]

\startpublication
[...]
...
\cobissid{70615}
\stoppublication

and then I would modify \setuppublicationlayout[book] to transform the
number written above into cobiss.si-id: 70615 pointing to the
following URL:

http://www.cobiss.si/scripts/cobiss?command=DISPLAYbase=cobibrid=70615lani=EN

That is very similar to what DOI does at the moment, but while DOI is
quite international, COBISS ID is really local, but it is *the* system
used in the whole country.

Is there any simple  safe way to achieve that?

Thank you very much,
Mojca
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] creating own hyperlinks in bibliography

2010-08-27 Thread Taco Hoekwater

On 08/27/2010 01:00 PM, Mojca Miklavec wrote:

Dear Taco,

I would like to add some additional fields to bibliography. I know
that I have already asked the same question twice (for url and doi)
and each time it has been built into the core functionality, while my
current request is too local to do that.

I would like to have

\newbibfield[cobissid]

\startpublication
 [...]
 ...
 \cobissid{70615}
\stoppublication

and then I would modify \setuppublicationlayout[book] to transform the
number written above into cobiss.si-id: 70615 pointing to the
following URL:
 
http://www.cobiss.si/scripts/cobiss?command=DISPLAYbase=cobibrid=70615lani=EN

That is very similar to what DOI does at the moment, but while DOI is
quite international, COBISS ID is really local, but it is *the* system
used in the whole country.

Is there any simple  safe way to achieve that?


The simple answer is: search for DOI in the bib module and do whatever
that does. But, just in case:

  \unprotect
  \newbibfield[cobissid]
  \def\bibinsertcobissid#1#2#3%
{{\bibdoifelse{\@@p...@cobissid}%
   {\edef\asci...@ea\detokenize\@EA{\@@p...@cobissid}}%
#1\expanded{\goto{\@@p...@thekey}{\ascii}}#2}{#3}}}
   \protect

should come close to what you had in mind, you hyst have to tweak the
\goto arguments a bit.

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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] creating own hyperlinks in bibliography

2010-08-27 Thread Mojca Miklavec
On Fri, Aug 27, 2010 at 15:40, Taco Hoekwater wrote:
 On 08/27/2010 01:00 PM, Mojca Miklavec wrote:

 Dear Taco,

 I would like to add some additional fields to bibliography.

 I would like to have

 \newbibfield[cobissid]

 \startpublication
     [...]
     ...
     \cobissid{70615}
 \stoppublication

 and then I would modify \setuppublicationlayout[book] to transform the
 number written above into cobiss.si-id: 70615 pointing to the
 following URL:

 http://www.cobiss.si/scripts/cobiss?command=DISPLAYbase=cobibrid=70615lani=EN

 The simple answer is: search for DOI in the bib module and do whatever
 that does. But, just in case:

  \unprotect
  \newbibfield[cobissid]
  \def\bibinsertcobissid#1#2#3%
    {{\bibdoifelse{\@@p...@cobissid}%
       {\edef\asci...@ea\detokenize\@EA{\@@p...@cobissid}}%
        #1\expanded{\goto{\@@p...@thekey}{\ascii}}#2}{#3}}}
   \protect

 should come close to what you had in mind, you hyst have to tweak the
 \goto arguments a bit.

Thank you very much. It was of extreme help. I'm now using

\unprotect
\def\bibinsertcobissid#1#2#3%
  {{\bibdoifelse{\@@p...@cobissid}%
  {\edef\asci...@ea\detokenize\@EA{\@@p...@cobissid}}%
   #1\expanded{\gotoCOBISS{\@@p...@thekey}{\ascii}}#2}{#3}}}
\protect

\def\gotoCOBISS#1#2%
  {\ifbibinteractionelse

{\useURL[bibfoo#1][http://www.cobiss.si/scripts/cobiss?command=DISPLAYbase=cobibrid=#2]%
 \goto{#2}[url(bibfoo#1)]}%
{#2}}

and then

   \insertcobissid{ {\sc cobiss.si-id}: }{.}{}%

(Just for a reference in case that any other Cobiss user will ever
want to repeat the same.)

Now I have just remembered something that has bothered me earlier, but
I have never mentioned it so far. When interaction is off, DOI gets
written in plain text which is perfectly OK, but when interaction is
on, it gets written in typewriter font as if it was URL. I see no
reason for writing out DOI number in typewriter font since it's not
really URL on its own, it only points to some URL. This is exactly the
modification that I have done above for COBISS numbers. What do you
think about that aspect?

Thank you very much,
Mojca
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___