After I have seen your code snippet, the command \btxflushauthornormal grabbed my attention. This command and its variations are indeed what I was looking for. As I think the documentation doesn't mention these advanced commands, I didn't even know they exist. Thanks for sharing your discovery!
Agoston Am Fr., 27. Aug. 2021 um 05:09 Uhr schrieb Joey McCollum via ntg-context <ntg-context@ntg.nl>: > > Nevermind, it looks like there's an even more deliberate and succinct way to > handle this! In publ-ini.mkiv, the \currentbtxciteauthorbyfield command shows > how to print the author field mapped according to the cite style: > > ``` > \unexpanded\def\currentbtxciteauthorbyfield > {\begingroup > %\setbtxparameterset\s!cite\s!author > % the alternatives inherit from cite:author > % and APA distinguishes authoryears from authoryear ("and" vs. "&") > \setbtxparameterset\s!cite\currentbtxcitealternative > \clf_btxauthor > {\currentbtxdataset}% > {\currentbtxtag}% > {\currentbtxauthorfield}% > {% > combiner {\btxparameter\c!authorconversion}% > kind {cite}% > etallimit {\btxparameter\c!etallimit}% > etaldisplay {\btxparameter\c!etaldisplay}% > etaloption {\btxparameter\c!etaloption}% > symbol {\btxparameter{\c!stopper:initials}}% > }% > \relax > \endgroup} > ``` > > The snippet above might offer some guidance on how to handle this problem > more generally, but for my specific use case, it suffices to invoke the > \currentbtxciteauthorbyfield command: > > ``` > \doifelse {\currentbtxcitealternative} {entry} { > % Normal order for in-text citations > \currentbtxciteauthorbyfield > } { > % Inverted order for list citations > % TODO: need to print the first name inverted, with all subsequent names > in normal order > \btxflush{author} > } > ``` > > I get the feeling that there are more relevant commands in publ-ini.mkiv that > are intended to help with this kind of thing, but I've just been unaware of > most of them. The existing bibliography documentation only covers the tip of > the iceberg! > > Anyway, I realized that a couple months ago, Ágoston Volcz raised a similar > issue in another thread. I think this approach should solve that problem, so > when I get a chance, I can send an e-mail about that. > > Joey > > On Thu, Aug 26, 2021 at 3:38 PM Joey McCollum <jmccollum20140...@gmail.com> > wrote: >> >> Okay, I've made some progress! Thankfully, the authorconversion rules can be >> overridden using some of the methods defined in publ-ini.mkiv. I now have >> something like this in my rendering's .mkvi file: >> >> ``` >> \doifelse {\currentbtxcitealternative} {entry} { >> % Normal order for in-text citations >> \btxflushauthornormal{author} >> } { >> % Inverted order for list citations >> % TODO: need to print the first name inverted, with all subsequent names >> in normal order >> \btxflushauthorinverted{author} >> } >> ``` >> >> This fixes the citation alternative-dependent authorconversion, but I still >> have to do the same for the etallimit and etaldisplay settings, and >> unfortunately, it doesn't look like there are similar commands for >> overriding this locally. >> >> Digging a bit more in publ-imp-chicago.lua and publ-imp-chicago.mkvi, I >> notice that it deals with a similar problem for the "editor" field: if the >> editor occurs in the "author" position (i.e., at the start of the citation, >> which happens when a book has an editor but no author), then the >> authorconversion should be inverted, but if the editor occurs after the >> author position (which happens when a book also has an author), then its >> authorconversion should be normalshort. The publ-imp-chicago.lua file >> addresses this by specifying an "ineditor" set containing only the "editor" >> field (essentially making it an alias to be used later), and then >> publ-imp-chicago.mkvi defines a style specifically for this field. I could >> solve the authorconversion, etallimit, and etaldisplay problems using an >> "entryauthor" field, but is this actually the recommended way to do this? >> Using this approach, I would have to have duplicate sets for nearly all >> "author"-type fields to ensure that they have different formatting in entry >> citations than they do in the list. >> >> Joey >> >> On Wed, Aug 25, 2021 at 5:45 PM Joey McCollum <jmccollum20140...@gmail.com> >> wrote: >>> >>> Hi, >>> >>> I'm trying to implement a custom bibliography rendering where in-text >>> citations (specifically, citations with alternative=entry) are not >>> identical to the entries in the bibliography list. Following a pattern I've >>> seen in publ-imp-chicago.mkvi, I've been able to implement most of the >>> features I'm interested in by using conditional formatting with a mode that >>> is specifically set for citations with the "entry" alternative. I'd also >>> like for author names in entry citations to be different author names in >>> list entries, in the following ways: >>> >>> In entry citations, authorconversion should be normal, while in list >>> entries, authorconversion should be inverted (more specifically, the first >>> name should be inverted, while all subsequent names should be in normal >>> order...but if this is too complicated, then it may be an issue for another >>> e-mail thread, and we can just focus on normal vs. inverted for now). >>> In entry citations, "et al." should be used for any names after the third >>> name, while in list entries, all names should be printed in full. >>> >>> I thought that the following settings would work: >>> >>> \definebtx >>> [sbl:\s!list] >>> [sbl] >>> [\c!otherstext=, >>> \c!etallimit=, >>> \c!etaldisplay=, >>> \c!etaloption=, >>> \c!authorconversion=inverted] % TODO: need to print the first name >>> inverted, with all subsequent names in normal order >>> >>> \definebtx >>> [sbl:\s!cite] >>> [sbl] >>> [\c!otherstext={\btxspace\btxlabeltext{others}}, % use et al. for >>> truncated author / editor list >>> \c!etallimit=3, % don't use et al. for 3 or fewer authors >>> \c!etaldisplay=3, % >>> \c!authorconversion=\v!normal] % by default, use normal name order for >>> in-text citations >>> >>> But only the "list" settings seem to be used. I suspect this might be >>> because the setup for "entry" citations invokes \btxhandleciteentry and >>> therefore uses "list" settings everywhere except where I check modes for >>> conditional formatting. But is there a command or environment I can use to >>> change authorconversion locally, based on the current mode, in the helper >>> methods I've defined for rendering bibliography entries? >>> >>> Thanks! >>> >>> Joey > > ___________________________________________________________________________________ > 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://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > ___________________________________________________________________________________ ___________________________________________________________________________________ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________