* Numbered, counted snippets in running text
@ 2018-05-19 21:34 Idris Samawi Hamid ادريس سماوي حامد
2018-05-19 22:47 ` Henri Menke
2018-05-20 14:02 ` Wolfgang Schuster
0 siblings, 2 replies; 5+ messages in thread
From: Idris Samawi Hamid ادريس سماوي حامد @ 2018-05-19 21:34 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1: Type: text/plain, Size: 642 bytes --]
Dear gang,
Just put together a macro that appears to do what's desired. However, is
there a cleaner, more ConTeXt-like way to do this?
=======
\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
=======
See attached. Thanks in advance for any suggestions for improvement.
Best wishes
Idris
--
Idris Samawi Hamid, Professor
Department of Philosophy
Colorado State University
Fort Collins, CO 80512
[-- Attachment #2: scratch.pdf --]
[-- Type: application/pdf, Size: 6565 bytes --]
[-- Attachment #3: scratch.tex --]
[-- Type: application/x-tex, Size: 290 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] 5+ messages in thread
* Re: Numbered, counted snippets in running text
2018-05-19 21:34 Numbered, counted snippets in running text Idris Samawi Hamid ادريس سماوي حامد
@ 2018-05-19 22:47 ` Henri Menke
2018-05-20 2:43 ` Idris Samawi Hamid ادريس سماوي حامد
2018-05-20 14:02 ` Wolfgang Schuster
1 sibling, 1 reply; 5+ messages in thread
From: Henri Menke @ 2018-05-19 22:47 UTC (permalink / raw)
To: ntg-context
On 05/20/2018 09:34 AM, Idris Samawi Hamid ادريس سماوي حامد wrote:
> Dear gang,
>
> Just put together a macro that appears to do what's desired. However, is
> there a cleaner, more ConTeXt-like way to do this?
>
> =======
> \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
> =======
This feels more like “the ConTeXt way” to me.
\defineframed
[MQTframed]
[offset=overlay,
frame=off,
background=color,
backgroundcolor=green,
align=middle]
\definecounter[MQT]
\setcounter[MQT][1]
\define[1]\NUM
{%
\startframed[MQTframed]
\convertedcounter[MQT]\par
#1%
\stopframed
\incrementcounter[MQT]%
}
\startTEXpage
\dorecurse{5}{Unnumbered Text \NUM{Numbered Text}\par}
\stopTEXpage
>
> See attached. Thanks in advance for any suggestions for improvement.
>
> Best wishes
> Idris
>
>
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
>
___________________________________________________________________________________
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] 5+ messages in thread
* Re: Numbered, counted snippets in running text
2018-05-19 22:47 ` Henri Menke
@ 2018-05-20 2:43 ` Idris Samawi Hamid ادريس سماوي حامد
0 siblings, 0 replies; 5+ messages in thread
From: Idris Samawi Hamid ادريس سماوي حامد @ 2018-05-20 2:43 UTC (permalink / raw)
To: mailing list for ConTeXt users
On Sat, 19 May 2018 16:47:34 -0600, Henri Menke <henrimenke@gmail.com>
wrote:
> On 05/20/2018 09:34 AM, Idris Samawi Hamid ادريس سماوي حامد wrote:
>> Dear gang,
>>
>> Just put together a macro that appears to do what's desired. However, is
>> there a cleaner, more ConTeXt-like way to do this?
>>
>> =======
>> \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
>> =======
>
> This feels more like “the ConTeXt way” to me.
>
> \defineframed
> [MQTframed]
> [offset=overlay,
> frame=off,
> background=color,
> backgroundcolor=green,
> align=middle]
>
> \definecounter[MQT]
> \setcounter[MQT][1]
>
> \define[1]\NUM
> {%
> \startframed[MQTframed]
> \convertedcounter[MQT]\par
> #1%
> \stopframed
> \incrementcounter[MQT]%
> }
>
> \startTEXpage
> \dorecurse{5}{Unnumbered Text \NUM{Numbered Text}\par}
> \stopTEXpage
>
>>
>> See attached. Thanks in advance for any suggestions for improvement.
Many thanks, Henri; this is a big help!
Best wishes
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] 5+ messages in thread
* Re: Numbered, counted snippets in running text
2018-05-19 21:34 Numbered, counted snippets in running text Idris Samawi Hamid ادريس سماوي حامد
2018-05-19 22:47 ` Henri Menke
@ 2018-05-20 14:02 ` Wolfgang Schuster
2018-05-20 22:04 ` Idris Samawi Hamid ادريس سماوي حامد
1 sibling, 1 reply; 5+ messages in thread
From: Wolfgang Schuster @ 2018-05-20 14:02 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 1506 bytes --]
\definelabel[idris][text=,headstyle=,numberconversion=R]
\defineframed
[NUM]
[width=fit,
align=middle,
frame=off,
background=color,
backgroundcolor=green,
top={\idris\par},
location=bottom]
\starttext
\dorecurse{5}{Unnumbered Text \NUM{Numbered Text} }
\stoptext
Wolfgang
> Idris Samawi Hamid ادريس سماوي حامد <mailto:Idris.Hamid@colostate.edu>
> 19. Mai 2018 um 23:34
> Dear gang,
>
> Just put together a macro that appears to do what's desired. However,
> is there a cleaner, more ConTeXt-like way to do this?
>
> =======
> \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
> =======
>
> See attached. Thanks in advance for any suggestions for improvement.
>
> Best wishes
> Idris
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
[-- Attachment #1.2: Type: text/html, Size: 3078 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] 5+ messages in thread
* Re: Numbered, counted snippets in running text
2018-05-20 14:02 ` Wolfgang Schuster
@ 2018-05-20 22:04 ` Idris Samawi Hamid ادريس سماوي حامد
0 siblings, 0 replies; 5+ messages in thread
From: Idris Samawi Hamid ادريس سماوي حامد @ 2018-05-20 22:04 UTC (permalink / raw)
To: mailing list for ConTeXt users
On Sun, 20 May 2018 08:02:46 -0600, Wolfgang Schuster
<schuster.wolfgang@gmail.com> wrote:
> \definelabel[idris][text=,headstyle=,numberconversion=R]
>
> \defineframed
> [NUM]
> [width=fit,
> align=middle,
> frame=off,
> background=color,
> backgroundcolor=green,
> top={\idris\par},
> location=bottom]
>
> \starttext
> \dorecurse{5}{Unnumbered Text \NUM{Numbered Text} }
> \stoptext
Wow.. many thanks!
Idris
>
> Wolfgang
>> Idris Samawi Hamid ادريس سماوي حامد <mailto:Idris.Hamid@colostate.edu>
>> 19. Mai 2018 um 23:34
>> Dear gang,
>>
>> Just put together a macro that appears to do what's desired. However,
>> is there a cleaner, more ConTeXt-like way to do this?
>>
>> =======
>> \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
>> =======
--
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] 5+ messages in thread
end of thread, other threads:[~2018-05-20 22:04 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-19 21:34 Numbered, counted snippets in running text Idris Samawi Hamid ادريس سماوي حامد
2018-05-19 22:47 ` Henri Menke
2018-05-20 2:43 ` Idris Samawi Hamid ادريس سماوي حامد
2018-05-20 14:02 ` Wolfgang Schuster
2018-05-20 22:04 ` 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).