summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/bib/t-bib.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/bib/t-bib.tex')
-rw-r--r--Master/texmf-dist/tex/context/bib/t-bib.tex1328
1 files changed, 938 insertions, 390 deletions
diff --git a/Master/texmf-dist/tex/context/bib/t-bib.tex b/Master/texmf-dist/tex/context/bib/t-bib.tex
index 82cdba9935b..3c17a52b756 100644
--- a/Master/texmf-dist/tex/context/bib/t-bib.tex
+++ b/Master/texmf-dist/tex/context/bib/t-bib.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=t-bib,
-%D version=2005.01.04,
+%D version=2006.08.08,
%D title=\CONTEXT\ Publication Module,
%D subtitle=Publications,
%D author=Taco Hoekwater,
@@ -9,35 +9,98 @@
%C
%C Donated to the public domain.
-\usemodule[bibltx] % bibtex files can contain latex left-overs
-%D Slightly adapted by HH (2005/01). For \BIBTEX\ relate questions,
-%D contact Taco, if you expect interference with core macros, bother
-%D Hans. This file will be cleaned up in due time.
+%D The original was developed independantly by Taco Hoekwater while still working for Kluwer
+%D Academic publishers (it still used the dutch interface then). Development continued after
+%D he left Kluwer, and in Januari 2005, the then already internationalized file was merged
+%D with the core distribution by Hans Hagen. The current version is once again by Taco.
%D
-%D Documentation and additional resources can be found at
-%D Taco's website: \url{tex.aanhet.net}.
+%D More documentation and additional resources can be found on the contextgarden:
+%D \hyphenatedurl{http://wiki.contextgarden.net//Bibliography}.
-%D \subject{DONE}
+%D \subject{DONE (dd/mm/yyyy)}
%D
%D \startitemize
-%D \item minor bugfixes today (25/6)
-%D \item add finalnamesep support for Oxford comma (17/9)
-%D \item add \insert... for: doi, eprint, howpublished (17-19/9)
-%D \item minor fix (26/5/2004):
-%D \item add author definition (and associated system variable)
+%D \item add author definition (and associated system variable) (26/05/2005)
+%D \item add finalnamesep support for Oxford comma (17/09/2005)
+%D \item add \type{\insert...} for: doi, eprint, howpublished (19/09/2005)
+%D \item allow a defaulted \type{\setupcite} (19/11/2005)
+%D \item renamed citation type 'number' to 'serial' (19/11/2005)
+%D \item better definition of \type{\inverted...author} (19/11/2005)
+%D \item don't reset [numbercommand] in \type {\setuppublication} by default (20/11/2005)
+%D \item don't disable other \type {\setuppublication} keys if alternative is present (20/11/2005)
+%D \item drop \type{\sanitizeaccents} (20/11/2005)
+%D \item added \type{\nocite} and \type{\cite[none]} (21/11/2005)
+%D \item added headtext for it (23/11/2005)
+%D \item make \type{\cite[url]} and \type{\cite[doi]} interactive (23/11/2005)
+%D \item make right-aligned labels in the list work even when autohang=no
+%D \item use 'et al.' instead of 'et.al.'. Pointed out by Peter Münster (30/12/2005)
+%D \item added headtext for cz (31/12/2005)
+%D \item Keep whitespace after \type{\cite} with single argument (31/12/2005)
+%D \item Fix broken \type{\cite{}} support (31/12/2005)
+%D \item Use \type{\readfile} inside \type{\usepublications} instead of \type{\readsysfile} (12/01/2006)
+%D \item Use \type{\currentbibyear} and \type{\currentbibauthor} instead of \type{\YR} and \type{\AU} (05/02/2006)
+%D \item Fix compressed version of authoryear style (05/02/2006)
+%D \item Rename the clashing data fields \type{\url} and \type{\type} to \type{\biburl} and \type{\bibtype} (05/02/2006)
+%D \item Added two french bibl files from Renaud Aubin (06/02/2006)
+%D \item Five new bib class and eight extra bib fields, for IEEEtran (07/02/2006)
+%D \item French keyword translation, provided by Renaud (08/02/2006)
+%D \item fix underscores in undefined keys (22/02/2006)
+%D \item Destroy interactivity in labels of the publication list (13/03/2006)
+%D \item fix multi-cite list compression (11/4/2006)
+%D \item fix \type{\getcitedata} (11/4/2006)
+%D \item magic for chapter bibs (18-25/4/2006)
+%D \item language setting (25/4/2006)
+%D \item use \type{\hyphenatedurl} for \type{\inserturl} (25/4/2006)
+%D \item Add \type{\docitation} to \type{\nocite}(26/4/2006)
+%D \item patents can have numbers, added to bst files (26/4/2006)
+%D \item \type{\docitation} needs a \type{\iftrialtypesetting} (27/4/2006)
+%D \item \type{\filllocalpublist}'s loop is bound by definedness, not resolvedness (27/4/2006)
+%D \item \type{\setuppublications[monthconversion=]} added (15/5/2006)
+%D \item use \type{\undefinedreference} instead of bare question marks (15/5/2006)
+%D \item add grouping around \type{\placepublications} commands (16/5/2006)
+%D \item fix a bug in \type{\cite{<item>}} (17/5/2006)
+%D \item support \type{\cite[authornum]} (18/5/2006)
+%D \item make \type{\cite} unexpandable (20/6/2006)
+%D \item allow hyperlinks in author\&year combo's
+%D (cite list compression has to be off) (20/6/2006)
+%D \item fix duplicate labels for per-chapter style (20/6/2006)
+%D \item allow \type{\setupcite[interaction=(start|stop)]}
+%D \item fix the item number in the publication list with 'numbering=yes' (22/6/2006)
+%D \item make the default criterium for \type{\placepublications} be \type{previous} (23/6/2006)
+%D \item fix \type{\normalauthor} and \type{\normalshortauthor} spacing (29/6/2006)
+%D \item do not typeset empty arguments to \type{\typesetapublication} (29/6/2006)
+%D \item add \type{symbol=none} to \type{\setuplist} in unnumbered
+%D mode to prevent typesetting of bare numbers (29/6/2006)
+%D \item remove two incorrect spaces from bibl-num.tex (1/7/2006)
+%D \item reset font styles within \type{\cite}, so that font switches
+%D in \type{left} stay in effect (12/7/2006)
+%D \item guard added against loading bbl files multiple times (13/7/2006)
+%D \item fix \type{\cite[num]} with compression is on. (14/7/2006)
+%D \item test \type{\iflocation} before deciding to use the
+%D interactive version of cite (18/7/2006)
+%D \item support \type{\setupcite[authoretallimit=1]} (18/7/2006)
+%D \item support use of \type{\cite} within titles and captions by
+%D saveguarding the list item extraction and reference placement
+%D code (19/7/2006)
+%D \item support \type{\setuppublicationlist[title=\chapter]} (4/8/2006)
+%D \item use the expansion of \type{\headtext{pubs}} (4/8/2006)
+%D \item hook added for repeated authors in publication list
+%D \type{\setuppublicationlist[artauthorcommand=\mythreeargscommand]}
+%D (4/8/2006)
+%D \item make the bracketed arguments of \type{\artauthor}, \type{\author}
+%D and \type{\editor} (bbl commands) optional (4/8/2006)
+%D \item the constants \type{sorttype}, \type{compress} and
+%D \type{autohang} have moved to the core (8/8/2006)
+%D \item bibtex is now registered as a program to be run by texexec (8/8/2006)
%D \stopitemize
-
-%D \subject{TODO}
+%D
+%D \subject{WISHLIST}
%D
%D \startitemize
+%D \item link back from publication list to citation
%D \item export \type {\citation{<cited item>}}
-%D \item export a \type {\bibalternative{lastpubsep}} from BST instead of 'and'
-%D \item don't reset [numbercommand] in \type {\setuppublication} by default
-%D \item sort out different APS versions: PR A/B/L vs. RPM
-%D \item (implement sub-options? / \type {\setupcitationstyle} ?)
-%D \item worry about localization at same time
-%D \item add hyperlinking to the doi->URL and \type {\cite}->list, in general
+%D \item support mlbibtex
%D \item don't load the whole lot, but filter entries instead
%D \stopitemize
@@ -47,6 +110,7 @@
\definesystemvariable {pv} % PublicationVariable
\definesystemvariable {pb} % PuBlication
+
\definemessageconstant {bib}
\definefileconstant {bibextension} {bbl}
@@ -55,7 +119,7 @@
\startmessages all library: bib
title: publications
1: file -- not found, unknown style ignored
- 2: file -- not found, don't forget to run bibtex
+ 2: file -- not found, waiting for bibtex
3: wrote a new auxiliary file \jobname.aux
4: loading database from --
5: warning: cite argument -- on \the\inputlineno
@@ -67,10 +131,6 @@
\startconstants dutch english
database: database database
- sorttype: sorttype sorttype
- compress: compress compress
- autohang: autohang autohang
- % author: author author
artauthor: artauthor artauthor
editor: editor editor
authoretallimit: authoretallimit authoretallimit
@@ -82,6 +142,8 @@
authoretaltext: authoretaltext authoretaltext
artauthoretaltext: artauthoretaltext artauthoretaltext
editoretaltext: editoretaltext editoretaltext
+ otherstext: otherstext otherstext
+ andtext: andtext andtext
totalnumber: totalnumber totalnumber
firstnamesep: firstnamesep firstnamesep
vonsep: vonsep vonsep
@@ -98,69 +160,117 @@
\stopconstants
\startvariables dutch english
-
german czech
italian romanian
+ french
title: titel title
titel titul
titolo titlu
+ titre
short: kort short
kurz short
short short
+ short
cite: cite cite
cite cite
cite cite
+ cite
bbl: bbl bbl
bbl bbl
bbl bbl
+ bbl
bib: bib bib
bib bib
bib bib
+ bib
author: auteur author
autor autor
autore autor
+ auteur
\stopvariables
+\def\biblistname{pubs} % for compatibility
+
+%D how to load the references. There is some new stuff here
+%D to support Idris' (incorrect :-)) use of projects
+
+\let\preloadbiblist\relax
+
+
+\ifx\currentcomponent\v!text
+ % single file
+ \edef\temp{\the\everystarttext}%
+ \ifx\temp\empty
+ % post-starttext
+ \def\preloadbiblist{\dousepublications\jobname }%
+ \else
+ % pre-starttext
+ \appendtoks \dousepublications\jobname \to \everystarttext
+ \fi
+ %
+\else \ifx\currentcomponent\v!project
+ % a project file, have to set up the partial products!
+ \def\startproduct #1 %
+ {\doateverystarttext
+ \dousepublications{#1}%
+ \donextlevel\v!product\currentproduct
+ \doexecutefileonce\doexecutefileonce
+ \donotexecutefile\doexecutefile#1\\}%
+ %
+\else \ifx\currentcomponent\v!product
+ % a product file
+ \def\preloadbiblist{\dousepublications\jobname }%
+ %
+\else
+ % a component? not sure what to do
+ \def\preloadbiblist{\dousepublications\jobname }%
+ %
+\fi \fi \fi
+
+\definelist[pubs]
+\setuplist[pubs][\c!width=]
+
+
%D The text string for the publication list header
\setupheadtext[en][pubs=References]
\setupheadtext[nl][pubs=Literatuur]
\setupheadtext[de][pubs=Literatur]
+\setupheadtext[it][pubs=Bibliografia]
+\setupheadtext[sl][pubs=Literatura]
+\setupheadtext[fr][pubs=Bibliographie]
-%D \macros{bibdoifelse}
+%D \macros{bibdoif,bibdoifnot,bibdoifelse}
%D
-%D Here is a really small helper that is used a lot (which is why it
-%D makes sense to use \type{\ifx} instead of \type{\doif..}).
-%D This test is used in all the typesetting commands
+%D Here are a few small helpers that are used a lot
+%D in all the typesetting commands
%D (\type{\insert...}) we will encounter later.
-\def\bibdoifelse#1%
- {\ifx#1\relax
- \@EA\secondoftwoarguments
- \else\ifx#1\empty
- \@EAEAEA\secondoftwoarguments
+\long\def\bibdoifelse#1%
+ {\@EA\def\@EA\!!stringa\@EA{#1}%
+ \ifx\!!stringa\empty
+ \expandafter\secondoftwoarguments
\else
- \@EAEAEA\firstoftwoarguments
- \fi\fi}
+ \expandafter\firstoftwoarguments
+ \fi}
-\def\bibdoif#1%
- {\ifx#1\relax
- \@EA\gobbleoneargument
- \else\ifx#1\empty
- \@EAEAEA\gobbleoneargument
+\long\def\bibdoifnot#1%
+ {\@EA\def\@EA\!!stringa\@EA{#1}%
+ \ifx\!!stringa\empty
+ \expandafter\firstofoneargument
\else
- \@EAEAEA\firstofoneargument
- \fi\fi}
+ \expandafter\gobbleoneargument
+ \fi}
-\def\bibdoifnot#1%
- {\ifx#1\relax
- \@EA\firstofoneargument
- \else\ifx#1\empty
- \@EAEAEA\firstofoneargument
+\long\def\bibdoif#1%
+ {\@EA\def\@EA\!!stringa\@EA{#1}%
+ \ifx\!!stringa\empty
+ \expandafter\gobbleoneargument
\else
- \@EAEAEA\gobbleoneargument
- \fi\fi}
+ \expandafter\firstofoneargument
+ \fi}
+
%D Bibtex settings separated out
@@ -202,12 +312,14 @@
%D \stopitemize
\def\writeauxfile
- {\openout \scratchwrite \jobname.aux
- \write \scratchwrite {\string\citation{*}}%
- \write \scratchwrite {\string\bibstyle{\bibstyle}}%
- \write \scratchwrite {\string\bibdata{\@@pbdatabase}}%
- \closeout\scratchwrite
- \showmessage\m!bib{3}{}}
+ {\doifmode{*first}
+ {\openout \scratchwrite \jobname.aux
+ \write \scratchwrite {\string\citation{*}}%
+ \write \scratchwrite {\string\bibstyle{\bibstyle}}%
+ \write \scratchwrite {\string\bibdata{\@@pbdatabase}}%
+ \closeout\scratchwrite
+ \showmessage\m!bib{3}{}%
+ \installprogram{bibtex \jobname}}}
%D \macros{ifsortbycite,iftypesetall,ifautohang,ifbibcitecompress}
%D
@@ -236,48 +348,49 @@
\def\bibleftnumber#1%
{#1\hfill~}
+
\def\dosetuppublications[#1]%
{\getparameters
[\??pb]
- [\c!numbercommand=\bibleftnumber,\c!alternative=,#1]%
+ [\c!alternative=,#1]%
\doifsomething\@@pbalternative
- {\readsysfile{bibl-\@@pbalternative.tex}
- {\showmessage\m!bib{6}{bibl-\@@pbalternative}\let\@@pbalternative\empty}
- {\showmessage\m!bib{1}{bibl-\@@pbalternative}\let\@@pbalternative\empty}}%
- \doifnothing{\@@pbalternative}
- {\processaction
- [\@@pbcriterium]
- [ \v!all=>\typesetalltrue,
- \s!unknown=>\typesetallfalse]%
- \processaction
- [\@@pbautohang]
- [ \v!yes=>\autohangtrue,
- \s!unknown=>\autohangfalse]%
- \processaction
- [\@@pbsorttype]
- [ \v!cite=>\sortbycitetrue,
- \v!bbl=>\sortbycitefalse,
- \s!default=>\sortbycitetrue,
- \s!unknown=>\sortbycitefalse]%
- \processaction
- [\@@pbnumbering]
- [ \v!yes=>\let\@@pbinumbercommand\firstofoneargument,
- \v!no=>\let\@@pbinumbercommand\gobbleoneargument,
- \v!short=>\def\@@pbinumbercommand##1{\@@pbs},
- \v!bib=>\def\@@pbinumbercommand##1{\@@pbn},
- \s!unknown=>\let\@@pbinumbercommand\firstofoneargument]%
- \processaction
- [\@@pbrefcommand]
- [\s!default=>\edef\@@citedefault{\@@pbrefcommand},
- \s!unknown=>\edef\@@citedefault{\@@pbrefcommand}]}}
+ {\readsysfile
+ {bibl-\@@pbalternative.tex}
+ {\showmessage\m!bib{6}{bibl-\@@pbalternative}\let\@@pbalternative\empty}
+ {\showmessage\m!bib{1}{bibl-\@@pbalternative}\let\@@pbalternative\empty}}%
+ \getparameters
+ [\??pb]
+ [#1]%
+ \processaction
+ [\@@pbcriterium]
+ [ \v!all=>\typesetalltrue,
+ \s!unknown=>\typesetallfalse]%
+ \processaction
+ [\@@pbautohang]
+ [ \v!yes=>\autohangtrue,
+ \s!unknown=>\autohangfalse]%
+ \processaction
+ [\@@pbsorttype]
+ [ \v!cite=>\sortbycitetrue,
+ \v!bbl=>\sortbycitefalse,
+ \s!default=>\sortbycitetrue,
+ \s!unknown=>\sortbycitefalse]%
+ \processaction
+ [\@@pbnumbering]
+ [ \v!yes=>\let\@@pbinumbercommand\firstofoneargument,
+ \v!no=>\let\@@pbinumbercommand\gobbleoneargument,
+ \v!short=>\def\@@pbinumbercommand##1{\getvalue{pbds-\@@pbk}},
+ \v!bib=>\def\@@pbinumbercommand##1{\getvalue{pbdn-\@@pbk}},
+ \s!unknown=>\let\@@pbinumbercommand\firstofoneargument]%
+ \processaction
+ [\@@pbrefcommand]
+ [\s!default=>\edef\@@citedefault{\@@pbrefcommand},
+ \s!unknown=>\edef\@@citedefault{\@@pbrefcommand}]}
% initialize
\def\@@pbrefcommand{num}
-
-%D how to load the references:
-
-\appendtoks \dousepublications\jobname \to \everystarttext
+\def\@@pbnumbercommand{\bibleftnumber}
%D \macros{usepublications}
%D
@@ -289,9 +402,11 @@
{\usereferences[#1]\processcommalist[#1]\dousepublications}
\def\dousepublications#1%
- {\readsysfile{#1.\f!bibextension}
- {\showmessage\m!bib{4}{#1.\f!bibextension}}
- {\showmessage\m!bib{2}{#1.\f!bibextension}}}
+ {\doonlyonce
+ {#1.\f!bibextension}
+ {\readfile{#1.\f!bibextension}
+ {\showmessage\m!bib{4}{#1.\f!bibextension}}
+ {\showmessage\m!bib{2}{#1.\f!bibextension}}}}
%D \macros{setuppublicationlist}
%D
@@ -309,18 +424,15 @@
\def\setuppublicationlist
{\dosingleempty\dosetuppublicationlist}
-\definelist[pubs][pubs]
-
\def\dosetuppublicationlist[#1]%
- {\getparameters
- [@@pvdata]
- [\c!samplesize={AA99},\c!totalnumber={99},#1]% for sample & totalnumber & firstnamesep etc.
+ {\getparameters[\??pv data][#1]%
\setuplist
- [pubs]
- [\c!alternative=a,\c!pagenumber=\v!no,#1]}
+ [pubs]
+ [\c!samplesize={AA99},\c!totalnumber={99},
+ \c!alternative=a,\c!interaction=,\c!pagenumber=\v!no,#1]}
-\def\setuppublicationlayout[#1]%
- {\setvalue{@@pvdata#1}}
+\def\setuppublicationlayout[#1]#2%
+ {\setvalue{\??pv data#1}{#2\unskip}}
%D \macros{bibalternative}
%D
@@ -350,26 +462,43 @@
\def\simplebibdef#1% hh: funny expansion ?
{\@EA\long\@EA\def\csname bib@#1\endcsname##1%
- {\setvalue{\??pb @#1}{##1}\ignorespaces}%
+ {\setvalue{\??pb @#1}{##1}%
+ \ignorespaces}%
\@EA\def\csname insert#1\endcsname##1##2##3%
{\@EA\bibdoifelse
\@EA{\csname @@pb@#1\endcsname}%
{##1\csname @@pb@#1\endcsname##2}%
- {##3}}}
+ {##3}%
+ }}
\def\bibcommandlist
- {arttitle,title,journal,notes,
- volume,issue,pubname,city,country,
- type,organization,institute,series,thekey,
- edition,month,pubyear,note,annotate,pages,
- keyword,keywords,comment,abstract,names,size,
- issn,isbn,chapter,eprint,doi,howpublished}
+ {abstract, annotate, arttitle, assignee, bibnumber, bibtype, biburl, chapter, city,
+ comment, country, day, dayfiled, doi, edition, eprint, howpublished, isbn, issn,
+ issue, journal, keyword, keywords, lastchecked, month, monthfiled, names, nationality,
+ note, notes, organization, pages, pubname, pubyear, revision, series, size, thekey,
+ title, volume, yearfiled}
+
\processcommacommand[\bibcommandlist]\simplebibdef
+\def\insertbiburl#1#2#3%
+ {{\bibdoifelse{\@@pb@biburl}%
+ {\edef\ascii{\@EA\detokenize\@EA{\@@pb@biburl}}%
+ #1\@EA\hyphenatedurl\@EA{\ascii}#2}{#3}}}
+
+\def\insertmonth#1#2#3%
+ {\bibdoifelse{\@@pb@month}%
+ {#1\doifnumberelse{\@@pb@month}%
+ {\doifconversiondefinedelse\@@pbmonthconversion
+ {\convertnumber\@@pbmonthconversion{\@@pb@month}}{\@@pb@month}}%
+ {\@@pb@month}#2}{#3}}
+
+\let\inserturl \insertbiburl % for backward compat.
+\let\inserttype\insertbibtype % for backward compat.
+
\def\newbibfield[#1]%
{\simplebibdef{#1}%
- \edef\bibcommalist{\bibcommandlist,#1}}
+ \edef\bibcommandlist{\bibcommandlist,#1}}
%D \macros{bib@crossref}
%D
@@ -395,7 +524,7 @@
%D
%D \type{\author[junior]{firstnames}[inits]{von}{surname}}
%D
-%D (bracketed stuff should become optional someday)
+%D (bracketed stuff is optional)
%D
%D And not only that, but there also might be more than one of each of
%D these commands. This is why a special command is needed to insert
@@ -407,41 +536,38 @@
%D things: increment the counter \type{\author@num} (let's say to 2)
%D and next store it's arguments in the macro \type{\@@pb@author2}.
%D And it defines \type{\insertauthors} to expand into
-%D \starttypen
+%D \starttyping
%D \specialbibinsert{author}{\author@num}{<before>}{<after>}{<not>}
-%D \stoptypen
+%D \stoptyping
+
+\def\docomplexbibdef#1%
+ {\def\currentype{#1}%
+ \dosingleempty\dodocomplexbibdef}
+
+\def\dodocomplexbibdef[#1]#2%
+ {\def\firstarg{#1}\def\secondarg{#2}%
+ \dosingleempty\dododocomplexbibdef}
-% hh: use a context counter instead, more options
+\def\dododocomplexbibdef[#1]#2#3%
+ {\@EA\increment\csname \currentype @num\endcsname
+ \setevalue{\??pb @\currentype\csname \currentype @num\endcsname}%
+ {{\secondarg}{#2}{#3}{#1}{\firstarg}}\ignorespaces}%
\def\complexbibdef#1%
{\@EA\newcounter\csname #1@num\endcsname
- \@EA\def\csname bib@#1\endcsname[##1]##2[##3]##4##5%
- {\@EA\increment\csname #1@num\endcsname
- \setvalue{\??pb @#1\csname #1@num\endcsname}%
- {{##2}{##4}{##5}{##3}{##1}}\ignorespaces}%
+ \@EA\def\csname bib@#1\endcsname{\docomplexbibdef{#1}}%
\@EA\def\csname insert#1s\endcsname##1##2##3%
- {\specialbibinsert{#1}{\csname #1@num\endcsname}{##1}{##2}{##3}}}
+ {\specialbibinsert{#1}{\csname #1@num\endcsname}{##1}{\unskip ##2}{##3}}}
\processcommalist[author,artauthor,editor]\complexbibdef
%D Another level of indirection is needed to control the
-%D typesetting of all of these arguments, which explains the usage
-%D of \type{\tempa} below.
-
-%D There is some sneaky stuff with \type{\tempa} and \type{\tempb}
-%D going on here to resolve the \type{\csname}'s. It probably could
-%D be done a little bit more elegant, but it works. The basic goal
-%D is to get the command that will actually typeset the name into
-%D the macro \type{\tempb}, and to make sure that that command will actually
-%D recieve five arguments (see the definition of
-%D e.g. \type{\invertedauthor} below).
-
-%D There is a conflict between `author' and the predefined interface
+%D typesetting of all of these arguments.
+
+%D Btw, there is a conflict between `author' and the predefined interface
%D variable `auteur'. The old version is overruled `auteur' is
%D overruled by the systemconstant definition at the top of this file!
-%D The increment/decrement trick on \type{\scratchcounter} is needed
-%D to decide what name the last one is.
\newcount\etallimitcounter
\newcount\etaldisplaycounter
@@ -450,8 +576,6 @@
\def\specialbibinsert#1#2#3#4#5%
{\bgroup
\ifnum#2>\zerocount
- \letcscsname\tempa\csname @@pvdata#1\endcsname
- \def\tempb{\@EA\tempa}%
\etallimitcounter =0\bibalternative{#1etallimit}\relax
\etaldisplaycounter=0\bibalternative{#1etaldisplay}\relax
\ifnum #2>\etallimitcounter
@@ -463,40 +587,55 @@
\else
\todocounter#2\relax
\fi
- \scratchcounter\zerocount
\ifnum\todocounter>\zerocount
- #3%
- \doloop
- {\ifnum \scratchcounter < \todocounter
- \advance\scratchcounter \plusone
- \ifnum \scratchcounter = \todocounter
- \@EA\tempb \csname @@pb@#1\the\scratchcounter\endcsname
- \ifnum\etallimitcounter<#2 \bibalternative{#1etaltext}\fi #4%
- \else
- \@EA\tempb \csname @@pb@#1\the\scratchcounter\endcsname
- \advance\scratchcounter \plusone
- \ifnum \scratchcounter = \todocounter
- \ifnum \todocounter > \plustwo
- \bibalternative\c!finalnamesep
- \else
- \bibalternative\c!lastnamesep
- \fi
- \else
- \bibalternative\c!namesep
- \fi
- \advance\scratchcounter \minusone
- \fi
- \else
- \exitloop
- \fi}%
- \else
- #5%
- \fi
+ % find the current author list
+ \let\templist\empty
+ \dorecurse{#2}
+ {\toks0=\@EA\@EA\@EA{\csname @@pb@#1\recurselevel\endcsname}%
+ \ifx\templist\empty \edef\templist{\the\toks0}%
+ \else \edef\templist{\templist,\the\toks0}\fi }%
+ \doifdefinedelse
+ {\??pv data#1\c!command}
+ {\doifemptyelsevalue
+ {\??pv data#1\c!command}
+ {#3\dospecialbibinsert{#1}{\todocounter}{\templist}#4}%
+ {#3\getvalue{\??pv data#1\c!command}{#1}{\todocounter}{\templist}#4}}%
+ {#3\dospecialbibinsert{#1}{\todocounter}{\templist}#4}%
+ \else
+ #5%
+ \fi
\else
#5%
\fi
\egroup}
+%D This macro does the hard work of inserting a list of people in the
+%D output, with proper regard of all the inbetween strings that can
+%D arise depending on length of the list of people.
+
+%D \#1 = type
+%D \#2 = number of items to be typeset
+%D \#3 = commacommand containing authors
+
+\def\dospecialbibinsert#1#2#3%
+ {\getcommacommandsize[#3]%
+ \scratchcounter 0
+ \def\processauthoritem##1%
+ {\advance\scratchcounter1
+ \ifnum \numexpr\scratchcounter-1\relax<#2\relax
+ \getvalue{\??pv data#1}##1%
+ \ifnum \scratchcounter=#2\relax
+ \ifnum\etallimitcounter<\commalistsize \bibalternative{#1etaltext}\fi
+ \else \ifnum\numexpr\scratchcounter+1 = #2\relax
+ \ifnum \commalistsize > \plustwo \bibalternative\c!finalnamesep
+ \else \bibalternative\c!lastnamesep \fi
+ \else
+ \bibalternative\c!namesep
+ \fi \fi
+ \fi}%
+ \processcommacommand[#3]\processauthoritem }
+
+
%D \macros{invertedauthor,normalauthor,invertedshortauthor,normalshortauthor}
%D
%D Just some commands that can be used in \type{\setuppublicationparameters}
@@ -515,29 +654,29 @@
%D }
%D
-\def\invertedauthor#1#2#3#4#5%
- {\bibdoif{#2}{#2\bibalternative\c!vonsep}%
- #3\bibalternative\c!surnamesep
- \bibdoif{#5}{#5\bibalternative\c!juniorsep}%
- \bibdoif{#1}{#1\unskip}}
-
\def\normalauthor#1#2#3#4#5%
{\bibdoif{#1}{#1\bibalternative\c!firstnamesep}%
\bibdoif{#2}{#2\bibalternative\c!vonsep}%
- #3\bibalternative\c!surnamesep
- \bibdoif{#5}{#5\unskip}}
-
-\def\invertedshortauthor#1#2#3#4#5%
- {\bibdoif{#2}{#2\bibalternative\c!vonsep}%
- #3\bibalternative\c!surnamesep
- \bibdoif{#5}{#5\bibalternative\c!juniorsep}%
- \bibdoif{#4}{#4\unskip}}
+ #3%
+ \bibdoif{#5}{\bibalternative\c!surnamesep#5\unskip}}
\def\normalshortauthor#1#2#3#4#5%
{\bibdoif{#4}{#4\bibalternative\c!firstnamesep}%
\bibdoif{#2}{#2\bibalternative\c!vonsep}%
- #3\bibalternative\c!surnamesep
- \bibdoif{#5}{#5\unskip}}
+ #3%
+ \bibdoif{#5}{\bibalternative\c!surnamesep#5\unskip}}
+
+\def\invertedauthor#1#2#3#4#5%
+ {\bibdoif{#2}{#2\bibalternative\c!vonsep}%
+ #3%
+ \bibdoif{#5}{\bibalternative\c!juniorsep #5}%
+ \bibdoif{#1}{\bibalternative\c!surnamesep #1\unskip}}
+
+\def\invertedshortauthor#1#2#3#4#5%
+ {\bibdoif{#2}{#2\bibalternative\c!vonsep}%
+ #3%
+ \bibdoif{#5}{\bibalternative\c!juniorsep #5}%
+ \bibdoif{#4}{\bibalternative\c!surnamesep #4\unskip}}
%D \macros{clearbibitem,clearbibitemtwo,bibitemdefs}
%D
@@ -555,18 +694,14 @@
\advance\scratchcounter\plusone}%
{\exitloop}}}
-\def\bibitemdefs#1{\setvalue{#1}{\csname bib@#1\endcsname}}
+\def\bibitemdefs#1%
+ {\@EA\let\@EA\tempa \csname bib@#1\endcsname
+ \@EA\let\csname #1\endcsname \tempa }
%D \macros{startpublication}
%D
%D We are coming to the end of this module, to the macros that
%D do typesetting and read the \type{bbl} file.
-%D
-%D The stuff between \type{\startpublication} ... \type{\stoppublication}
-%D is simply stored into a macro: either
-%D \type{\publist} (potentially huge) or separate macros
-%D for each of them, depending on whether
-%D or not we do \type{\sortbycite}, as explained above.
\newcounter\bibcounter
@@ -593,75 +728,183 @@
\long\def\dostartpublication[#1]#2\stoppublication%
{\increment\bibcounter
\bgroup
- \bgroup\honorunexpanded
\doifassignmentelse{#1}%
- {\egroup\getparameters[\??pb][k=,t=article,n=,s=,a=,y=,o=,#1]}%
- {\egroup\getparameters[\??pb][k=#1,t=article,n=,s=,a=,y=,o=]}%
- \toks0={\ignorespaces #2}%
- \@EA\toks\@EA2\@EA{\@@pba}%
- \@EA\toks\@EA4\@EA{\@@pbs}%
- \setxvalue{pbd-\@@pbk}%
- {{\the\toks2}% \@@pba (author)
- {\@@pby}%
- {\the\toks4}% \@@pbs (short)
- {\@@pbn}%
- {\@@pbt}%
- {\the\toks0}% (data)
- {\@@pbo}}% doi
- \xdef\allrefs{\allrefs,\@@pbk}%
- \egroup}
+ {\getparameters[\??pb][k=,t=article,n=,s=,a=,y=,o=,u=,#1]}%
+ {\getparameters[\??pb][k=#1,t=article,n=,s=,a=,y=,o=,u=]}%
+ \@EA\toks\@EA2\@EA{\@@pba}%
+ \@EA\toks\@EA4\@EA{\@@pbs}%
+ \toks0={\ignorespaces #2}%
+ \setxvalue{pbdk-\@@pbk}{\@@pbk}
+ \setxvalue{pbda-\@@pbk}{\the\toks2}
+ \setxvalue{pbdy-\@@pbk}{\@@pby}
+ \setxvalue{pbds-\@@pbk}{\the\toks4}
+ \setxvalue{pbdn-\@@pbk}{\@@pbn}
+ \setxvalue{pbdt-\@@pbk}{\@@pbt}
+ \setxvalue{pbdo-\@@pbk}{\@@pbo}
+ \setxvalue{pbdu-\@@pbk}{\@@pbu}
+ \setxvalue{pbdd-\@@pbk}{\the\toks0}
+ \xdef\allrefs{\allrefs,\@@pbk}%
+ \egroup }
% intialization of the order-list:
\let\allrefs\empty
-% how to get stuff from a pbd-*** macro:
+%D The next macro is needed because the number command of the
+%D publist sometimes needs to fetch something from the current
+%D item (like the 'short' key). For this, the ID of the current
+%D item is passed in the implict parameter \type{\@@pbk}
-\def\restorebibdata#1%
- {\def\@@pbk{#1}%
- \@EA\dorestorebibdata\csname pbd-#1\endcsname}
+\def\makepbkvalue#1{\def\@@pbk{#1}}
-\def\dorestorebibdata#1%
- {\@EA\dodorestorebibdata#1{}{}{}{}{}{}{}\relax}
+%D
-\def\dodorestorebibdata#1#2#3#4#5#6#7#8\relax%
- {\def\@@pba{#1}%
- \def\@@pby{#2}%
- \def\@@pbs{#3}%
- \def\@@pbn{#4}%
- \def\@@pbt{#5}%
- \def\@@pbd{#6}%
- \def\@@pbo{#7}}
+\newif\ifinpublist
-%D The \writeutility trick is dodgy at best, but it is needed
-%D to make sure that \placepublications\stoptext works as
-%D advertised. (without the \immediate, there *has* to be at
-%D least one page break between \placepublications and \stoptext)
-%D
+% from Hans
+
+\def\ignoresectionconversion
+ {\let\@@sectionconversion\secondoftwoarguments}
+
+\let\normaldosetfilterlevel\dosetfilterlevel
+
+\def\patcheddosetfilterlevel#1#2% beware: this one is \let
+ {\bgroup
+ \ignoresectionconversion
+ \edef\askedlevel{#1}%
+ \edef\askedfilter{#2}%
+% \message{ASKD: \meaning\askedlevel}%
+% \message{PREV: \meaning\v!previous}%
+ \ifx\askedlevel\v!current
+ \dosetcurrentlevel\askedlevel
+ \else\ifx\askedlevel\v!previous
+ \dosetpreviouslevel\askedlevel
+ \else\ifx\askedlevel\v!all
+ \global\chardef\alltoclevels\plusone
+ \else\ifx\askedlevel\v!text
+ \global\chardef\alltoclevels\plusone
+ \else
+ \edef\byaskedlevel{\csname\??by\askedlevel\endcsname}%
+ \ifx\byaskedlevel\v!text
+ \dosettextlevel\askedlevel
+ \else
+ \dosetotherlevel\askedlevel
+ \fi
+ \fi\fi\fi\fi
+ % experiment
+ \ifx\askedfilter\empty \else
+ \xdef\currentlevel{\currentlevel\sectionseparator\askedfilter}%
+ \fi
+ \egroup}
+
+
+\unless\ifcsname currentlocationrefence\endcsname
-\def\preinitializepubslist
- {\let\bibcounter\!!zerocount
+\let\currentlocationreference\empty
+
+\def\dogetreferenceelements#1#2#3#4#5%
+ {\chardef\currentreferencetype=\ifx#1\relax0\else#1\fi\relax
+ \ifnum\currentreferencetype<2
+ \edef\currentpagereference{#2}%
+ \let \currentdatareference\empty
+ \edef\currentlocationreference{#2}%
+ \ifx\currentpagereference \empty
+ \let\currentfolioreference\folio
+ \else
+ \def \currentpagereference {\referencepagenumber[#2]}%
+ \edef\currentfolioreference{\dosplitofffoliopart[#2]}%
+ \fi
+ \edef\currentrealreference{#3}%
+ \settextreferences#4\end
+ \ifnum0#5<\crossreferencenumber
+ \forwardreferencetrue
+ \else
+ \forwardreferencefalse
+ \fi
+ \else
+ \let \currentlocationreference\empty
+ \edef\currentrealreference {#3}%
+ \def \currentdatareference {#2}%
+ \let \currentfolioreference\folio
+ \settextreferences#4\end
+ \forwardreferencefalse
+ \fi
+ \ifodd\currentreferencetype
+ \realreferencepagefalse
+ \else
+ \docheckrealreferencepage\currentrealreference
+ \ifrealreferencepage \else
+ \docheckrealreferencepage\currentdatareference
+ \fi
+ \fi}
+
+\fi
+
+\def\filllocalpublist%
+ {\let\dosetfilterlevel\patcheddosetfilterlevel
+ \dosettoclevel\??li{pubs}%
+ \let\dosetfilterlevel\normaldosetfilterlevel
+ \global\let\glocalpublist\empty
+ \doloop
+ {\doifdefinedelse
+ {\r!cross cite-\jobname-\recurselevel}
+ {\doifreferencefoundelse
+ {cite-\jobname-\recurselevel}
+ {\@EA\doifreglevelelse\@EA[\currentlocationreference]
+ {\@EA\doglobal\@EA\addtocommalist\@EA
+ {\currenttextreference}\glocalpublist}{}}
+ {}}%
+ {\exitloop}}%
+ \let\localpublist\glocalpublist}
+
+%
+\def\typesetpubslist
+ {\dobeginoflist
+ \edef\askedlevel{\csname \??li pubs\c!criterium\endcsname}%
+ \ifx\askedlevel\v!all
+ \def\bibrefprefix{}%
+ \else %
+ \preparebibrefprefix
+ \fi
\ifsortbycite
- \processcommacommand[\publist]\sortwritepublist
- \glet\publist\empty
+ \filllocalpublist
\iftypesetall
- \processcommacommand[\allrefs]\writepublist
+ \let\localallrefs\allrefs
+ \processcommacommand[\localpublist]\typesetapublication
+ \def\removefromallrefs##1%
+ {\removefromcommalist{##1}\localallrefs }%
+ \processcommacommand[\localpublist]\removefromallrefs
+ \processcommacommand[\localallrefs]\typesetapublication
+ \else
+ \processcommacommand[\localpublist]\typesetapublication
\fi
\else
\iftypesetall
- \processcommacommand[\allrefs]\writepublist
+ \processcommacommand[\allrefs]\typesetapublication
\else
- \processcommacommand[\allrefs]\writereferredpublist
+ %
+ \filllocalpublist
+ \processcommacommand[\allrefs]\maybetypesetapublication
\fi
- \fi}
+ \fi
+ \doendoflist }
+
+\newif\ifinpublist
+\def\maybetypesetapublication#1%
+ {\global\inpublistfalse
+ \def\test{#1}%
+ \def\runtest##1%
+ {\def\tempa{##1}\ifx \test\tempa \global\inpublisttrue \fi}%
+ \processcommacommand[\localpublist]\runtest
+ \ifinpublist \typesetapublication{#1}\fi}
\def\initializepubslist
{\edef\@@pbnumbering{\@@pbnumbering}%
\ifautohang
\ifx\@@pbnumbering\v!short
- \setbox\scratchbox\hbox{\@@pbnumbercommand{\csname @@pvdata\c!samplesize\endcsname}}%
+ \setbox\scratchbox\hbox{\@@pbnumbercommand{\getvalue{\??li pubs\c!samplesize}}}%
\else\iftypesetall
- \setbox\scratchbox\hbox{\@@pbnumbercommand{\csname @@pvdata\c!totalnumber\endcsname}}%
+ \setbox\scratchbox\hbox{\@@pbnumbercommand{\getvalue{\??li pubs\c!totalnumber}}}%
\else
\setbox\scratchbox\hbox{\@@pbnumbercommand{\numreferred}}%
\fi\fi
@@ -669,19 +912,23 @@
\setuplist[pubs][\c!width=\samplewidth,\c!distance=0pt]%
\def\@@pblimitednumber##1{\hbox to \samplewidth{\@@pbnumbercommand{##1}}}%
\else
- \def\@@pblimitednumber##1{\hbox{\@@pbnumbercommand{##1}}}%
+ \doifemptyelse
+ {\getvalue{\??li pubs\c!width}}
+ {\def\@@pblimitednumber##1{\hbox{\@@pbnumbercommand{##1}}}}%
+ {\def\@@pblimitednumber##1{\hbox to \getvalue{\??li pubs\c!width}{\@@pbnumbercommand{##1}}}}%
\fi
\ifx\@@pbnumbering\v!no
- \setuplist[pubs][\c!numbercommand=,\c!textcommand=\outdented]
+ \setuplist[pubs][\c!numbercommand=,\c!symbol=\v!none,\c!textcommand=\outdented]
\else
- \setuplist[pubs][\c!numbercommand=\@@pblimitednumber,\c!textcommand=]
+ \setuplist[pubs][\c!numbercommand=\@@pblimitednumber]%
\fi
\forgetall % bugfix 2005/03/18
}
+
\def\outdented#1% move to supp-box ?
- {\hskip -\hangindent
- \strut#1\strut}
+ {\hskip -\hangindent #1}
+
%D The full list of publications
@@ -689,12 +936,23 @@
{\dosingleempty\docompletepublications}
\def\docompletepublications[#1]%
- {\preinitializepubslist
- \ifcase\bibcounter\else % HERE it said "\or" instead of "\else"
- \initializepubslist
- \let\bibcounter\!!zerocount
- \completelist[pubs][\c!criterium=all,#1]%
- \fi}
+ {%\getparameters[\??pv data][#1]%
+ \begingroup
+ \setuplist[pubs][\c!criterium=\v!previous,#1]
+ \begingroup
+ \loggingall
+ \let\handletextprefix\firstoftwoarguments
+ \edef\headtextpubs{\dogetupsometextprefix\headlanguage\c!title{pubs}}%
+ \doifdefinedelse
+ {\??pv data\v!title}
+ {\doifemptyelsevalue
+ {\??pv data\v!title}
+ {\expanded{\systemsuppliedtitle[pubs]{\headtextpubs}}}%
+ {\expanded{\getvalue{\??pv data\v!title}{\headtextpubs}}}%
+ }%
+ {\expanded{\systemsuppliedtitle[pubs]{\headtextpubs}}}%
+ \endgroup
+ \dodoplacepublications }
%D And the portion with the entries only.
@@ -702,63 +960,63 @@
{\dosingleempty\doplacepublications}
\def\doplacepublications[#1]%
- {\preinitializepubslist
- \ifcase\bibcounter\else % HERE it said "\or" instead of "\else"
- \initializepubslist
- \let\bibcounter\!!zerocount
- \placelist[pubs][\c!criterium=\v!all,#1]%
- \fi}
-
-\def\dowritebiblist#1#2%
- {\restorebibdata{#2}%
- \edef\pbnumbercommand{\@@pbinumbercommand{#1}}%
- \@EA\dodowritebiblist\@EA{\pbnumbercommand}{\typesetapublication{#2}}}
-
-\def\dodowritebiblist
- {\writetolist[pubs]}
+ {%\getparameters[\??pv data][#1]
+ \begingroup
+ \setuplist[pubs][\c!criterium=\v!previous,#1]
+ \dodoplacepublications }%
-\def\writepublist#1%
- {\doifnotempty{#1}
- {\increment\bibcounter
- \@EA\dowritebiblist\@EA{\bibcounter}{#1}}}
+\def\dodoplacepublications%
+ {\initializepubslist
+ \global\let\bibcounter\!!zerocount
+ \inpublisttrue
+ \typesetpubslist
+ \inpublistfalse
+ \endgroup }
-\def\writereferredpublist#1%
- {\doifnotempty{#1}
- {\doifreferredelse{#1}
- {\increment\bibcounter
- \@EA\dowritebiblist\@EA{\bibcounter}{#1}}{}}}
-\def\sortwritepublist#1%
- {\doifnotempty{#1}
- {\removefromcommalist{#1}\allrefs
- \increment\bibcounter
- \@EA\dowritebiblist\@EA{\bibcounter}{#1}}}
-
-%D \subonderwerp{What's in a publication}
+%D \subsubject{What's in a publication}
%D
-\def\typesetapublication
- {\doglobal\increment\bibcounter
- \dotypesetapublication}
+\unexpanded\def\typesetapublication#1%
+ {\doifsomething{#1}{\doglobal\increment\bibcounter
+ \dodolistelement{pubs}{}{\bibcounter}%
+ {\expanded{\reference[\bibrefprefix#1]{\bibcounter}}%
+ \strut \dotypesetapublication{#1}\strut }{}{}}}
\def\dotypesetapublication#1%
{\bgroup
\def\@@currentalternative{data}%
- \restorebibdata{#1}%
+ \makepbkvalue{#1}%
\processcommacommand[\bibcommandlist,crossref]\clearbibitem
\processcommalist [artauthor,author,editor]\clearbibitemtwo
\processcommacommand[\bibcommandlist]\bibitemdefs
\processcommalist [artauthor,author,editor,crossref]\bibitemdefs
- \expanded{\reference[\@@pbk]{\bibcounter}}%
- \@@pbd % execute data
- \bibalternative{\@@pbt}% do typesetting
- \egroup}
+ \let\biblanguage\empty
+ \getvalue{pbdd-#1}%
+ \ifcsname pbdt-#1\endcsname \bibalternative{\getvalue{pbdt-#1}}\fi
+ \egroup }
+
%D An afterthought
\def\maybeyear#1{}
-%D \onderwerp{Citations}
+%D An another
+
+\def\noopsort#1{}
+
+%D This is the result of bibtex's `language' field.
+
+\def\setbiblanguage#1#2{\setvalue{\??pb @lang@#1}{#2}}
+
+\def\lang#1%
+ {\def\biblanguage{#1}%
+ \ifcsname \??pb @lang@#1\endcsname
+ \expanded{\language[\getvalue{\??pb @lang@#1}]}%
+ \fi \ignorespaces}
+
+
+%D \subject{Citations}
%D \macros{cite,bibref}
%D
@@ -766,39 +1024,122 @@
%D \type{\cite} commands with a braced argument (these might appear
%D in included data from the \type{.bib} file).
-\def\cite
+\unexpanded\def\cite
{\doifnextcharelse{[}
- {\dodoubleempty\docite}
+ {\dodocite}
{\dobibref}}
\def\dobibref#1%
- {\docite[#1]}
-
-\def\docite#1[#2]#3[#4]%
- {\ifsecondargument
- \def\@@currentalternative{#2}%
- \expanded{\processaction[\csname @@pv#2compress\endcsname]}
- [ \v!yes=>\bibcitecompresstrue,
- \v!no=>\bibcitecompressfalse,
- \s!default=>\bibcitecompresstrue,
- \s!unknown=>\bibcitecompresstrue]%
- \getvalue{bib#2ref}[#4]%
+ {\docite[#1][]}
+
+\def\dodocite[#1]%
+ {\startstrictinspectnextcharacter
+ \dodoubleempty\dododocite[#1]}
+
+\def\dododocite[#1][#2]{%
+ \stopstrictinspectnextcharacter
+ \docite[#1][#2]}
+
+\def\docite[#1][#2]%
+ {\begingroup
+ \setupinteraction[\c!style=]%
+ \edef\temp{#2}%
+ \ifx\empty\temp \secondargumentfalse
+ \else \secondargumenttrue \fi
+ \ifsecondargument
+ \processcommalist[#2]\docitation
+ \doifassignmentelse
+ {#1}%
+ {\getparameters[LO][\c!alternative=,\c!extras=,#1]%
+ \edef\@@currentalternative{\LOalternative}%
+ \ifx\@@currentalternative\empty
+ \edef\@@currentalternative{\@@citedefault}%
+ \fi
+ \ifx\LOextras\empty
+ \setupcite[\@@currentalternative][#1]%
+ \else
+ \expandafter\ifx\csname LOright\endcsname \relax
+ \edef\LOextras{{\LOextras\bibalternative\c!right}}%
+ \else
+ \edef\LOextras{{\LOextras\LOright}}%
+ \fi
+ \expanded{\setupcite[\@@currentalternative][#1,\c!right=\LOextras]}%
+ \fi
+ }%
+ {\def\@@currentalternative{#1}}%
+ \expanded{%
+ \processaction[\csname @@pv\@@currentalternative \c!compress\endcsname]}
+ [ \v!yes=>\bibcitecompresstrue,
+ \v!no=>\bibcitecompressfalse,
+ \s!default=>\bibcitecompresstrue,
+ \s!unknown=>\bibcitecompresstrue]%
+ \getvalue{bib\@@currentalternative ref}[#2]%
\else
- \expanded{\processaction[\csname @@pv\@@citedefault compress\endcsname]}
+ \processcommalist[#1]\docitation
+ \expanded{\processaction[\csname @@pv\@@citedefault \c!compress\endcsname]}
[ \v!yes=>\bibcitecompresstrue,
\v!no=>\bibcitecompressfalse,
\s!default=>\bibcitecompresstrue,
\s!unknown=>\bibcitecompresstrue]%
\edef\@@currentalternative{\@@citedefault}%
- \getvalue{bib\@@citedefault ref}[#2]%
- \fi}
+ \getvalue{bib\@@citedefault ref}[#1]%
+ \fi
+ \endgroup}
+
+%D \macros{nocite}
+
+\def\nocite[#1]%
+ {\processcommalist[#1]\addthisref
+ \processcommalist[#1]\docitation }
+
+%D \macros{setupcite}
+
+\def\setupcite{\dodoubleempty\dosetupcite}
+
+\def\dosetupcite[#1][#2]%
+ {\ifsecondargument
+ \def\dodosetupcite##1{\getparameters[\??pv##1][#2]}%
+ \processcommalist[#1]\dodosetupcite
+ \else % default case
+ \getparameters[\??pv\@@citedefault][#1]%
+ \fi }
+
+
+%D Low-level stuff
+
+\def\getcitedata#1[#2]#3[#4]#5to#6%
+ {\bgroup
+ \addthisref{#4}%
+ \dofetchapublication{#4}%
+ \doifdefinedelse{@@pb@bib#2}%
+ {\xdef#6{\getvalue{@@pb@bib#2}}}%
+ {\xdef#6{\getvalue{@@pb@#2}}}%
+ \egroup }
-\def\setupcite#1[#2]#3[#4]%
- {\def\getciteargs##1{\getparameters[\??pv##1][#4]}%
- \processcommalist[#2]\dosetupcite}
-\def\dosetupcite#1%
- {\getciteargs{#1}}
+\def\dofetchapublication#1%
+ {\makepbkvalue{#1}%
+ \processcommacommand[\bibcommandlist,crossref]\clearbibitem
+ \processcommalist [artauthor,author,editor]\clearbibitemtwo
+ \processcommacommand[\bibcommandlist]\bibitemdefs
+ \processcommalist [artauthor,author,editor,crossref]\bibitemdefs
+ \getvalue{pbdd-#1}}
+
+%D This new version writes a reference out to the tui file for every
+%D \type{\cite}. This will allow backlinking.
+%D
+%D Some special care is needed so that references are not added from
+%D weird locations like in the TOC or within a \type{\setbox} command.
+
+\newcounter\citationnumber
+
+\def\docitation#1{%
+ \iftrialtypesetting \else
+ \ifdoinpututilities\else
+ \doglobal\increment\citationnumber
+ \expanded{\rawreference{}{cite-\jobname-\citationnumber}{#1}}%
+ \fi \fi }
+
%D \macros{numreferred,doifreferredelse,addthisref,publist}
%D
@@ -814,10 +1155,11 @@
\long\def\doifreferredelse#1{\doifdefinedelse{pbr-#1}}
\def\addthisref#1%
- {\doifundefined{pbr-#1}
- {\setgvalue{pbr-#1}{a}%
+ {\doifundefinedelse{pbr-#1}
+ {\setxvalue{pbr-#1}{\citationnumber}%
\doglobal\increment\numreferred
- \appended\gdef\publist{,#1}}}
+ \ifx\publist\empty \gdef\publist{#1}\else\appended\gdef\publist{,#1}\fi}
+ {\setxvalue{pbr-#1}{\getvalue{pbr-#1},\citationnumber}}}
\let\publist\empty
@@ -827,8 +1169,8 @@
%D \type{\startpublication}.
\def\doifbibreferencefoundelse#1#2#3%
- {\doifdefinedelse{pbd-#1}
- {\restorebibdata{#1}#2}
+ {\doifdefinedelse{pbdk-#1}
+ {#2}
{\showmessage\m!bib{5}{#1 is unknown}#3}}
%D \macros{ixbibauthoryear,thebibauthors,thebibyears}
@@ -856,19 +1198,13 @@
%D
%D In `normal' \TeX, of course there are expansion problems again.
-\def\gobble#1{\def#1##1{##1}}
-
-\def\sanitizeaccents{\processcommalist[\',\`,\",\.,\c,\d,\~,\=]\gobble}
-
\def\ixbibauthoryear#1#2#3#4%
{\bgroup
- \sanitizeaccents
\gdef\ixlastcommand {#4}%
\gdef\ixsecondcommand{#3}%
\gdef\ixfirstcommand {#2}%
\glet\thebibauthors \empty
\glet\thebibyears \empty
- \glet\theauthorssize \empty
\getcommalistsize[#1]%
\ifbibcitecompress
\dorecurse\commalistsize{\xdef\thebibyears{\thebibyears,}}%
@@ -876,8 +1212,6 @@
\else
\processcommalist[#1]\donormalbibauthoryear
\fi
- \getcommacommandsize[\thebibauthors]%
- \xdef\theauthorssize{\commalistsize}%
\egroup
\dobibauthoryear}
@@ -895,8 +1229,8 @@
{\advance\scratchcounter\plusone
\edef\wantednumber{\the\scratchcounter}%
\getfromcommacommand[\thebibyears][\wantednumber]%
- \def\AU{#1}% brr
- \@EA\def\@EA\YR\@EA{\commalistelement}%
+ \@EA\def\@EA\currentbibyear\@EA{\commalistelement}%
+ \setcurrentbibauthor{#1}%
\ifnum\scratchcounter=\plusone
\ixfirstcommand
\else\ifnum \scratchcounter=\commalistsize\relax
@@ -905,6 +1239,37 @@
\ixsecondcommand
\fi\fi}
+\def\setcurrentbibauthor#1%
+ {\getcommacommandsize[#1]%
+ \ifcase\commalistsize
+ % anonymous?
+ \def\currentbibauthor{}%
+ \or
+ \def\currentbibauthor{#1}%
+ \or
+ \expanded{\docurrentbibauthor#1}%
+ \else
+ % this can't happen/
+ \def\currentbibauthor{}%
+ \fi }
+
+
+\def\docurrentbibauthor#1,#2%
+ {\doifemptyelse{#2}
+ {\def\currentbibauthor{#1\bibalternative{otherstext}}}
+ {\edef\currentbibauthor{#1%
+ \ifcase0\bibalternative{authoretallimit}\relax\or
+ \bibalternative{otherstext}\else \bibalternative{andtext}#2\fi}}}
+
+%D This is not the one Hans made for me, because I need a global
+%D edef, and the \type{\robustdoifinsetelse} doesn't listen to
+%D \type{\doglobal }
+
+\def\robustaddtocommalist#1#2% {item} \cs
+ {\robustdoifinsetelse{#1}#2\resetglobal
+ {\dodoglobal\xdef#2{\ifx#2\empty\else#2,\fi#1}}}
+
+
%D \macros{donormalbibauthoryear}
%D
%D Now we get to the macros that fill the two lists.
@@ -912,14 +1277,14 @@
\def\donormalbibauthoryear#1%
{\addthisref{#1}%
- \xdef\myauthor{Xxxxxxxxxx}%
- \xdef\myyear{0000}%
+ \def\myauthor{Xxxxxxxxxx}%
+ \def\myyear{0000}%
\doifbibreferencefoundelse{#1}
- {\@EA\gdef\@EA\myauthor\@EA{\@@pba}%
- \@EA\gdef\@EA\myyear \@EA{\@@pby}}
+ {\def\myauthor{{\getvalue{pbda-#1}}}%
+ \def\myyear {\getvalue{pbdy-#1}}}%
{}%
- \@EA\doglobal\@EA\addtocommalist\@EA{\myauthor}\thebibauthors
- \@EA\doglobal\@EA\addtocommalist\@EA{\myyear }\thebibyears}
+ \@EA\doglobal\@EA\appendtocommalist\@EA{\myauthor}\thebibauthors
+ \@EA\doglobal\@EA\appendtocommalist\@EA{\myyear }\thebibyears}
%D \macros{docompressbibauthoryear}
%D
@@ -929,11 +1294,11 @@
\def\docompressbibauthoryear#1%
{\addthisref{#1}%
- \xdef\myauthor{Xxxxxxxxxx}%
- \xdef\myyear {0000}%
+ \def\myauthor{Xxxxxxxxxx}%
+ \def\myyear {0000}%
\doifbibreferencefoundelse{#1}
- {\@EA\gdef\@EA\myauthor\@EA{\@@pba}%
- \@EA\gdef\@EA\myyear \@EA{\@@pby}}
+ {\xdef\myauthor{\csname pbda-#1\endcsname }%
+ \xdef\myyear {\csname pbdy-#1\endcsname }}
{}%
\ifx\myauthor\empty\else
\checkifmyauthoralreadyexists
@@ -953,12 +1318,15 @@
\def\checkifmyauthoralreadyexists
{\doifemptyelsevalue{thebibauthors}
- {\global\bibitemcounter\plusone
- \global\bibitemwanted \plusone
- \@EA\gdef\@EA\thebibauthors\@EA{\myauthor}} % hh: one level
- {\getcommacommandsize[\thebibauthors]%
- \global\bibitemwanted\zerocount
+ {\global\bibitemwanted \plusone
+ \global\bibitemcounter \plusone
+ \xdef\thebibauthors{{\myauthor}}}
+ {% the next weirdness is because according to \getcommalistsize,
+ % the length of \type{[{{},{}}]} is 2.
+ \@EA\getcommalistsize\@EA[\thebibauthors,]%
\global\bibitemcounter\commalistsize
+ \global\advance\bibitemcounter\minusone
+ \global\bibitemwanted \zerocount
\processcommacommand[\thebibauthors]\docomparemyauthor}}
%D The outer \type{\ifnum} accomplishes the addition of
@@ -971,16 +1339,15 @@
\def\docomparemyauthor#1%
{\global\advance\bibitemwanted \plusone
\def\mytempc{#1}%
- \ifnum\bibitemwanted = \commalistsize\relax
- \ifx\mytempc\myauthor \else
+% \message{authors: \myauthor <=>\mytempc \ifx\mytempc\myauthor :Y \else :N
+% \meaning \myauthor, \meaning\mytempc\fi (\the\bibitemwanted = \the\bibitemcounter)}%
+ \ifx\mytempc\myauthor
+ \quitcommalist
+ \else
+ \ifnum\bibitemwanted = \bibitemcounter\relax
\global\advance\bibitemwanted \plusone
\global\bibitemcounter\bibitemwanted\relax
- \@EA\doglobal\@EA\addtocommalist\@EA{\myauthor}\thebibauthors
- \quitcommalist
- \fi
- \else
- \ifx\mytempc\myauthor
- \quitcommalist
+ \@EA\doglobal\@EA\robustaddtocommalist\@EA{{\myauthor}}\thebibauthors
\fi
\fi}
@@ -997,48 +1364,174 @@
\edef\newcommalistelement{\myyear}%
\doglobal\replaceincommalist \thebibyears \wantednumber}
+
+%D \macros{preparebibrefprefix}
+%D
+%D The reference list only writes bare references when the criterium
+%D is `all'. Otherwise, a prefix is added to make sure that pdfTeX
+%D does not encounter duplicate named references. On the generation
+%D side, this is not a big problem. \type{\preparebibrefprefix}
+%D creates a suitable string to prepend if a prefix is needed.
+%D
+%D Because this macro is used within \type{\cite } that itself
+%D can be used within lists like the table of contents, it needs
+%D to save and restore \type{\savedalltoclevels} and
+%D \type{\currentlevel} (\type{\dosetfilterlevel} needs to change
+%D their values globally).
+
+\def\preparebibrefprefix
+ {\chardef\savedalltoclevels \alltoclevels
+ \let\savedcurrentlevel\currentlevel
+ \let\dosetfilterlevel\patcheddosetfilterlevel
+ \dosettoclevel\??li{pubs}%
+ \edef\bibrefprefix{\@@sectiontype\currentlevel\sectionseparator}%
+ \let\dosetfilterlevel\normaldosetfilterlevel
+ \global\let\currentlevel\savedcurrentlevel
+ \global\chardef\alltoclevels \savedalltoclevels }
+
+%D \macros{preparebibreflist}
+%D
+%D But this optional prefixing is a bit of a problem on the
+%D other side. We would like to do \type{\goto{}[article-full]}
+%D but can't do it like that, because the actual label may be
+%D \type{1:2:0:3:4:article-full]} or so. The problem is solved
+%D by building a commalist that looks like this:
+%D \starttyping
+%D \def\bibreflist%
+%D {1:2:0:3:4:article-full,
+%D 1:2:0:3:article-full,
+%D 1:2:0:article-full,
+%D 1:2:article-full,
+%D 1:article-full,
+%D article-full}
+%D \stoptyping
+
+\def\preparebibreflist#1%
+ {\let\bibreflist\empty
+ \def\storeitem##1%
+ {\ifx\bibreflist\empty
+ \edef\prefix{##1\sectionseparator}%
+ \edef\bibreflist{\prefix#1,#1}%
+ \else
+ \edef\prefix{\prefix##1\sectionseparator}%
+ \edef\bibreflist{\prefix#1,\bibreflist}%
+ \fi}%
+ \expanded{\processseparatedlist[\bibrefprefix][\sectionseparator]}\storeitem }
+
+%D \macros{gotobiblink,inbiblink,atbiblink}
+%D
+%D The final task is looping over that list until a match is found.
+
+\newif\ifbibreffound
+
+\def\gotobiblink#1[#2]%
+ {\bgroup
+ \preparebibrefprefix
+ \preparebibreflist{#2}%
+ \global\bibreffoundfalse
+ \def\setuplink##1%
+ {\ifbibreffound\else
+ \doifreferencefoundelse
+ {##1}
+ {\global\bibreffoundtrue \goto{#1}[##1]}%
+ {}\fi}%
+ \processcommacommand[\bibreflist]\setuplink
+ \ifbibreffound \else \unknownreference{#2}\fi
+ \egroup }
+
+\def\atbiblink[#1]%
+ {\bgroup
+ \preparebibrefprefix
+ \preparebibreflist{#1}%
+ \global\bibreffoundfalse
+ \def\setuplink##1%
+ {\ifbibreffound\else
+ \doifreferencefoundelse
+ {##1}
+ {\global\bibreffoundtrue \at[##1]}%
+ {}\fi}%
+ \processcommacommand[\bibreflist]\setuplink
+ \ifbibreffound \else \unknownreference{#1}\fi
+ \egroup }
+
+\def\inbiblink[#1]%
+ {\bgroup
+ \preparebibrefprefix
+ \preparebibreflist{#1}%
+ \global\bibreffoundfalse
+ \def\setuplink##1%
+ {\ifbibreffound\else
+ \doifreferencefoundelse
+ {##1}
+ {\global\bibreffoundtrue \in[##1]}%
+ {}\fi}%
+ \processcommacommand[\bibreflist]\setuplink
+ \ifbibreffound \else \unknownreference{#1}\fi
+ \egroup }
+
%D \macros{bibauthoryearref,bibauthoryearsref,bibauthorref,bibyearref}
%D
%D Now that all the hard work has been done, these are simple.
%D \type{\ixbibauthoryearref} stores the data in the macros
-%D \type{\AU} and \type{\YR}.
+%D \type{\currentbibauthor} and \type{\currentbibyear}.
+
+\def\ifbibinteractionelse%
+ {\iflocation
+ \edef\test{\bibalternative\c!interaction}%
+ \ifx\test\v!stop
+ \@EA\@EA\@EA\secondoftwoarguments
+ \else
+ \@EA\@EA\@EA\firstoftwoarguments
+ \fi
+ \else
+ \@EA\secondoftwoarguments
+ \fi
+ }
+
+\def\bibmaybeinteractive#1#2%
+ {\ifbibcitecompress #2\else
+ \ifbibinteractionelse{\gotobiblink{#2}[#1]}{#2}\fi }
\def\bibauthoryearref[#1]%
{\ixbibauthoryear{#1}%
- {{\AU}\bibalternative\c!inbetween
- \bibalternative\v!left{\YR}\bibalternative\v!right}
- {\bibalternative\c!pubsep{\AU}\bibalternative\c!inbetween
- \bibalternative\v!left {\YR}\bibalternative\v!right}
- {\bibalternative\c!lastpubsep{\AU}\bibalternative\c!inbetween
- \bibalternative\v!left {\YR}\bibalternative\v!right}}
+ {\bibmaybeinteractive{#1}{{\currentbibauthor}\bibalternative\c!inbetween
+ \bibalternative\v!left{\currentbibyear}\bibalternative\v!right}}
+ {\bibalternative\c!pubsep
+ \bibmaybeinteractive{#1}{{\currentbibauthor}\bibalternative\c!inbetween
+ \bibalternative\v!left {\currentbibyear}\bibalternative\v!right}}
+ {\bibalternative\c!lastpubsep
+ \bibmaybeinteractive{#1}{{\currentbibauthor}\bibalternative\c!inbetween
+ \bibalternative\v!left {\currentbibyear}\bibalternative\v!right}}}
\def\bibauthoryearsref[#1]%
{\bibalternative\v!left
\ixbibauthoryear{#1}
- {{\AU}\bibalternative\c!inbetween{\YR}}
- {\bibalternative\c!pubsep {\AU}\bibalternative\c!inbetween{\YR}}
- {\bibalternative\c!lastpubsep{\AU}\bibalternative\c!inbetween{\YR}}%
+ {\bibmaybeinteractive{#1}{{\currentbibauthor}\bibalternative\c!inbetween{\currentbibyear}}}
+ {\bibalternative\c!pubsep
+ \bibmaybeinteractive{#1}{{\currentbibauthor}\bibalternative\c!inbetween{\currentbibyear}}}
+ {\bibalternative\c!lastpubsep
+ \bibmaybeinteractive{#1}{{\currentbibauthor}\bibalternative\c!inbetween{\currentbibyear}}}%
\bibalternative\v!right}
\def\bibauthorref[#1]%
{\bibalternative\v!left
\ixbibauthoryear{#1}%
- {{\AU}}
- {\bibalternative\c!pubsep {\AU}}
- {\bibalternative\c!lastpubsep{\AU}}%
+ {\bibmaybeinteractive{#1}{{\currentbibauthor}}}
+ {\bibalternative\c!pubsep \bibmaybeinteractive{#1}{{\currentbibauthor}}}
+ {\bibalternative\c!lastpubsep\bibmaybeinteractive{#1}{{\currentbibauthor}}}%
\bibalternative\v!right}
\def\bibyearref[#1]%
{\bibalternative\v!left
\ixbibauthoryear{#1}%
- {{\YR}}
- {\bibalternative\c!pubsep {\YR}}
- {\bibalternative\c!lastpubsep{\YR}}%
+ {\bibmaybeinteractive{#1}{{\currentbibyear}}}
+ {\bibalternative\c!pubsep \bibmaybeinteractive{#1}{{\currentbibyear}}}
+ {\bibalternative\c!lastpubsep\bibmaybeinteractive{#1}{{\currentbibyear}}}%
\bibalternative\v!right}
%D ML problems:
-%D \macros{bibshortref,bibkeyref,bibpageref,bibtyperef,bibnumberref}
+%D \macros{bibshortref,bibkeyref,bibpageref,bibtyperef,bibserialref}
%D
%D There is hardly any point in trying to compress these. The only
%D thing that needs to be done is making sure that
@@ -1051,22 +1544,24 @@
\def\bibshortref[#1]%
{\bibalternative\v!left
- \firstreftrue\processcommalist[#1]\dobibshort
+ \firstreftrue\processcommalist[#1]\dobibshortref
\bibalternative\v!right}
-\def\dobibshort#1%
+\def\dobibshortref#1%
{\addthisref{#1}\refsep
- \doifbibreferencefoundelse{#1}{\@@pbs}{??}}
+ \doifbibreferencefoundelse{#1}{\gotobiblink{\getvalue{pbds-#1}}[#1]}
+ {\unknownreference{#1}}}
-\def\bibnumberref[#1]%
+\def\bibserialref[#1]%
{\bibalternative\v!left
- \firstreftrue\processcommalist[#1]\dobibnumbered
+ \firstreftrue\processcommalist[#1]\dobibserialref
\bibalternative\v!right}
-\def\dobibnumbered#1%
+\def\dobibserialref#1%
{\addthisref{#1}\refsep
- \doifbibreferencefoundelse{#1}{\@@pbn}{??}}
+ \doifbibreferencefoundelse{#1}{\gotobiblink{\getvalue{pbdn-#1}}[#1]}
+ {\unknownreference{#1}}}
\def\bibkeyref[#1]%
{\bibalternative\v!left
@@ -1074,7 +1569,12 @@
\bibalternative\v!right}
\def\dobibkeyref#1%
- {\addthisref{#1}\refsep#1}
+ {\addthisref{#1}\refsep\gotobiblink{#1}[#1]}
+
+\def\gotoDOI#1#2%
+ {\ifbibinteractionelse
+ {\useURL[bibfoo#1][http://dx.doi.org/#2]\goto{\url[bibfoo#1]}[url(bibfoo#1)]}
+ {\hyphenatedurl{#2}}}
\def\bibdoiref[#1]%
{\bibalternative\v!left
@@ -1082,7 +1582,25 @@
\bibalternative\v!right}
\def\dobibdoiref#1%
- {\addthisref{#1}\refsep#1}
+ {\addthisref{#1}\refsep
+ \doifbibreferencefoundelse{#1}{\expanded{\gotoDOI{#1}{\getvalue{pbdo-#1}}}}
+ {\unknownreference{#1}}}
+
+
+\def\biburlref[#1]%
+ {\bibalternative\v!left
+ \firstreftrue\processcommalist[#1]\dobiburlref
+ \bibalternative\v!right}
+
+\def\gotoURL#1#2%
+ {\ifbibinteractionelse
+ {\useURL[bibfoo#1][#2]\goto{\url[bibfoo#1]}[url(bibfoo#1)]}
+ {\hyphenatedurl{#2}}}
+
+\def\dobiburlref#1%
+ {\addthisref{#1}\refsep
+ \doifbibreferencefoundelse{#1}{\expanded{\gotoURL{#1}{\getvalue{pbdu-#1}}}}
+ {\unknownreference{#1}}}
\def\bibtyperef[#1]%
{\bibalternative\v!left
@@ -1091,7 +1609,8 @@
\def\dobibtyperef#1%
{\addthisref{#1}\refsep
- \doifbibreferencefoundelse{#1}{\@@pbt}{??}}
+ \doifbibreferencefoundelse{#1}{\gotobiblink{\getvalue{pbdt-#1}}[#1]}
+ {\unknownreference{#1}}}
\def\bibpageref[#1]%
{\bibalternative\v!left
@@ -1099,7 +1618,8 @@
\bibalternative\v!right}
\def\dobibpageref#1%
- {\addthisref{#1}\refsep\at[#1]}
+ {\addthisref{#1}\refsep
+ \ifbibinteractionelse{\atbiblink[#1]}{{\referencingfalse\at[#1]}}}
\def\bibdataref[#1]%
{\bibalternative\v!left
@@ -1108,7 +1628,10 @@
\def\dobibdata#1%
{\addthisref{#1}\refsep
- \doifbibreferencefoundelse{#1}{\dotypesetapublication{#1}}{??}}
+ \doifbibreferencefoundelse{#1}{\dotypesetapublication{#1}}
+ {\unknownreference{#1}}}
+
+\let\bibnoneref\nocite
%D \macros{bibnumref}
%D
@@ -1122,20 +1645,27 @@
%D so that the macro \type{\expandrefs} is needed.
\def\expandrefs#1%
- {\doifreferencefoundelse{#1}
- {\@EA\doglobal\@EA\addtocommalist\@EA{\reftypet}\therefs }
- {\showmessage\m!bib{5}{#1 unknown}%
- \doglobal\addtocommalist{0}\therefs}}
+ {\bgroup
+ \preparebibrefprefix
+ \preparebibreflist{#1}%
+ \global\bibreffoundfalse
+ \def\setuplink##1%
+ {\ifbibreffound\else
+ \doifreferencefoundelse
+ {##1}
+ {\global\bibreffoundtrue
+ \@EA\doglobal\@EA\addtocommalist\@EA{\reftypet}\therefs }%
+ {}\fi}%
+ \processcommacommand[\bibreflist]\setuplink
+ \ifbibreffound \else \showmessage\m!bib{5}{#1 unknown}%
+ \doglobal\addtocommalist{0}\therefs\fi
+ \egroup }
+
%D But at least the actual sorting code is simple (note that sorting
%D a list with exactly one entry fails to return anything, which
%D is why the \type{\ifx} is needed).
-\ifx\compresscommacommandnrs\undefined
- \usemodule[list]
- \let\compresscommacommandnrs\compresscommacommand
-\fi
-
\def\bibnumref[#1]%
{\bibalternative\v!left
\penalty\!!tenthousand
@@ -1149,31 +1679,49 @@
\let\therefs\sortedcommalist
\fi
\compresscommacommandnrs[\therefs]%
- % \message{\meaning\therefs, \meaning\compressedlist}%
\processcommacommand[\compressedlist]\verysimplebibnumref
\else
\processcommalist[#1]\dosimplebibnumref
\fi
\bibalternative\v!right}
-%D Here is the simple case first:
+\def\dosimplebibnumref #1%
+ {\refsep\ifbibinteractionelse
+ {\inbiblink[#1]}{{\referencingfalse\inbiblink[#1]}}}
-\def\dosimplebibnumref #1{\refsep\in[#1]}
\def\verysimplebibnumref#1{\doverysimplebibnumref#1}
\def\doverysimplebibnumref#1#2%
{\refsep
- \ifcase#1\relax ??\else
+ \ifcase#1\relax \unknownreference{#1}\else
\def\tempa{#2}\ifx\empty\tempa#1\else#1\bibalternative\c!inbetween#2\fi
\fi}
-%D And some defaults are loaded from bibl-apa:
+%D By request from Sanjoy. This makes it easier to implement
+%D \type{\citeasnoun}.
+
+\def\bibauthornumref[#1]%
+ {\getcommalistsize[#1]
+ \global\bibitemcounter\commalistsize
+ \firstreftrue
+ \processcommalist[#1]\dobibauthornumref }
-% hh: shouldn't those bibl files be made international ?
+\def\dobibauthornumref#1%
+ {\addthisref{#1}\refsep
+ \doifbibreferencefoundelse{#1}
+ {\getvalue{pbda-#1}%
+ \bibalternative\c!inbetween
+ \bibalternative\v!left
+ \ifbibinteractionelse{\inbiblink[#1]}
+ {{\referencingfalse\inbiblink[#1]}}%
+ \bibalternative\v!right}
+ {\unknownreference{#1}}}
+
+%D And some defaults are loaded from bibl-apa:
\setuppublications
- [\c!alternative=apa]
+ [\v!month\v!conversion=,\c!alternative=apa]
-%D \completepublications
+\preloadbiblist
-\protect \endinput
+\protect \endinput \ No newline at end of file