From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/113063 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joey McCollum via ntg-context Newsgroups: gmane.comp.tex.context Subject: Re: Short forms and abbreviations in bibliography Date: Mon, 11 Oct 2021 10:24:23 -0400 Message-ID: References: <0924E179-F1D2-4B05-9D16-C3075A216E2A@fiee.net> <20888f8e8c0c4d6982a360ee587ecbe7@unibe.ch> <19a4940d-f76f-ae88-6bbf-42f1627da373@xs4all.nl> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1547916742630836957==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30578"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Joey McCollum , mailing list for ConTeXt users , Alan BRASLAU To: Hans Hagen Original-X-From: ntg-context-bounces@ntg.nl Mon Oct 11 16:27:39 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 1mZwHC-0007ix-CV for gctc-ntg-context-518@m.gmane-mx.org; Mon, 11 Oct 2021 16:27:38 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 29B3F287219; Mon, 11 Oct 2021 16:26:58 +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 Fup30jHkrZP5; Mon, 11 Oct 2021 16:26:56 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id E2CEA288957; Mon, 11 Oct 2021 16:26:55 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 7A3CA287C79 for ; Mon, 11 Oct 2021 16:26:54 +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 qOCfmf4slL4C for ; Mon, 11 Oct 2021 16:26:53 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.166.176; helo=mail-il1-f176.google.com; envelope-from=jmccollum20140511@gmail.com; receiver= Original-Received: from mail-il1-f176.google.com (mail-il1-f176.google.com [209.85.166.176]) (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 DF45E287219 for ; Mon, 11 Oct 2021 16:26:52 +0200 (CEST) Original-Received: by mail-il1-f176.google.com with SMTP id d11so18308345ilc.8 for ; Mon, 11 Oct 2021 07:26:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=c0n2dyj3HXv3AgqCdBOzU4tkYslqIpLZYNDfuXsLqIk=; b=CbPPR3eyuRddg3OLHqcsDFWa0Y3QtPSuoIRA7DGQJMnXkpJwwF++a32P0pumxCOQHa rIUs7Qp110KPkPfoMizKk5rUrtmb7JfOT2gTB7JhFyks/pevfdiX8G2V2NLPbeoaoxEu FzwSza+NzgkJhUG6dRwUHHU410+DUVMXzURDWzYEhT4HkZh0ia74a1hWokgds6q8Nv64 0nVoE90ATi5lZirR0d1HXnYjDvAhFU0wuzfI1elhPtD83X9PrZYR+6lmHMzFVbVLwotn ub5qGMgPkgArkguhm4iFO626ko/G7KN8+FYQK4Anq8+BYSAuGdjo0V949dCUR3uLYIl5 ntng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=c0n2dyj3HXv3AgqCdBOzU4tkYslqIpLZYNDfuXsLqIk=; b=hWvGhCqyExCJXzIp24w86wdgjQjxOrsL5yaeKpjPukWylDlPORbtIWkk2//Fl4H3u3 FqTm6nIHi/wklBoeuhkJkJAIvF/CFyhzq3JzJXX3kmnn7UfDSzOd+wMXe9w87TjMk8oP 6/YTX/NJ30rB/7LrthdPYZT2XlOuhWULzp5oMeh+je52aVaaKUngRbfItYQqJxTKcfG9 Ydl7Lm/Bvmxem7WLnaplaVsZbzJ5CqkNKCxaJ9WyAMo4+HfzZI1XSQ+e9W3rAW9Idq1v hZH8F8+jnK/zbavYi6F80C/qHZbC9XzalGfETvCLCDOUK/nKkx3VRoMT7hYdHNfHTJP0 NLmg== X-Gm-Message-State: AOAM532WbXF/CVonz1KSJtHuiPGJiP7acz+oUcHnUeCa/VnBqoRcdm2m FfaJ9OA8/+oNKl/GPiHJeusQilofkQMndzDcrBU= X-Google-Smtp-Source: ABdhPJz5M465Zl8IeNb/UEeL9+cSnPYv4pCComKsPZiRhdiyWKNbdnv0R2YaUCYaAy8Pg1gPW7exqPCRf4Vhfmr7kE0= X-Received: by 2002:a05:6e02:1a8e:: with SMTP id k14mr8723904ilv.77.1633962411275; Mon, 11 Oct 2021 07:26:51 -0700 (PDT) In-Reply-To: <19a4940d-f76f-ae88-6bbf-42f1627da373@xs4all.nl> 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:113063 Archived-At: --===============1547916742630836957== Content-Type: multipart/alternative; boundary="00000000000019b7c805ce14855e" --00000000000019b7c805ce14855e Content-Type: text/plain; charset="UTF-8" If it helps with troubleshooting, I've also tried to do this with \fastsetup instead of \texdefinition: ``` \expanded{\abbreviation[\currentbtxtag]{\fastsetup{btx:sbl:cite:shorthand}}{ \fastsetup{btx:sbl:cite:listsubcite}}} ``` This also doesn't work, but I at least get a "Missing control sequence inserted" error. The following MWE should reproduce the error (it modifies the existing Chicago rendering, but since I couldn't figure out how to add a shorthand field to the @book category in the chicago spec from within the MWE, I just used the note field as a placeholder for it): ``` % Setup a minimal bibliography \startbuffer [bib] @book{Author1:2016, author={Author1}, title={Work1}, note={W1}, publisher={Publisher1}, year=2016, } @book{Author2:2015, author={Author2}, title={Work2}, publisher={Publisher2}, year=2015, } \stopbuffer \usebtxdataset [bib.buffer] % Setup a new cite alternative to test the desired functionality \startbtxrenderingdefinitions[chicago] \definesynonyms[abbreviation][abbreviations][\infull][\inshort] % we need the \inshort command to access abbreviations by their entry tag \startsetups btx:chicago:cite:shorthand \fastsetup{btx:cite:concat} \fastsetup{btx:cite:lefttext} \begingroup \def\currentbtxcitealternative{short} \def\currentbtxcategory{\btxfield{category}} \btxstartstyleandcolor[sbl:\s!list:title:\currentbtxcategory] \btxusecommand[sbl:\s!list:title:\currentbtxcategory]{ \btxflush{note}% set the shorthand according to the current category } \btxstopstyleandcolor \endgroup \fastsetup{btx:cite:righttext} \stopsetups \startsetups btx:chicago:cite:test \fastsetup{btx:cite:concat} \fastsetup{btx:cite:lefttext} \btxdoifelse{note} { %\expanded{\definesynonym[yes][abbreviation][\currentbtxtag]{\fastsetup{btx:chicago:cite:shorthand}}{\fastsetup{btx:cite:entry}}}% this throws a Missing control sequence inserted error \expanded{\definesynonym[yes][abbreviation][\currentbtxtag]{\cite[alternative=shorthand][\currentbtxtag]}{\cite[alternative=entry][\currentbtxtag]}}% this works, but recursively cites the same tag \inshort{\currentbtxtag} } { \fastsetup{btx:cite:entry} } \fastsetup{btx:cite:righttext} \stopsetups \stopbtxrenderingdefinitions % Use this cite alternative by default \usebtxdefinitions[chicago] \setupbtx[chicago:cite][alternative=test] \starttext \cite[Author1:2016]\blank \cite[Author2:2015]\blank \page \startsubject[title=Abbreviations] \placelistofabbreviations \stopsubject \page \startsubject[title=Bibliography] \placelistofpublications \stopsubject \stoptext ``` Joey On Fri, Oct 8, 2021 at 7:38 AM Hans Hagen wrote: > On 10/7/2021 6:38 AM, Joey McCollum via ntg-context wrote: > > A concise solution that I found would work was to define a "shorthand" > > citation alternative and just print the shorthand with that: > > > > ``` > > % Shorthand citation setup > > \startsetups btx:sbl:cite:shorthand > > \begingroup > > \def\currentbtxcategory{\btxfield{category}} > > \texdefinition{btx:sbl:inline:shorthand} > > \endgroup > > \removeunwantedspaces > > \removepunctuation > > \stopsetups > > > > ... > > > > > \expanded{\abbreviation[\currentbtxtag]{\textcite[alternative=shorthand,lefttext=,righttext=][\currentbtxtag]}{\textcite[alternative=listsubcite,lefttext=,righttext=][\currentbtxtag]}} > > ``` > > > > Again, this works, although I'm still not sure why > > invoking \texdefinition{btx:sbl:inline:shorthand} directly doesn't. > I leave it to Alan to comment on this as he's the bib guru > > Hans > > ----------------------------------------------------------------- > Hans Hagen | PRAGMA ADE > Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl > ----------------------------------------------------------------- > --00000000000019b7c805ce14855e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
If it helps with troubleshooting, I've also tried to d= o this with \fastsetup instead of \texdefinition:

