From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/112614 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joey McCollum via ntg-context Newsgroups: gmane.comp.tex.context Subject: Re: Different author rendering in entry citation vs. list Date: Thu, 26 Aug 2021 23:10:02 -0400 Message-ID: References: Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2355624177136703757==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31527"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Joey McCollum To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Aug 27 05:09:03 2021 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mJSEo-0007zr-9y for gctc-ntg-context-518@m.gmane-mx.org; Fri, 27 Aug 2021 05:09:02 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id C6581286AF2; Fri, 27 Aug 2021 05:08:27 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6-uOA4bO7zdn; Fri, 27 Aug 2021 05:08:26 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id E7665286D42; Fri, 27 Aug 2021 05:08:25 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id DB244286D40 for ; Fri, 27 Aug 2021 05:08:24 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id j5mcnGn8reZa for ; Fri, 27 Aug 2021 05:08:23 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.166.54; helo=mail-io1-f54.google.com; envelope-from=jmccollum20140511@gmail.com; receiver= Original-Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 0B4D2286AF2 for ; Fri, 27 Aug 2021 05:08:22 +0200 (CEST) Original-Received: by mail-io1-f54.google.com with SMTP id a15so6713534iot.2 for ; Thu, 26 Aug 2021 20:08:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=mHj8g9dCk157/Vu6ja0YLMHw3wH45+CbUqHLZ2q9VQI=; b=YpXjtBM4HXy6QRbadAu6U3+5CVyYpI75crQhgryyRQuZ7684yln73UswLEvZZ1Q7Fq XuhVXOBBqHPARBJRiHOwVf1iQ0HK/PPAepWtE88VqWVHlpZ2Whjqr/8zosFbpuIohv7y 7IA8+FAGnguvIasTYJG87HoJQbW5WHD8Vz1NTcqym41GR1dotbzXhKeBsSYSz0Ucxkls yswbaMZbYRsy6mjfhZhacHbGz/uoJTxW7SO/VIktyuMnbginNWDaEnradm+hnwVLPt/e VHr0cNMKxHMmnMRdg124sb8raylNRCgpZv1O1niPI8aF1PDgQjNgPB7+dneicvB4gn9p 7kcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=mHj8g9dCk157/Vu6ja0YLMHw3wH45+CbUqHLZ2q9VQI=; b=thBZsDnDPjcFcCMVisjnnwpeSiWWt2O7q/9s7RkxX9TTRRuLE1+B9vI9krIVt2bo8B iKSBI/Wb3ZMA1uKwSqQBwDMpBgMDkGdZ0rxM9aQty/Hwyn7o7MeQZ33LcAVk8DpWhY2c hsxsZBPpnc8nD4CxZh9JMzaJPDvmaueZhDGXQs+EBPlDbO02+m6lq/fk2SDr3ZJExrLm M/yx4mouA9SdbpjImXIXKwlzMRWdzbNODPLOYa56q5m5fL1BCF8EvjzkvCnx9BYQqvMh I/ZJrSQJviVZTpEt1xEw86R1O6SofsDmV7Jedcxok0l0GAa3+Cv30G7OYt8vL0E6535W JO4w== X-Gm-Message-State: AOAM532nRf2leum3R1o5b81KIupIlD1lkS5gpP5Pva3XPO1S8FJ0qGBX 73mpP7DH4nwJ19symskkcUuGwAg3z5YA2WWsrtLrp5xt X-Google-Smtp-Source: ABdhPJy2Mf6fbT/DFM1Vmm8oRBZ8DYD02GW6PZmJI51wyK5hBNvBFpj4I75qQKC7JOzANx33Cdz0oo2snD0BpJ+0wn0= X-Received: by 2002:a02:7a14:: with SMTP id a20mr6161886jac.27.1630033700591; Thu, 26 Aug 2021 20:08:20 -0700 (PDT) In-Reply-To: X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:112614 Archived-At: --===============2355624177136703757== Content-Type: multipart/alternative; boundary="000000000000b21c1905ca81cbd0" --000000000000b21c1905ca81cbd0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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, =C3=81goston Volcz raised a si= milar 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 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 th= e > editor occurs in the "author" position (i.e., at the start of the citatio= n, > 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 "edito= r" > field (essentially making it an alias to be used later), and then > publ-imp-chicago.mkvi defines a style specifically for this field. I coul= d > 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 ent= ry > citations than they do in the list. > > Joey > > On Wed, Aug 25, 2021 at 5:45 PM Joey McCollum > wrote: > >> Hi, >> >> I'm trying to implement a custom bibliography rendering where in-text >> citations (specifically, citations with alternative=3Dentry) 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 t= hat >> 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 i= n >> normal order...but if this is too complicated, then it may be an issu= e for >> another e-mail thread, and we can just focus on normal vs. inverted f= or >> 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 ful= l. >> >> I thought that the following settings would work: >> >> \definebtx >> [sbl:\s!list] >> [sbl] >> [\c!otherstext=3D, >> \c!etallimit=3D, >> \c!etaldisplay=3D, >> \c!etaloption=3D, >> \c!authorconversion=3Dinverted] % TODO: need to print the first name >> inverted, with all subsequent names in normal order >> >> \definebtx >> [sbl:\s!cite] >> [sbl] >> [\c!otherstext=3D{\btxspace\btxlabeltext{others}}, % use et al. for >> truncated author / editor list >> \c!etallimit=3D3, % don't use et al. for 3 or fewer authors >> \c!etaldisplay=3D3, % >> \c!authorconversion=3D\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 helpe= r >> methods I've defined for rendering bibliography entries? >> >> Thanks! >> >> Joey >> > --000000000000b21c1905ca81cbd0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Nevermind, it looks like there's an even more delibera= te and succinct way to handle this! In publ-ini.mkiv, the=C2=A0\currentbtxc= iteauthorbyfield=C2=A0command shows how to print the author field mapped ac= cording to the cite style:

