From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: from cgl.ntg.nl (Cgl.ntg.nl [5.39.185.202]) by inbox.vuxu.org (Postfix) with ESMTP id 5143B2163E for ; Tue, 23 Apr 2024 16:09:54 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 9E50B48068E for ; Tue, 23 Apr 2024 16:09:32 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Authentication-Results: cgl.ntg.nl (amavisd-new); dkim=fail (1024-bit key) reason="fail (message has been altered)" header.d=flump.de Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lyb5cA092pZW for ; Tue, 23 Apr 2024 16:09:30 +0200 (CEST) Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id E5CBA484380 for ; Tue, 23 Apr 2024 16:04:28 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id B20F248410F for ; Tue, 23 Apr 2024 16:04:01 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mUEITIna_Gah for ; Tue, 23 Apr 2024 16:03:58 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=185.163.118.210; helo=flump.de; envelope-from=gerion.entrup@flump.de; receiver= Received: from flump.de (flump.de [185.163.118.210]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cgl.ntg.nl (Postfix) with ESMTPS id 0A82248410E for ; Tue, 23 Apr 2024 16:03:57 +0200 (CEST) Received: from falbala.localnet (p4fc27d9c.dip0.t-ipconnect.de [79.194.125.156]) by flump.de (Postfix) with ESMTPSA id A6BFAC83B46 for ; Tue, 23 Apr 2024 16:03:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=flump.de; s=mail; t=1713881037; bh=dxRiNtpQJ9CTIRfrGSdhqyjB+UNfuKvXXcNVHs+Gsr0=; h=From:To:Subject:Date:In-Reply-To:References; b=J2XpHMaFC0bXMjmJ5GBrFN+n/iesbgnP+XdDPsh518m1qBgzabNM0rtQOpPyqizBj jpdWEnuwb2pIfX4BSER6j3dqH2Fh7Pq63g6uEMcK2WhbJyPwTFtE602VsoNz+CXLb1 XyGL7VnZGk80NSX7FDPYu8g7LspGaBQ0TxUJqSyM= From: Gerion Entrup To: ntg-context@ntg.nl Date: Tue, 23 Apr 2024 16:03:50 +0200 Message-ID: <3292943.44csPzL39Z@falbala> In-Reply-To: <3478475.QJadu78ljV@falbala> References: <2931712.e9J7NaK4W3@falbala> <20240417070657.5aa03ddb@boo.my.domain> <3478475.QJadu78ljV@falbala> MIME-Version: 1.0 Message-ID-Hash: OFAWO6X7VMAXVDL5OVU7EWFDIZ4EX4KC X-Message-ID-Hash: OFAWO6X7VMAXVDL5OVU7EWFDIZ4EX4KC X-MailFrom: gerion.entrup@flump.de X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list Reply-To: mailing list for ConTeXt users Subject: [NTG-context] Combine lua and btx setup, was: Re: Customize citation format of a bibliography (use the short form as reference format) List-Id: mailing list for ConTeXt users Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: multipart/mixed; boundary="===============6837573593200097468==" --===============6837573593200097468== Content-Type: multipart/signed; boundary="nextPart8363740.T7Z3S40VBb"; micalg="pgp-sha256"; protocol="application/pgp-signature" --nextPart8363740.T7Z3S40VBb Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8"; protected-headers="v1" From: Gerion Entrup To: ntg-context@ntg.nl Date: Tue, 23 Apr 2024 16:03:50 +0200 Message-ID: <3292943.44csPzL39Z@falbala> In-Reply-To: <3478475.QJadu78ljV@falbala> MIME-Version: 1.0 Here is a solution for the first part of my question. This is based on https://www.mail-archive.com/ntg-context@ntg.nl/msg101156.html and try and error based on publ-imp-aps.mkvi and publ-imp-apa.mkvi: It display now the citation _and_ numbering labels in the short form: ``` \setupinteraction[state=3Dstart] \startbuffer[testdata] @Book{knuth1, author =3D {Donald E. Knuth}, title =3D {TEX and METAFONT. New directions in typesetting}, year =3D {1979}, publisher =3D {Addison-Wesley}, } @Article{someother, author =3D {Some Person and Some Otherperson}, title =3D {Another title}, year =3D {1900}, } \stopbuffer % enable tracing \enabletrackers[publications, publications.crossref, publications.details, = publications.cite, publications.strings] \usebtxdataset[main][testdata.buffer] \usebtxdefinitions[aps] \setupbtx[dataset=3Dmain] \definebtxrendering[bibrendering][aps][dataset=3Dmain, numbering=3Dshort] \setupbtxlist[aps][ alternative=3Db, distance=3D.5em, ] \setupbtx[aps:cite][alternative=3Dshort] \starttext Knuth developed \TeX \cite[knuth1] Several persons said something \cite[someother]. \placelistofpublications[bibrendering] \stoptext ``` The remaining part now is to mark publications of Knuth in a different way. I have tried this and failed. Here is my code so far: ``` \startluacode function render_cite(short, author) print(author) if author:lower():find("knuth") then context("[>" .. short .. "]") else context("[" .. short .. "]") end end \stopluacode \definebtx[aps:cite:special][aps:cite] \startsetups btx:aps:cite:special \btxcitereference \ctxlua{render_cite([=3D=3D[\btxflush{year}]=3D=3D], [=3D=3D[\btxflush{aut= hor}]=3D=3D])} \stopsetups % use it with \cite[special][knuth1] ``` This has several problems: =2D \btxflush{short} does not work as I expected that. How can I get the sh= ort form? =2D \btxflush to pass arguments to lua does not work as intended. On the lu= a side the variable "author" resolves to "\btxflushauthor{author}" and not to "D. E= =2E Knuth". How can I pass the data? I use Lua only because I find it more convenient as a programming language.= If a plain tex solution is simpler, I'm happy to use that.=20 Another question that came up while studying the source code: What effect have \c!, \s!, and \v!? These commands exist a lot in the above cited files. Gerion Am Mittwoch, 17. April 2024, 15:44:12 MESZ schrieb Gerion Entrup: > Hi, >=20 > > The APS style is an example of a number-based citation system. As you > > are looking for a tag-based citation, it might be better to start with > > something like the APA style. >=20 > I'm kind of satisfied with the publication-list layout of the APS style s= o I chose > this as a base. If it is simpler to start with the APA style, I can do th= at. >=20 > My hope is that it is possible to just change the "label" that is used for > referencing and keep everything else as is. >=20 > > Is there some specification for your short tag-based citation style? >=20 > biblatex implements this with the "alphabetic" style. I'm not aware of > a specification, though. Does the "short" form in ConTeXt exist for a > specific reason? :) >=20 > Gerion >=20 > > On Tue, 16 Apr 2024 06:04:35 +0200 > > Gerion Entrup wrote: > >=20 > > > Hi, > > >=20 > > > I'm trying to customize a cite format in a bibliography. Currently, > > > I'm using the aps style which fits so far, except of the plain number > > > as reference. In concrete, I want to change the following: > > > - Use the first letter of the last name and the year as reference > > > (this should be exactly the short form). It is more less also > > > described here [1]. > > > - Highlight publications of a certain author with an extra char (e.g. > > > '>') > > >=20 > > > Here is a minimal example (lets assume, every occurrence of Knuth > > > should be highlighted): ``` > > > \setupinteraction[state=3Dstart] > > >=20 > > > \startbuffer[testdata] > > > @Book{knuth1, > > > author =3D {Donald E. Knuth}, > > > title =3D {TEX and METAFONT. New directions in typesetting}, > > > year =3D {1979}, > > > publisher =3D {Addison-Wesley}, > > > } > > > @Article{someother, > > > author =3D {Some Person and Some Otherperson}, > > > title =3D {Another title}, > > > year =3D {1900}, > > > } > > > \stopbuffer > > >=20 > > > % enable tracing > > > \enabletrackers[publications, publications.crossref, > > > publications.details, publications.cite, publications.strings] > > >=20 > > > \usebtxdataset[main][testdata.buffer] > > > \usebtxdefinitions[aps] > > > \setupbtx[dataset=3Dmain] > > > \definebtxrendering[bibrendering][aps][dataset=3Dmain] > > >=20 > > > % this seems to have no effect? > > > \setupbtx[alternative=3Dshort] > > >=20 > > > \starttext > > >=20 > > > Knuth developed \TeX \cite[knuth1]. > > > Several persons said something \cite[someother]. > > >=20 > > > \placelistofpublications[bibrendering] > > >=20 > > > \stoptext > > > ``` > > >=20 > > > It should be rendered as: > > > ``` > > > Knuth developed TeX [>Knu79]. > > > Several persons said something [PO00]. > > >=20 > > > [Knu79] D.E. Knuth, TEX and METAFONT. New directions in > > > typesetting (Addi=C2=ADson-Wesley, 1979). [PO00] S. Person and S. > > > Otherperson, Another title, (1900). ``` > > >=20 > > > How can I achieve that \cite[something] always renders in the short > > > form by default? How can I customize that references to Knuth contain > > > this extra '>'? How can I customize the APS style to also use the > > > short form in the list of publications instead of numbers? > > >=20 > > > Best > > > Gerion > > >=20 > > > [1] > > > https://tex.stackexchange.com/questions/295444/citation-style-with-fi= rst-letters-of-authors-lastname --nextPart8363740.T7Z3S40VBb Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQGzBAABCAAdFiEEM/tVN9WpYYHnPZHxloeAdSYJHeoFAmYnv8YACgkQloeAdSYJ HermnAv/b/B/LHYwGqvZHHTm8vv0HjGgPB7hXtVPuemi5hYqo0wQwVPjFqRccJsE m37vHscwI4KhSePc2iRKfzu3Nin5DhKT9BkOmPNz+BMUeJ1bUoMj4KZngJtfsOu/ v+Fd4J7M3VU695V6xsL/tj+8pufbpw4iU19HkRWzFVmOh/nxXapPjfqO1+MeBqc5 qLMXLyYTQADOr7qwhBwdR4aFrPjCkohEck2wygRxdAy31rdJD/FTFvbB8r3zS/RO 5p6S0PHS5BjBdamAGsXFWXjCu/H8WP/4YMAZPo+Rb2mNcVx4aFrmLK506m7mA5za Foa1z7C7gCKz6fvlMD3gNmKnu/ZKuFPju8IsL6Mk3122MatWl/2ORrl+elC7ZwpJ yCbwV8dMQ7O8AQEuLsqptViDBPKbD3BpP2ew6DE6nm6UviOjIdQFHYXDxYkeMarx hFE+It+aIl7h54+KxToK3f/uhi7Lpo3+9tw4+sD5zSh+dCOxNzDEy1jMCilj1bbZ SHC7K+wa =uSjJ -----END PGP SIGNATURE----- --nextPart8363740.T7Z3S40VBb-- --===============6837573593200097468== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___________________________________________________________________________________ --===============6837573593200097468==--