Dear all, I'm in need for a few custom cite commands like these: 1. \cite[alternative=authortitle, extras={, p.\,13}][citekey] should yield {\sc AuthorLastName}, AuthorFirstName, {\it title}, p.\,13 2. \cite[alternative=title][citekey] {\it title} How would I code these commands? Oliver
On 05/02/2011 04:05 PM, Oliver Buerschaper wrote:
Dear all,
I'm in need for a few custom cite commands like these:
1. \cite[alternative=authortitle, extras={, p.\,13}][citekey] should yield
{\sc AuthorLastName}, AuthorFirstName, {\it title}, p.\,13
2. \cite[alternative=title][citekey]
{\it title}
How would I code these commands?
There is no quick answer to this. The easiest way is to use the \getcitedata command to create a dedicated macro for the class you need, and that is explained in the bib module manual. Otherwise, you will have to dive into the sources to see how e.g. '\bibauthoryearref' and '\bibshortref' are implemented. If you create the \bibtitleref and \bibauthortitleref macros, these will be executed automatically. Best wishes, Taco
I'm in need for a few custom cite commands like these:
1. \cite[alternative=authortitle, extras={, p.\,13}][citekey] should yield
{\sc AuthorLastName}, AuthorFirstName, {\it title}, p.\,13
2. \cite[alternative=title][citekey]
{\it title}
How would I code these commands?
There is no quick answer to this. The easiest way is to use the \getcitedata command to create a dedicated macro for the class you need, and that is explained in the bib module manual.
Otherwise, you will have to dive into the sources to see how e.g. '\bibauthoryearref' and '\bibshortref' are implemented. If you create the \bibtitleref and \bibauthortitleref macros, these will be executed automatically.
Many thanks, Taco! I'm realizing I asked you the same kind of question three years before… apologies for forgetting. In any case I've just tried the solution you gave me back then (based on \getcitedata) but unfortunately it doesn't work any longer: the \specialcite command below doesn't output anything for me. --- \startpublication [a=Kitaev, k=Kitaev:2003, t=article, y=2003] \artauthor{Alexei~Y.}[A.\,Y.]{}{Kitaev} \arttitle{Fault-tolerant quantum computation by anyons} \journal{Annals of Physics} \pages{2--30} \pubyear{2003} \volume{303} \stoppublication \def\MYauthor#1#2#3#4#5{#4\,{\sc #3}} \def\specialcite#1[#2]% {\bgroup \getcitedata[author1][#2] to \mauthors \getcitedata[title][#2] to \mtitle \expandafter\MYauthor\mauthors: {\it\mtitle}% \egroup} \starttext \specialcite[Kitaev:2003] \cite[authoryear][Kitaev:2003] \completepublications [criterium=all] \stoptext --- Can you think of another workaround? Many thanks, Oliver
On 05/05/2011 01:55 PM, Oliver Buerschaper wrote:
I'm in need for a few custom cite commands like these:
1. \cite[alternative=authortitle, extras={, p.\,13}][citekey] should yield
{\sc AuthorLastName}, AuthorFirstName, {\it title}, p.\,13
2. \cite[alternative=title][citekey]
{\it title}
How would I code these commands?
There is no quick answer to this. The easiest way is to use the \getcitedata command to create a dedicated macro for the class you need, and that is explained in the bib module manual.
Otherwise, you will have to dive into the sources to see how e.g. '\bibauthoryearref' and '\bibshortref' are implemented. If you create the \bibtitleref and \bibauthortitleref macros, these will be executed automatically.
Many thanks, Taco!
I'm realizing I asked you the same kind of question three years before… apologies for forgetting. In any case I've just tried the solution you gave me back then (based on \getcitedata) but unfortunately it doesn't work any longer: the \specialcite command below doesn't output anything for me.
Subtle incompatibility here: you need \def\specialcite#1[#2]% {\bgroup \getcitedata[artauthor1][#2] to \mauthors \getcitedata[arttitle][#2] to \mtitle \expandafter\MYauthor\mauthors: {\it\mtitle}% \egroup} for current mkiv. Best wishes, Taco
participants (2)
-
Oliver Buerschaper
-
Taco Hoekwater