ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* bib: authornum
@ 2010-02-12  9:21 Thomas A. Schmitz
  2010-02-12 12:38 ` Taco Hoekwater
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas A. Schmitz @ 2010-02-12  9:21 UTC (permalink / raw)
  To: mailing ConTeXt users list for

Hi,

sorry if this is yet another bib question: the "authornum" cite style is a recent addition. It doesn't accept all the setup functions that other styles (such as "authornum") do. The one thing I miss most ATM is the "andtext" option between a publication with several authors. It takes the form Author1,Author2 (just a comma, no space; this can be configured in authornum). I tried adapting the code in bibl-tra.mkiv l. 1506-1515, but failed miserably. Would it be possible to add the configurable andtext to authornum?

Thanks, and best

Thomas
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: bib: authornum
  2010-02-12  9:21 bib: authornum Thomas A. Schmitz
@ 2010-02-12 12:38 ` Taco Hoekwater
  2010-02-12 13:12   ` Thomas A. Schmitz
  0 siblings, 1 reply; 5+ messages in thread
From: Taco Hoekwater @ 2010-02-12 12:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users



Thomas A. Schmitz wrote:
> Hi,
> 
> sorry if this is yet another bib question: the "authornum" cite style
> is a recent addition. It doesn't accept all the setup functions that
> other styles (such as "authornum") do. The one thing I miss most ATM
> is the "andtext" option between a publication with several authors.
> It takes the form Author1,Author2 (just a comma, no space; this can
> be configured in authornum). I tried adapting the code in
> bibl-tra.mkiv l. 1506-1515, but failed miserably. Would it be
> possible to add the configurable andtext to authornum?

Hm, can you try this redefinition?

\unprotect
\def\bibinsertrefsep
  {\ifconditional\firstbibrefsep
     \setfalse\firstbibrefsep
   \else \ifnum\recurselevel=\bibitemcounter\relax
        \bibalternative\c!lastpubsep
    \else
        \bibalternative\c!pubsep
    \fi
   \fi}
\protect

___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: bib: authornum
  2010-02-12 12:38 ` Taco Hoekwater
@ 2010-02-12 13:12   ` Thomas A. Schmitz
  2010-02-12 15:10     ` Taco Hoekwater
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas A. Schmitz @ 2010-02-12 13:12 UTC (permalink / raw)
  To: mailing list for ConTeXt users


On Feb 12, 2010, at 1:38 PM, Taco Hoekwater wrote:

> Hm, can you try this redefinition?
> 
> \unprotect
> \def\bibinsertrefsep
>  {\ifconditional\firstbibrefsep
>     \setfalse\firstbibrefsep
>   \else \ifnum\recurselevel=\bibitemcounter\relax
>        \bibalternative\c!lastpubsep
>    \else
>        \bibalternative\c!pubsep
>    \fi
>   \fi}
> \protect

Thanks Taco - that doesn't it yet. Maybe a small text file can help?

All best

Thomas

\unprotect
\def\bibinsertrefsep
 {\ifconditional\firstbibrefsep
    \setfalse\firstbibrefsep
  \else \ifnum\recurselevel=\bibitemcounter\relax
       \bibalternative\c!lastpubsep
   \else
       \bibalternative\c!pubsep
   \fi
  \fi}
\protect

\setuppublications[state=start,
                  sorttype=bbl,
                  refcommand=authornum,
                  numbering=yes]

