ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Joey McCollum via ntg-context <ntg-context@ntg.nl>
To: Hans Hagen <j.hagen@xs4all.nl>
Cc: Joey McCollum <jmccollum20140511@gmail.com>,
	mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Checking for a Unicode prefix of a Unicode string
Date: Mon, 29 Nov 2021 15:13:38 -0500	[thread overview]
Message-ID: <CAGxRUG8eDLerCy_h+WSAZfSSJUZ64smkO0r6kp7=0bzrB4icdQ@mail.gmail.com> (raw)
In-Reply-To: <CAGxRUG8w4XDLgzYHPkSB136u6mU0_3MZ3Nx+pjESQH1Zr1PxRQ@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 2486 bytes --]

After some debugging, the example code I offered above seems to work, with
minor adjustments:

\begingroup
\let\loc\loctextloc
\currentbtxloctext
\btxcomma

\endgroup

Thanks again for all the help!

Joey

On Mon, Nov 29, 2021 at 12:11 PM Joey McCollum <jmccollum20140511@gmail.com>
wrote:

> Okay. So using this example as a template, I'd like to do the following:
>
>    - define a general-purpose \loc macro that can be invoked in the main
>    text (i.e., outside of citations) in the usual way; this one would
>    correspond to \WhateverB above and would not remove punctuation preceding
>    the macro.
>    - separately define a \loctextloc macro that accepts the same input as
>    \loc, but conditionally removes preceding punctuation based on variables
>    set outside of this macro during the citation process (e.g.,
>    \btxsblshorthandbeforetextloc); this would correspond to \WhateverA above.
>    - in the macro for typesetting the loctext btx parameter, redefine
>    \loc to do what \loctextloc does, and then invoke \currentbtxloctext so
>    that the \loc invocations it contains will be expanded like \loctextloc, as
>    follows:
>
> \begingroup
> \def\loc\loctextloc
> \currentbtxloctext
>
> \btxcomma
>
> \endgroup
>
> Is this a ConTeXt-friendly way to do this? I'm attempted this now, but I
> have some errors to debug, and I'd like to know if this is even a feasible
> direction before I continue.
>
> Joey
>
> On Sun, Nov 28, 2021 at 5:39 AM Hans Hagen <j.hagen@xs4all.nl> wrote:
>
>> On 11/28/2021 2:39 AM, Joey McCollum wrote:
>> > I was afraid that might be the problem. I've described some of the
>> > intended purpose of this code near the end of the "Checking for a
>> macro  > ...
>>
>> Maybe play with:
>>
>> \starttext
>>
>> \def\WhateverA{\removeunwantedspaces\removepunctuation\space ¶ 1.23}
>> \def\WhateverB{¶ 1.23}
>>
>> foo bar, \WhateverA\ test
>> foo bar, \WhateverB\ test
>>
>> \stoptext
>>
>> so, wrap ¶ into a macro
>>
>> \def\MyParSymbol{\removeunwantedspaces\removepunctuation\space ¶}
>>
>> 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
>> -----------------------------------------------------------------
>>
>

[-- Attachment #1.2: Type: text/html, Size: 3788 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

      reply	other threads:[~2021-11-29 20:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-26  6:42 Joey McCollum via ntg-context
2021-11-26  8:45 ` Hans Hagen via ntg-context
2021-11-26 16:57   ` Joey McCollum via ntg-context
2021-11-27 17:13     ` Joey McCollum via ntg-context
2021-11-27 18:44       ` Hans Hagen via ntg-context
2021-11-28  1:39         ` Joey McCollum via ntg-context
2021-11-28 10:39           ` Hans Hagen via ntg-context
2021-11-29 17:11             ` Joey McCollum via ntg-context
2021-11-29 20:13               ` Joey McCollum via ntg-context [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGxRUG8eDLerCy_h+WSAZfSSJUZ64smkO0r6kp7=0bzrB4icdQ@mail.gmail.com' \
    --to=ntg-context@ntg.nl \
    --cc=j.hagen@xs4all.nl \
    --cc=jmccollum20140511@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).