From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/22820 Path: news.gmane.org!not-for-mail From: Idris Samawi Hamid Newsgroups: gmane.comp.tex.context Subject: bib module: author-date macros Date: Sun, 2 Oct 2005 17:43:50 -0600 Message-ID: <4341E107@webmail.colostate.edu> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1128296693 22931 80.91.229.2 (2 Oct 2005 23:44:53 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 2 Oct 2005 23:44:53 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Mon Oct 03 01:44:51 2005 Return-path: Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1EMDUn-0003hU-29 for gctc-ntg-context-518@m.gmane.org; Mon, 03 Oct 2005 01:43:53 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 9443E12833; Mon, 3 Oct 2005 01:43:52 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 13540-05; Mon, 3 Oct 2005 01:43:47 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 8E39212829; Mon, 3 Oct 2005 01:43:47 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 23D4312829 for ; Mon, 3 Oct 2005 01:43:46 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 13596-01 for ; Mon, 3 Oct 2005 01:43:45 +0200 (CEST) Original-Received: from eagle.colostate.edu (eagle.acns.colostate.edu [129.82.100.90]) by ronja.ntg.nl (Postfix) with ESMTP id 7860D12828 for ; Mon, 3 Oct 2005 01:43:44 +0200 (CEST) Original-Received: from lamar.ColoState.EDU (lamar.acns.colostate.edu [129.82.100.75]) by eagle.colostate.edu (AIX5.1/8.11.6p2/8.11.0) with ESMTP id j92NhhI53308 for ; Sun, 2 Oct 2005 17:43:43 -0600 Original-Received: from webmail.colostate.edu (csunts4.acns.colostate.edu [129.82.100.135]) by lamar.ColoState.EDU (AIX5.3/8.11.6p2/8.11.0) with ESMTP id j92NhhD3788922 for ; Sun, 2 Oct 2005 17:43:43 -0600 X-WebMail-UserID: ishamid Original-To: mailing list for ConTeXt users X-EXP32-SerialNo: 00002247, 00002264 X-Mailer: Infinite Mobile Delivery (Hydra) SMTP v3.62.01 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on smtp.ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:22820 Archived-At: Here are some macros that I use; I was wondering if the new bib module has a better way to implement the following, since this sort of thing is used quite frequently in the author-date system that t-bib defaults to. See the examples in the following file (three depend on \cite[year] which has a problem--see previous mail). I would really appreciate suggestions for improving this-) Best Idris ==========test-bib-macros.tex========== % output=pdf interface=en \setupwhitespace[big] \usemodule[bib] \setuppublications[alternative=apa] \setuppublications[autohang=yes] \setuppublications[numbering=no] \setuppublications[criterium=cite] \setuppublications[sorttype=bbl] \setuppublicationlist[totalnumber={},samplesize=,author={\invertedauthor}] \setupcite[authoryears][left={(},inbetween={ }, right={)}] \def\citeauthoryear[#1]{% {\setupcite[authoryears][right={)},inbetween={ }]% \cite[authoryears][#1]% }% } \def\citeyear[#1]{% {\cite[year][#1]% }% } \def\citeauthoryearpage[#1][#2]{% {\setupcite[authoryears][right={, #2)},inbetween={ }]% \cite[authoryears][#1]% }% } \def\citeyearpage[#1][#2]{% {\setupcite[year][right={, #2)},inbetween={ }]% \cite[year][#1]% }% } \def\citeauthorout[#1]{% {\setupcite[authoryears][left={}, right={)},inbetween={ (}]% \cite[authoryears][#1]% }% } \def\citeauthoroutpage[#1][#2]{% {\setupcite[authoryears][left={}, right={, #2)},inbetween={ (}]% \cite[authoryears][#1]% }% } \def\citeleft[#1]{% {\setupcite[authoryears][left={(}, right={, },inbetween={ }]% \cite[authoryears][#1]% }% } \def\citeleftpage[#1][#2]{% {\setupcite[authoryears][left={(}, right={, #2; },inbetween={ }]% \cite[authoryears][#1]% }% } \def\citemiddle[#1]{% {\setupcite[authoryears][left={}, right={, },inbetween={ }]% \cite[authoryears][#1]% }% } \def\citeright[#1]{% {\setupcite[authoryears][left={}, right={)},inbetween={ }]% \cite[authoryears][#1]% }% } \def\citemiddlepage[#1][#2]{% {\setupcite[authoryears][left={}, right={, #2; },inbetween={ }]% \cite[authoryears][#1]% }% } \def\citerightpage[#1][#2]{% {\setupcite[authoryears][left={}, right={, #2)},inbetween={ }]% \cite[authoryears][#1]% }% } \input test-bib.bbl \starttext % examples \dots as someone else pointed out \cite[afghani60]. \dots as someone else pointed out\citeauthoryear[afghani60]. %\dots as Afghani points out \cite[year][afghani60]. % crashes %\dots as Afghani points out \citeyear[afghani60]. % crashes %\citeyearpage[afghani60][p.~20]. % crashes \dots as someone else pointed out\citeauthoryearpage[afghani60][p.~20]. See \citeauthorout[afghani60]. See \citeauthoroutpage[afghani60][p.~20]. \dots as others have pointed out\citeleft[afghani60]% \citemiddle[afghani60]% \citeright[afghani60]. \dots as others have pointed out\citeleftpage[afghani60][p.~20]% \citemiddlepage[afghani60][p.~20]% \citerightpage[afghani60][p.~20]. % \citeypage[afghani60][p.~20] %(1956, p. 20) \section{References}{\tfx\setupinterlinespace {\placepublications}} \stoptext ========================================= ==============test-bib.bbl=============== \startpublication[k=afghani60, t=book, a=Afgh\=an\=i, y=1960, s=] \author[]{Sa\high{c}\=id}[]{}{Al-Afgh\=an\=i} \title{Asw\=aqu \~al-\high{c}Arab f\=i \~al-J\=ahiliyya\~h wa \~al-Isl\=am} \pubname{D\=aru \~al-Fikr} \city{Damascus} \pubyear{1960} \stoppublication ========================================= ============================ Professor Idris Samawi Hamid Department of Philosophy Colorado State University Fort Collins, CO 80523