Numbered, counted snippets in running text
![](https://secure.gravatar.com/avatar/11bdb092d7681af7742fdd43617e975c.jpg?s=120&d=mm&r=g)
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
![](https://secure.gravatar.com/avatar/60f3cc97f94fa3690ba406f8c1a7fc4f.jpg?s=120&d=mm&r=g)
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 ___________________________________________________________________________________
![](https://secure.gravatar.com/avatar/11bdb092d7681af7742fdd43617e975c.jpg?s=120&d=mm&r=g)
On Sat, 19 May 2018 16:47:34 -0600, Henri Menke
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
![](https://secure.gravatar.com/avatar/b79687264c3e06cba13b54d05b12a9f5.jpg?s=120&d=mm&r=g)
\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 ___________________________________________________________________________________
![](https://secure.gravatar.com/avatar/11bdb092d7681af7742fdd43617e975c.jpg?s=120&d=mm&r=g)
On Sun, 20 May 2018 08:02:46 -0600, Wolfgang Schuster
\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
participants (3)
-
Henri Menke
-
Idris Samawi Hamid ادريس سماوي ح امد
-
Wolfgang Schuster