```
\expanded{\abbreviation[\currentbtxtag]{\fastsetup{btx:sbl:cite:shorthand}}{\fastsetup{btx:sbl:cite:listsubcite}}}
```

This also doesn't work, but I at least get = a "Missing control sequence inserted" error. The following MWE sh= ould reproduce the error (it modifies the existing Chicago rendering, but s= ince I couldn't figure out how to add a shorthand field to the=C2=A0@bo= ok category in the chicago spec from within the MWE, I just used the note f= ield as a placeholder=C2=A0for it):

```

% Setup a minimal bibliography
\startbuffer [bib] @book{Author1:2016,
author=3D{Author1},
title=3D{Work1},
n= ote=3D{W1},
publisher=3D{Publisher1},
year=3D2016,
}
@boo= k{Author2:2015,
author=3D{Author2},
title=3D{Work2},
publish= er=3D{Publisher2},
year=3D2015,
}
\stopbuffer
\usebtxdataset= [bib.buffer]

% Setup a new cite alternative to test the desired fun= ctionality
\startbtxrenderingdefinitions[chicago]
\definesynonyms[ab= breviation][abbreviations][\infull][\inshort] % we need the \inshort comman= d to access abbreviations by their entry tag

\startsetups btx:chic= ago:cite:shorthand
\fastsetup{btx:cite:concat}
\fastsetup{btx:cit= e:lefttext}
\begingroup
\def\currentbtxcitealternative{short}
= \def\currentbtxcategory{\btxfield{category}}
\btxstartstyleandcolor[= sbl:\s!list:title:\currentbtxcategory]
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 \btxusecommand[sbl:\s!list:title:\currentbtxcategory]{
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 \btxflush{note}% set the shor= thand according to the current category
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 }
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 \btxstopstyleandcol= or
\endgroup
\fastsetup{btx:cite:righttext}
\stopsetups
<= br> \startsetups btx:chicago:cite:test
\fastsetup{btx:cite:concat}
= \fastsetup{btx:cite:lefttext}
\btxdoifelse{note} {
=C2=A0%\exp= anded{\definesynonym[yes][abbreviation][\currentbtxtag]{\fastsetup{btx:chic= ago:cite:shorthand}}{\fastsetup{btx:cite:entry}}}% this throws a Missing co= ntrol sequence inserted error
=C2=A0\expanded{\definesynonym[yes][abb= reviation][\currentbtxtag]{\cite[alternative=3Dshorthand][\currentbtxtag]}{= \cite[alternative=3Dentry][\currentbtxtag]}}% this works, but recursively c= ites the same tag
=C2=A0\inshort{\currentbtxtag}
} {
=C2= =A0\fastsetup{btx:cite:entry}
}
\fastsetup{btx:cite:righttext} \stopsetups
\stopbtxrenderingdefinitions

% Use this cite altern= ative by default
\usebtxdefinitions[chicago]
\setupbtx[chicago:cite][= alternative=3Dtest]

\starttext
\cite[Author1:2016]\blank
\ci= te[Author2:2015]\blank
\page
\startsubject[title=3DAbbreviations] \placelistofabbreviations
\stopsubject
\page
\startsubject[= title=3DBibliography]
\placelistofpublications
\stopsubject
\st= optext

```