```
\unexpanded\def\currentbtxciteauth= orbyfield
=C2=A0 {\begingroup
=C2=A0 =C2=A0%\setbtxparameterset\s!cit= e\s!author
=C2=A0 =C2=A0% the alternatives inherit from cite:author
= =C2=A0 =C2=A0% and APA distinguishes authoryears from authoryear ("and= " vs. "&")
=C2=A0 =C2=A0\setbtxparameterset\s!cite\cu= rrentbtxcitealternative
=C2=A0 =C2=A0\clf_btxauthor
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 {\currentbtxdataset}%
=C2=A0 =C2=A0 =C2=A0 =C2=A0 {\currentbt= xtag}%
=C2=A0 =C2=A0 =C2=A0 =C2=A0 {\currentbtxauthorfield}%
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 {%
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 combin= er =C2=A0 =C2=A0{\btxparameter\c!authorconversion}%
=C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 kind =C2=A0 =C2=A0 =C2=A0 =C2=A0{cite}%
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 etallimit =C2=A0 {\btxparameter\c!etallimit= }%
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 etaldisplay {\btxparameter\= c!etaldisplay}%
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 etaloption =C2= =A0{\btxparameter\c!etaloption}%
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 symbol =C2=A0 =C2=A0 =C2=A0{\btxparameter{\c!stopper:initials}}%
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 }%
=C2=A0 \relax
=C2=A0 \endgroup}
```
The snippet above might offer some guidance on how to hand= le this problem more generally, but for my specific use case, it suffices t= o invoke the \currentbtxciteauthorbyfield command:

```
\do= ifelse {\currentbtxcitealternative} {entry} {
=C2=A0 =C2=A0 % Normal ord= er for in-text citations
=C2=A0 =C2=A0=C2=A0 \currentbtxciteauthorbyfield
} {
=C2=A0 =C2=A0 % Inverted order for l= ist citations
=C2=A0 =C2=A0 % TODO: n= eed to print the first name inverted, with all subsequent names in normal o= rder
=C2=A0 =C2=A0 \btxflush{author}
}
```

I get the= feeling that there are more relevant commands in publ-ini.mkiv that are in= tended to help with this kind of thing, but I've just been unaware of m= ost of them. The existing bibliography documentation only covers the tip of= the iceberg!

Anyway, I realized that a couple months ago,=C2=A0=C3= =81goston Volcz raised a similar issue in another thread. I think this appr= oach should solve that problem, so when I get a chance, I can send an e-mai= l=C2=A0about that.

