ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Taco Hoekwater <taco@elvenkind.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: bib: authornum
Date: Fri, 12 Feb 2010 16:10:26 +0100	[thread overview]
Message-ID: <4B756F62.6040005@elvenkind.com> (raw)
In-Reply-To: <5AA4FE66-ED34-4E48-ADBA-67D5FEE4DB8D@uni-bonn.de>

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

  reply	other threads:[~2010-02-12 15:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-12  9:21 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 [this message]
2010-02-12 15:39       ` Thomas A. Schmitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B756F62.6040005@elvenkind.com \
    --to=taco@elvenkind.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).