From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/53055 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: Need help with bibliography Date: Sun, 20 Sep 2009 19:46:12 -0400 (EDT) Message-ID: References: <86d68cc30909200430s61aaf373h7f990791689f956b@mail.gmail.com> <86d68cc30909201541s550ab8e0m728a92691d1a9ab3@mail.gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1253490414 16567 80.91.229.12 (20 Sep 2009 23:46:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 20 Sep 2009 23:46:54 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Sep 21 01:46:47 2009 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.50) id 1MpW7C-0003sa-KG for gctc-ntg-context-518@m.gmane.org; Mon, 21 Sep 2009 01:46:46 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id A09F3C9AE3; Mon, 21 Sep 2009 01:46:40 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id y4Cd0Nd1APid; Mon, 21 Sep 2009 01:46:40 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 09908C9A63; Mon, 21 Sep 2009 01:46:36 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 6F146C9A63 for ; Mon, 21 Sep 2009 01:46:33 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id gHURcr1xHlJU for ; Mon, 21 Sep 2009 01:46:29 +0200 (CEST) Original-Received: from tombraider.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.93.161]) by balder.ntg.nl (Postfix) with ESMTP id 3AE66C9A1F for ; Mon, 21 Sep 2009 01:46:28 +0200 (CEST) Original-Received: FROM [192.168.2.8] (c-76-28-91-31.hsd1.ct.comcast.net [76.28.91.31]) By tombraider.mr.itd.umich.edu ID 4AB6BED3.6DDE2.20432 ; Authuser adityam; 20 Sep 2009 19:46:27 EDT In-Reply-To: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 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 Xref: news.gmane.org gmane.comp.tex.context:53055 Archived-At: On Sun, 20 Sep 2009, Aditya Mahajan wrote: > On Mon, 21 Sep 2009, Mika Ritola wrote: > >> 2009/9/20 Thomas A. Schmitz >> >>> >>> On Sep 20, 2009, at 1:30 PM, Mika Ritola wrote: >>> >>> >>>> 1. This one's probably very simple: there's the /insertauthors macro for >>>> inserting the whole name of the author. But how do you insert just the >>>> last >>>> name of the author? >>>> >>>> >>> If you just want the last name, you can use \cite[author][], but >>> I'm not sure if this what you're after, maybe you'll need to tell us more. >>> >> I'll try to give a clearer explanation. First of all, when I cite a source >> using e.g. \cite[Smith2000], this should appear in the text as "Smith >> 2000". >> I've already managed to do this. Now, each entry in the bibliography should >> begin with the same string that was used to identify it within the text. >> So, >> the above example should look something like this: >> >> Smith 2000John Smith. Generic Book Title. Whatever Publishing Company, >> New York 2000. >> >> I know I can get the "John Smith" by using \insertauthors in >> \setuppublicationlayout. But how do I get just the last name? > > I do not know an inbuilt way of doing this. You can probably use an ugly > hacks like this: Slightly more clean solution. The current value of the citation is stored as \@@pbk, so you can use \cite to extract whatever data you want. So, \setuppublicationlayout[article]% {\insertartauthors {\cite[alternative=authoryear, left=,right={\quad}][\@@pbk]} {,} {}% \insertarttitle {\space\quotation\bgroup} {,\egroup} {}% \insertjournal {\space\bgroup \it} {\unskip\/\egroup} {}% \insertvolume {,\space vol.~} {\insertissue {,\space no.~} {} {}} {}% \insertpages {,\space pp.\space} {} {}% \insertpubyear {,\space\insertmonth{}{\space}{}} {} {}% \insertnote {.\space} {.} {.}} Aditya ___________________________________________________________________________________ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________