\setupcite
       [authornum]
       [pubsep={, },
        andtext={ !!!! },
        namesep={ //// },
        lastpubsep={ XXXX },
        compress=no,
        inbetween={ ???? },
        left={[[[},
        right={)))}]


\startpublication[k=gowpagegp,t=book,
a={{Gow},{Page}},y=1968,
n=5,s=GP68]
\author[]{A.~S.~F.}[A.~S.~F.]{}{Gow}
\author[]{Denys}[D.]{}{Page}
\pubyear{1968}
\title{The Greek Anthology{\em , 2} The Garland of Philip}
\city{Cambridge (Engl.)}
\pubname{Cambridge UP}
\stoppublication

\setuppublicationlist[samplesize={VSdK90},totalnumber=1]

\starttext

\cite[gowpagegp]

\page

\placepublications[criterium=all]

\stoptext

___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: bib: authornum
  2010-02-12 13:12   ` Thomas A. Schmitz
@ 2010-02-12 15:10     ` Taco Hoekwater
  2010-02-12 15:39       ` Thomas A. Schmitz
  0 siblings, 1 reply; 5+ messages in thread
From: Taco Hoekwater @ 2010-02-12 15:10 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 315 bytes --]

Hi,

Attached is a fairly elaborate patch and test file, please try.

If you are happy with it, it can probably go to the core
(with a similar patch for bibl-tra.mkii). Besides the
\cite[authornum] case, it also adds 'lastpubsep' support
to the 'short forms', like \cite[num] and \cite[short].

Best wishes,
Taco



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: bib.tex --]
[-- Type: text/x-tex; name="bib.tex", Size: 1927 bytes --]


\usemodule[bib]

\unprotect

\newcount\bibrefsep

\def\bibinsertrefsep
 {\advance\bibrefsep\plusone
  \ifconditional\firstbibrefsep
    \setfalse\firstbibrefsep
   \else \ifnum\bibrefsep=\bibitemcounter\relax
       \bibrefsep=0
       \bibalternative\c!lastpubsep
   \else
       \bibalternative\c!pubsep
   \fi
  \fi }

\def\dobibauthornumref#1%
 {\bibinsertrefsep
  \doifbibreferencefoundelse{#1}
    {\begingroup
     \@EA\setcurrentbibauthor\@EA{\bibgetvara{#1}}%
     \currentbibauthor
     \bibalternative\c!inbetween
     \setuppublications[\c!refcommand=num]%
     \cite[#1]%
     \endgroup}
    {\unknownreference{#1}}}


\def\bibauthornumref[#1]%
  {\getcommalistsize[#1]%
   \global\bibitemcounter\commalistsize
   \bibresetrefsep
   \bibalternative\v!left
   \processcommalist[#1]\dobibauthornumref 
   \bibalternative\v!right }

\protect

\setuppublications[state=start,
                  sorttype=bbl,
                  refcommand=authornum,
                  numbering=yes]

\setupcite
       [authornum]
       [pubsep={, },
        lastpubsep={ and },
        andtext={ \& },
        compress=no,
        inbetween={: },
        left={(},
        right={)}]


\startpublication[k=gowpagegp,t=book,
a={{Gow},{Page}},y=1968,
n=5,s=GP68]
\author[]{A.~S.~F.}[A.~S.~F.]{}{Gow}
\author[]{Denys}[D.]{}{Page}
\pubyear{1968}
\title{The Greek Anthology{\em , 2} The Garland of Philip}
\city{Cambridge (Engl.)}
\pubname{Cambridge UP}
\stoppublication

\startpublication[k=gowpagegp2,t=book,
a={{Gxow},{Pxage}},y=1968,
n=5,s=GP68]
\author[]{A.~S.~F.}[A.~S.~F.]{}{Gxow}
\author[]{Denys}[D.]{}{Pxage}
\pubyear{1968}
\title{The Greek Anthology{\em , 2} The Garland of Philip}
\city{Cambridge (Engl.)}
\pubname{Cambridge UP}
\stoppublication

\setuppublicationlist[samplesize={VSdK90},totalnumber=1]

\starttext

\loggingall

\cite[gowpagegp]

\cite[gowpagegp,gowpagegp2]

\page

\placepublications[criterium=all]

\stoptext

[-- Attachment #3: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

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

* Re: bib: authornum
  2010-02-12 15:10     ` Taco Hoekwater
@ 2010-02-12 15:39       ` Thomas A. Schmitz
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas A. Schmitz @ 2010-02-12 15:39 UTC (permalink / raw)
  To: mailing list for ConTeXt users


On Feb 12, 2010, at 4:10 PM, Taco Hoekwater wrote:

> Hi,
> 
> Attached is a fairly elaborate patch and test file, please try.
> 
> If you are happy with it, it can probably go to the core
> (with a similar patch for bibl-tra.mkii). Besides the
> \cite[authornum] case, it also adds 'lastpubsep' support
> to the 'short forms', like \cite[num] and \cite[short].
> 
> Best wishes,
> Taco

Hi Taco,

first tests both with small test files and the real-world that I'm currently typesetting are successful: looks like your patch works! Would be wonderful if this could go to the core. Thanks so much!

All best

Thomas
___________________________________________________________________________________
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
___________________________________________________________________________________


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

end of thread, other threads:[~2010-02-12 15:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-12  9:21 bib: authornum Thomas A. Schmitz
2010-02-12 12:38 ` Taco Hoekwater
2010-02-12 13:12   ` Thomas A. Schmitz
2010-02-12 15:10     ` Taco Hoekwater
2010-02-12 15:39       ` Thomas A. Schmitz

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).