Joey

On Fri, Oct 8, 2021 at 7:38 AM Hans Hagen <= ;j.hagen@xs4all.nl> wrote:
<= /div>
On 10/7/2021 6:38 AM= , Joey McCollum via ntg-context wrote:
> A concise solution that I found would work was to define a "short= hand"
> citation alternative and just print the shorthand with that:
>
> ```
> % Shorthand citation setup
> \startsetups btx:sbl:cite:shorthand
>=C2=A0 =C2=A0 \begingroup
>=C2=A0 =C2=A0 \def\currentbtxcategory{\btxfield{category}}
>=C2=A0 =C2=A0 \texdefinition{btx:sbl:inline:shorthand}
>=C2=A0 =C2=A0 \endgroup
>=C2=A0 =C2=A0 \removeunwantedspaces
>=C2=A0 =C2=A0 \removepunctuation
> \stopsetups
>
> ...
>
> \expanded{\abbreviation[\currentbtxtag]{\textcite[alternative=3Dshorth= and,lefttext=3D,righttext=3D][\currentbtxtag]}{\textcite[alternative=3Dlist= subcite,lefttext=3D,righttext=3D][\currentbtxtag]}}
> ```
>
> Again, this works, although I'm still not sure why
> invoking=C2=A0\texdefinition{btx:sbl:inline:shorthand} directly doesn&= #39;t.
I leave it to Alan to comment on this as he's the bib guru

Hans

-----------------------------------------------------------------
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0Hans Hagen | PRAGMA ADE
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Ridderstraat 27 | 80= 61 GH Hasselt | The Netherlands
=C2=A0 =C2=A0 =C2=A0 =C2=A0 tel: 038 477 53 69 | www.pragma-ade.nl | www.= pragma-pod.nl
-----------------------------------------------------------------
--00000000000019b7c805ce14855e-- --===============1547916742630836957== 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== --===============1547916742630836957==--