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][<citekey>], 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 2000<tab>John 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