Joey

On Thu, Aug 26, 2021= at 3:38 PM Joey McCollum <jmccollum20140511@gmail.com> wrote:
Okay, I'= ;ve made some progress! Thankfully, the authorconversion rules can be overr= idden=C2=A0using some of the methods defined in publ-ini.mkiv. I now have s= omething like this in my rendering's=C2=A0.mkvi file:

```
\do= ifelse {\currentbtxcitealternative} {entry} {
=C2=A0 =C2=A0 % Normal ord= er for in-text citations
=C2=A0 =C2=A0 \btxflushauthornormal{author}
= } {
=C2=A0 =C2=A0 % Inverted order for list citations
=C2=A0 =C2=A0 %= TODO: need to print the first name inverted, with all subsequent names in = normal order
=C2=A0 =C2=A0 \btxflushauthorinverted{author}
}
```= =C2=A0=C2=A0

This fixes the citation alternative-dependent authorco= nversion, but I still have to do the same for the etallimit and etaldisplay= =C2=A0settings, and unfortunately, it doesn't look like there are simil= ar 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 ed= itor occurs in the "author" position (i.e., at the start of the c= itation, which happens when a book has an editor but no author), then the a= uthorconversion=C2=A0should be inverted, but if the editor occurs after the= author position (which happens when a book also has an author), then its a= uthorconversion should be normalshort. The=C2=A0publ-imp-chicago.lua file a= ddresses 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 fiel= d. I could solve the authorconversion,=C2=A0etallimit, and etaldisplay=C2= =A0problems using an "entryauthor" field, but is this actually th= e recommended way to do this? Using this approach, I would have to have dup= licate sets for nearly all "author"-type fields to ensure that th= ey have different formatting in entry citations than they do in the list.

Joey

On Wed, Aug 25, 2021 at 5:45 PM Joey McCo= llum <j= mccollum20140511@gmail.com> wrote:
Hi,

I'm t= rying to implement a custom=C2=A0bibliography rendering where in-text citat= ions (specifically, citations with alternative=3Dentry) are not identical t= o the entries in the bibliography list. Following a pattern I've seen i= n publ-imp-chicago.mkvi, I've been able to implement most of the featur= es I'm interested in by using conditional formatting with a mode that i= s specifically set for citations with the "entry" alternative. I&= #39;d also like for author names in entry citations to be different author = names in list entries, in the following ways:
  • In entry ci= tations, authorconversion should be normal, while in list entries, authorco= nversion=C2=A0should 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 ci= tations, "et al." should be used for any names after the third na= me, while in list entries, all names should be printed in full.
I thought that the following settings would work:

\definebtx
= =C2=A0 [sbl:\s!list]
=C2=A0 [sbl]
=C2=A0 [\c!otherstext=3D,
=C2=A0= \c!etallimit=3D,
=C2=A0 \c!etaldisplay=3D,
=C2=A0 \c!etaloption=3D,<= br>=C2=A0 \c!authorconversion=3Dinverted] % TODO: need to print the first n= ame inverted, with all subsequent names in normal order

\definebtx=C2=A0 [sbl:\s!cite]
=C2=A0 [sbl]
=C2=A0 [\c!otherstext=3D{\btxspac= e\btxlabeltext{others}}, % use et al. for truncated author / editor list=C2=A0 =C2=A0\c!etallimit=3D3, % don't use et al. for 3 or fewer autho= rs
=C2=A0 =C2=A0\c!etaldisplay=3D3, %=C2=A0
=C2=A0 =C2=A0\c!authorcon= version=3D\v!normal] % by default, use normal name order for in-text citati= ons

But only the "list" settings seem to be used. I suspec= t this might be because the setup for "entry" citations invokes= =C2=A0\btxhandleciteentry=C2=A0and therefore uses "list" settings= everywhere except where I check modes for conditional formatting. But is t= here a command or environment I can use to change authorconversion=C2=A0loc= ally, based on the current mode, in the helper methods I've defined for= rendering bibliography entries?

Thanks!

Joey
--000000000000b21c1905ca81cbd0-- --===============2355624177136703757== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============2355624177136703757==--