From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/100844 Path: news.gmane.org!.POSTED!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Numbered, counted snippets in running text Date: Sun, 20 May 2018 16:02:46 +0200 Message-ID: <5B018006.4070402@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="===============4818463313295049799==" X-Trace: blaine.gmane.org 1526824879 4748 195.159.176.226 (20 May 2018 14:01:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 20 May 2018 14:01:19 +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 16:01:15 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 1fKOtc-00012S-QL for gctc-ntg-context-518@m.gmane.org; Sun, 20 May 2018 16:01:12 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 163D72ACC5; Sun, 20 May 2018 16:03:02 +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 O9iFZZXxA5nV; Sun, 20 May 2018 16:03:01 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id 478742ADE1; Sun, 20 May 2018 16:03:01 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 543412ADE2 for ; Sun, 20 May 2018 16:03:00 +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 WtIPJyHBJWDV for ; Sun, 20 May 2018 16:02:59 +0200 (CEST) Original-Received: from mail-wm0-f50.google.com (mail-wm0-f50.google.com [74.125.82.50]) (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 8C9532ADDE for ; Sun, 20 May 2018 16:02:49 +0200 (CEST) Original-Received: by mail-wm0-f50.google.com with SMTP id f8-v6so22437076wmc.4 for ; Sun, 20 May 2018 07:02:49 -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=gIqUkPWhRgXmFT4FvVFzauI8R5Mn0zf8KELEQZt7pK8=; b=a2X4mZKRSksqJy5PimRrPCblyzHhK7Yx8/98T2OT853VmOAxREGGZ15G51qUEA+ZWo TtaFrO4X3gHQVVDP8mXOQXYhhTRSWXcw9RPbTFNSElLAHK5Nv6PAU/5+QvZp50ue4OwU OAI8SMG1hoUTPJPVE4eQAUYORgQh2o95PXpPX0gm/5H+g60mBF+DiTmMg3BbU5kVT5Vk MAVvyOab8Z0l27GDtS1Mcl2L9jLP3juKfrvgpjaGqzfRtxrdL1dEslc/LieR+CF6TdHQ oSx+OFN3nGYqOwDGBMQ2NijjJMyG//uSLJPUPe6pKUakBdvvsTYC5sBxXQA1o7lxB8Bz E6pw== 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=gIqUkPWhRgXmFT4FvVFzauI8R5Mn0zf8KELEQZt7pK8=; b=T9Jy+U9oYevaL8lWBXkdx62Y1bJavUsELe6NebmsdyaMAySk+aqAPYZ0ycgwRW/dJP ru7jLzjzXafW3w0tsd4KA27sx9hG9PcdNEEW5PA7PLPoFYwQt2bCqwA37FnShpF+l+2T D6lvWG4+mYKz9TUowi8aNyWYNmixdKDmx/bsX/EolgAktRdaqBETkoOKnUDzz76VKMfm 7jmlHEmvTUxdN4wI1rkIMKaEng0kKoHcvcKLW0MJWpfNdjeuIBLS+x+nFFSCghQYwYMx EYz2gbK/Ttig6iD84ydCXk7eNeFgtgwBjkcAhN7kM1Vg6qZEG8j1BHaFZ+Nbc2GqZeA4 XOpA== X-Gm-Message-State: ALKqPwefpprr8KXb8yy8mKtoaTL61GfSFRSuee5QZY9AdRwNpIWx859R mXLI7ZTqCPQHBqlLE/x3Mcpe9jpk X-Google-Smtp-Source: AB8JxZoM4D0keIhE3cbWnMoNAYD6x2/k+6mgJ4v+waNR1Q/D8ALMcW0SiBpyK4VajkOGWmr7C2Iyvw== X-Received: by 2002:a1c:b646:: with SMTP id g67-v6mr9260593wmf.88.1526824968973; Sun, 20 May 2018 07:02:48 -0700 (PDT) Original-Received: from [192.168.1.11] (x4dbe9bac.dyn.telefonica.de. [77.190.155.172]) by smtp.gmail.com with ESMTPSA id g28-v6sm12007806wmc.38.2018.05.20.07.02.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 May 2018 07:02:48 -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:100844 Archived-At: This is a multi-part message in MIME format. --===============4818463313295049799== Content-Type: multipart/alternative; boundary="------------060901070509000802040502" This is a multi-part message in MIME format. --------------060901070509000802040502 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit \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 ادريس سماوي حامد > 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 > ___________________________________________________________________________________ --------------060901070509000802040502 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit \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
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
___________________________________________________________________________________

--------------060901070509000802040502-- --===============4818463313295049799== 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 --===============4818463313295049799==--