From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/53054 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:30:28 -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 1253489467 14650 80.91.229.12 (20 Sep 2009 23:31:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 20 Sep 2009 23:31:07 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Sep 21 01:31:00 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 1MpVrv-0000V7-Dh for gctc-ntg-context-518@m.gmane.org; Mon, 21 Sep 2009 01:30:59 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 3076AC9A1F; Mon, 21 Sep 2009 01:30:58 +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 WtyUcpq-3ypo; Mon, 21 Sep 2009 01:30:54 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id ABDFDC9A63; Mon, 21 Sep 2009 01:30:53 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id DCC6EC9A63 for ; Mon, 21 Sep 2009 01:30:50 +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 5YmQLyEg57dy for ; Mon, 21 Sep 2009 01:30:46 +0200 (CEST) Original-Received: from skycaptain.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.93.160]) by balder.ntg.nl (Postfix) with ESMTP id 013F6C9A1F for ; Mon, 21 Sep 2009 01:30:45 +0200 (CEST) Original-Received: FROM [192.168.2.8] (c-76-28-91-31.hsd1.ct.comcast.net [76.28.91.31]) By skycaptain.mr.itd.umich.edu ID 4AB6BB24.429B.17164 ; Authuser adityam; 20 Sep 2009 19:30:44 EDT In-Reply-To: <86d68cc30909201541s550ab8e0m728a92691d1a9ab3@mail.gmail.com> 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:53054 Archived-At: 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: \usemodule[bib] \unprotect \def\authorlastname#1#2#3#4#5% {%\bibdoif{#1}{#1\bibalternative\c!firstnamesep}% \bibdoif{#2}{#2\bibalternative\c!vonsep}% #3% \bibdoif{#5}{\bibalternative\c!surnamesep#5\unskip}% % Set a macro for full name \def\fullauthorname{\invertedauthor{#1}{#2}{#3}{#4}{#5}}} \protect \setuppublicationlayout[article]% {\insertartauthors {} {\space\insertpubyear{}{}{}\quad\fullauthorname,} {}% % The above statement uses the full name set in authorlastname \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} {.} {.}} \setuppublicationlist [artauthor=\authorlastname] \startpublication[k=smith:2000,t=article, a={{Smith}},y=2000, n=1,s=Smt00] \artauthor[]{John}[J.]{}{Smith} \pubyear{2000} \arttitle{The theory of everything} \journal{A fancy journal} \volume{22} \pages{379-423} \month{7} \stoppublication \starttext See~\cite[smith:2000] \placepublications \stoptext > The answer is probably so simple that I should be ashamed that I can't > figure it out by myself but I haven't quite gotten the hang of ConTeXt > and TeX yet... With TeX, simple things are not always simple. 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 ___________________________________________________________________________________