From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/100840 Path: news.gmane.org!.POSTED!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Conversion of \newcounts Date: Sun, 20 May 2018 00:40:13 +0200 Message-ID: <5B00A7CD.4060706@gmail.com> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6255386151510109571==" X-Trace: blaine.gmane.org 1526769522 523 195.159.176.226 (19 May 2018 22:38:42 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 19 May 2018 22:38:42 +0000 (UTC) User-Agent: Postbox 5.0.25 (Macintosh/20180328) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun May 20 00:38:38 2018 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fKAUn-0008U2-6J for gctc-ntg-context-518@m.gmane.org; Sun, 20 May 2018 00:38:37 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id DC58C2A6E1; Sun, 20 May 2018 00:40:28 +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 5WOkXiSnb_xQ; Sun, 20 May 2018 00:40:28 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id 2441E2A776; Sun, 20 May 2018 00:40:27 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id B82E92A72D for ; Sun, 20 May 2018 00:40:26 +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 Rc8xHUGm2HNZ for ; Sun, 20 May 2018 00:40:26 +0200 (CEST) Original-Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 3E7CC2A6E1 for ; Sun, 20 May 2018 00:40:16 +0200 (CEST) Original-Received: by mail-wm0-f43.google.com with SMTP id l1-v6so20852310wmb.2 for ; Sat, 19 May 2018 15:40:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to; bh=3JOUqKtgNMwNm8FRVaTGqqx88+3SgBKo/wonQfYB0e8=; b=D04FzyhTDHBjpLAFF9LHMEBLfx+eyUuP/3glsZv2CuhZ3KL/crHm5JPnrEGc43U8zK CzqYCBkbVvBgOXbgcRl7m9kjgnnHpugzjRrCoyXxhxENePHYvC2ZUkMt5eMYBwDJdkgO vf8LfCuInooB/aFugROvSss8APWEIvbZZ+s6TJI+t2d/NjMDWNu+pgzzjkMP8+tg0YyQ mG+BLcNybXh/mQY6McAT0oA2ODeJ6VLufEpghiVQMeMc30cModhWIpneqnUsHmn9YheF yxoHbK5qyxgn3olVGtaoUYjDFVKJKIj7bQqN/7z187mx9s2X7vrmU1WzMOaw2zKTRK7f 3gOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to; bh=3JOUqKtgNMwNm8FRVaTGqqx88+3SgBKo/wonQfYB0e8=; b=MVRNBs3hrQPfTJ9OtaiE9Kyq1UM4Ch3hgVoskHHhecXn1lQ1lM2fY0AVMqwWos7PC/ cUzKU+QLiD575q1zLLVLSNW5P2y2vrEW0V4QLJPbl02ASI6ISgYdm+e7XLqtyTSu9263 BjhVpwL0rHX/fhlnXhZ/RAzgsgqI7+TZ5J1GhbvZlB/EnqXy2r17M8npdSwM0jHxlR2D T2LrGL7KfNCMu3RprSZkJhdJ8V0oQ9oh2hnYkMvCMEGhbj4KRxToHxICzBBYZBQivuKk V6XdH/fZ3kxjM0oz33PkPaG5sxbKreB6Aikm/fODal1yaiKoRVkVryAzYx98lRVjT70y at5A== X-Gm-Message-State: ALKqPwcojUU1ZdxVIQ7fKuXCU/dpzfv4diVCdOPsBaEsRjqw+g3779Zn DiF4jro/6hWdGSt997ykEgP1pVTV X-Google-Smtp-Source: AB8JxZrgwnIf7BILxLJirq2aG0n/XVcVRHW7QdXVCEPnpaZN4eIyzIHpILqdqk5C58b404zfWSwjPA== X-Received: by 2002:a1c:5f83:: with SMTP id t125-v6mr7672199wmb.124.1526769615601; Sat, 19 May 2018 15:40:15 -0700 (PDT) Original-Received: from [192.168.1.11] (x5ce2f213.dyn.telefonica.de. [92.226.242.19]) by smtp.gmail.com with ESMTPSA id u89-v6sm14380679wma.4.2018.05.19.15.40.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 19 May 2018 15:40:14 -0700 (PDT) In-Reply-To: X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 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.org gmane.comp.tex.context:100840 Archived-At: This is a multi-part message in MIME format. --===============6255386151510109571== Content-Type: multipart/alternative; boundary="------------050704060205080309040107" This is a multi-part message in MIME format. --------------050704060205080309040107 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit > Idris Samawi Hamid ادريس سماوي حامد > 20. Mai 2018 um 00:30 > Dear gang, > > Related to the last thread ("Numbered, counted snippets in running > text"). Let us consider the same macro: > > ======= > \newcount \MQT > \MQT=1 > \define[1]\NUM{% > \framed[offset=overlay,frame=off,background=color,backgroundcolor=green] > {\starttabulate[|c|] > \NC \mbox{\the\MQT} \NR > \NC #1 \NR > \stoptabulate}% > \advance\MQT by 1 > \hbox{}} > > \startTEXpage > \dorecurse{5}{Unnumbered Text \NUM{Numbered Text} } > \stopTEXpage > ======= > > How can one make a conversion of the numerals output by the \newcount? > That is, how so we replace the default U+0030-U+0039 digits (0 1 2 > 3..) with some defined conversion (e.g., \romannumerals)? > > Is there a ConTeXt way to setup new counts so that they can > automatically use the conversion mechanism? \definecounter[idris]%[numberconversion=R] \starttext \incrementcounter[idris] \convertedcounter[idris] \incrementcounter[idris] \convertedcounter[idris][numberconversion=a] \incrementcounter[idris] \convertedcounter[idris] \setupcounter[idris][numberconversion=r] \incrementcounter[idris] \convertedcounter[idris] \stoptext Wolfgang --------------050704060205080309040107 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Dear gang,

Related to the last thread ("Numbered, counted snippets in running text"). Let us consider the same macro:

=======
\newcount \MQT
\MQT=1
\define[1]\NUM{%
\framed[offset=overlay,frame=off,background=color,backgroundcolor=green]
{\starttabulate[|c|]
\NC \mbox{\the\MQT} \NR
\NC #1 \NR
\stoptabulate}%
\advance\MQT by 1
\hbox{}}

\startTEXpage
\dorecurse{5}{Unnumbered Text \NUM{Numbered Text} }
\stopTEXpage
=======

How can one make a conversion of the numerals output by the \newcount? That is, how so we replace the default U+0030-U+0039 digits (0 1 2 3..) with some defined conversion (e.g., \romannumerals)?

Is there a ConTeXt way to setup new counts so that they can automatically use the conversion mechanism?

\definecounter[idris]%[numberconversion=R]

\starttext

\incrementcounter[idris]
\convertedcounter[idris]

\incrementcounter[idris]
\convertedcounter[idris][numberconversion=a]

\incrementcounter[idris]
\convertedcounter[idris]

\setupcounter[idris][numberconversion=r]

\incrementcounter[idris]
\convertedcounter[idris]

\stoptext

Wolfgang
--------------050704060205080309040107-- --===============6255386151510109571== 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 X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f --===============6255386151510109571==--