From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/113023 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joey McCollum via ntg-context Newsgroups: gmane.comp.tex.context Subject: Unusual error with \doifinstring in \startbtxrenderingdefinitions ... \stopbtxrenderingdefinitions Date: Sat, 9 Oct 2021 11:40:21 -0400 Message-ID: Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8819080298484824110==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33240"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Joey McCollum To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Oct 09 17:43:22 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 1mZEVN-0008Tv-H1 for gctc-ntg-context-518@m.gmane-mx.org; Sat, 09 Oct 2021 17:43:21 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 4EE7E287D6C; Sat, 9 Oct 2021 17:42:51 +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 fN1aXy3s-UWz; Sat, 9 Oct 2021 17:42:49 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 69A53288985; Sat, 9 Oct 2021 17:42:49 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 5686F288983 for ; Sat, 9 Oct 2021 17:42:48 +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 YvhJ5C8GkGop for ; Sat, 9 Oct 2021 17:42:47 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.166.49; helo=mail-io1-f49.google.com; envelope-from=jmccollum20140511@gmail.com; receiver= Original-Received: from mail-io1-f49.google.com (mail-io1-f49.google.com [209.85.166.49]) (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 3B267287D6C for ; Sat, 9 Oct 2021 17:42:47 +0200 (CEST) Original-Received: by mail-io1-f49.google.com with SMTP id n7so5479032iod.0 for ; Sat, 09 Oct 2021 08:42:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=fhCftSBQtR26cjQ5j82sJcwiN6TRL0wFPRLj53dgd+E=; b=jpVTGhmlyUyL6nI6nZosq0OYAmGYsln60kgrtFA9DbcLsJygLeLmbxbk08Nn+wGT3G 60w7b5R4t06FOf+rxTioGW6gW9v8WPx8CKJwASLo46sVLVNUir2iXeE/eZUOZC2mXyoR IibLWqDrSwoTaXfWG09ml5+Qb+AjxWSxqE530y7lVtmAF69aVy1Ofvj1OkAGKIU7AjKi rpLwN/Sb+IvwSSxcU2UGHvk9lY+iXv7+RO0rpFnxDAig3WMJDyLUisUSV/i1XNAj37vd mi/Yccb3a3wC4pD+aE9LS57YRuP8MUtZzt+cvQFRP9YwvCQDPnyGmx9d1UFNNfMJnd9K i1yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=fhCftSBQtR26cjQ5j82sJcwiN6TRL0wFPRLj53dgd+E=; b=ohwQ3C6m6H2TcmqnjjnmT8J/nUoZ3TuTkENS1W630X59vaC+aE9US5HTrLBXScZLRL B9xP6iTarWTVstVfpmRFQQsHh3ejINaVJhNdujJmJkeQVkvRL3w0/yLXtJX4+gUm23O/ gZJJo6Bw6tIhQ3JKT3kqpxp/FiYvWVzQ8xPmOrpH9+ZeMwIs+Qb3xQDJF6Dk44HukWjL CNLC7W6x20qCRgn0LAYb7bZV4UR5xlrz4t5GfnUS2VgGGp18v/ptiLFy8G6BPn7fr17K Oh0GHeQg+c9TLL9W3p7rTcRAHhJfio0tCGjBKiIcdrMLbHpeCqkW8+uuF3KVAKtF4ueA WLjA== X-Gm-Message-State: AOAM531O/fzKYW3X4krriGKQ70Mk2yuYuBqCa1Bdp30wPiPnKXR2Cru9 RlGw979gDkJ1PYCMZUpoFE5rQfSP+qb4VOGLqHkhmgFZwcE= X-Google-Smtp-Source: ABdhPJxadYeu1o4CHbAqzILgtZdB0zQu2s/1wOprdkc+h9uqA+1MYpCElJUnf42eootFmc7QpLR6FuR1j3S8FH2996Y= X-Received: by 2002:a02:ccc5:: with SMTP id k5mr4862755jaq.100.1633794164983; Sat, 09 Oct 2021 08:42:44 -0700 (PDT) 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:113023 Archived-At: --===============8819080298484824110== Content-Type: multipart/alternative; boundary="000000000000d70cc705cded585b" --000000000000d70cc705cded585b Content-Type: text/plain; charset="UTF-8" Hi, I'm trying to define concise biblatex-style citation macros for a custom bibliographic style specification with support for intelligent placement of trailing punctuation, and I've encountered an unusual error. If I try to define the macros within the btxrenderingdefinitions environment, then the code for handling trailing punctuation with the \doifinstring and \doifnotinstring macros fails in some cases. Specifically, it correctly detects when the trailing punctuation is a period, comma, or semicolon, but not when it is a colon, exclamation point, or question mark. The following MWE reproduces the error: ``` \startbtxrenderingdefinitions[myspec] \def\autopuncttest#1#2{% \removeunwantedspaces% \doifinstring{#2}{,.!?;:}{#2}% \footnote{#1}% \doifnotinstring{#2}{,.!?;:}{#2}% } \stopbtxrenderingdefinitions \usebtxdefinitions[myspec] \starttext This works \autopuncttest{Footnote 1}, as does this \autopuncttest{Footnote 2}; and so does this \autopuncttest{Footnote 3}.\blank But this one fails if defined in the bib spec \autopuncttest{Footnote 4}!\blank And why does this one fail in the bib spec too \autopuncttest{Footnote 5}?\blank \stoptext ``` Everything works as expected if the macro definition is outside of the btxrenderingdefinitions environment. But within the environment, do certain punctuation marks need to be escaped in the second argument of \doifinstring? Or is this a bug? Joey --000000000000d70cc705cded585b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

I'm trying to define concise bi= blatex-style citation macros for a custom bibliographic=C2=A0style specific= ation with support for intelligent placement of trailing punctuation, and I= 've encountered an unusual error. If I try to define the macros within = the btxrenderingdefinitions environment, then the code for handling trailin= g punctuation with the \doifinstring=C2=A0and \doifnotinstring macros fails= in some cases. Specifically, it correctly detects when the trailing punctu= ation is a period, comma, or semicolon, but not when it is a colon, exclama= tion point, or question mark. The following MWE reproduces the error:
```

\startbtxrenderingdef= initions[myspec]

\def\autopuncttest#1#2{%

\removeunwantedspaces%

\doifinstring{#2}{,.!?;:}{#2= }%

\footnote{#1}%

\doifnotinstring{#2}{,.!?;:}= {#2}%

}

\stopbtxrenderingdefinitions


\usebtxdefinitions[myspec]


\starttext

This works \autopuncttest{Foo= tnote 1}, as does this \autopuncttest{Footnote 2}; and so does this \autopu= ncttest{Footnote 3}.\blank

But this one fails if defined= in the bib spec \autopuncttest{Footnote 4}!\blank

And why does this one fail in= the bib spec too \autopuncttest{Footnote 5}?\blank

\stoptext

```
Everything works as expected if the macro definition is outside= of the=C2=A0btxrenderingdefinitions e= nvironment. But within the environment, do certain punctuation marks need t= o be escaped in the second argument of \doifinstring? Or is this a bug?

Joey
--000000000000d70cc705cded585b-- --===============8819080298484824110== 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== --===============8819080298484824110==--