ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Conversion of \newcounts
@ 2018-05-19 22:30 Idris Samawi Hamid ادريس سماوي حامد
  2018-05-19 22:40 ` Wolfgang Schuster
  0 siblings, 1 reply; 3+ messages in thread
From: Idris Samawi Hamid ادريس سماوي حامد @ 2018-05-19 22:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 913 bytes --]

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?

See attached. Thanks in advance for your wisdom!

Best wishes
Idris
-- 
Idris Samawi Hamid, Professor
Department of Philosophy
Colorado State University
Fort Collins, CO 80512

[-- Attachment #2: scratch.tex --]
[-- Type: application/x-tex, Size: 290 bytes --]

[-- Attachment #3: scratch.pdf --]
[-- Type: application/pdf, Size: 6565 bytes --]

[-- Attachment #4: Type: text/plain, Size: 492 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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Conversion of \newcounts
  2018-05-19 22:30 Conversion of \newcounts Idris Samawi Hamid ادريس سماوي حامد
@ 2018-05-19 22:40 ` Wolfgang Schuster
  2018-05-20  2:38   ` Idris Samawi Hamid ادريس سماوي حامد
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Schuster @ 2018-05-19 22:40 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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



> Idris Samawi Hamid ادريس سماوي حامد <mailto:Idris.Hamid@colostate.edu>
> 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

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

[-- Attachment #2: Type: text/plain, Size: 492 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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Conversion of \newcounts
  2018-05-19 22:40 ` Wolfgang Schuster
@ 2018-05-20  2:38   ` Idris Samawi Hamid ادريس سماوي حامد
  0 siblings, 0 replies; 3+ messages in thread
From: Idris Samawi Hamid ادريس سماوي حامد @ 2018-05-20  2:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sat, 19 May 2018 16:40:13 -0600, Wolfgang Schuster  
<schuster.wolfgang@gmail.com> wrote:

>
>
>> Idris Samawi Hamid ادريس سماوي حامد <mailto:Idris.Hamid@colostate.edu>
>> 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

Many thanks, Wolfgang, that is a huge help!

Idris
-- 
Idris Samawi Hamid, Professor
Department of Philosophy
Colorado State University
Fort Collins, CO 80512
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-20  2:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-19 22:30 Conversion of \newcounts Idris Samawi Hamid ادريس سماوي حامد
2018-05-19 22:40 ` Wolfgang Schuster
2018-05-20  2:38   ` Idris Samawi Hamid ادريس سماوي حامد

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).