From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/96047 Path: news.gmane.org!.POSTED!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Get "right" numbers using blocks and enumerations Date: Tue, 06 Sep 2016 21:29:53 +0200 Message-ID: <57CF1931.902@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="===============0425144345492061510==" X-Trace: blaine.gmane.org 1473190242 6172 195.159.176.226 (6 Sep 2016 19:30:42 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 6 Sep 2016 19:30:42 +0000 (UTC) User-Agent: Postbox 4.0.8 (Macintosh/20151105) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Sep 06 21:30:38 2016 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 1bhM4l-0000T0-El for gctc-ntg-context-518@m.gmane.org; Tue, 06 Sep 2016 21:30:31 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id C9013174E5; Tue, 6 Sep 2016 21:30:13 +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 SS3F_mDCm_c9; Tue, 6 Sep 2016 21:30:11 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id 0E740174E9; Tue, 6 Sep 2016 21:30:11 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 79CDC174E2 for ; Tue, 6 Sep 2016 21:30:09 +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 oCJsTG1sg5yh for ; Tue, 6 Sep 2016 21:30:08 +0200 (CEST) Original-Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54]) (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 09916174E1 for ; Tue, 6 Sep 2016 21:29:57 +0200 (CEST) Original-Received: by mail-wm0-f54.google.com with SMTP id w12so110737072wmf.0 for ; Tue, 06 Sep 2016 12:29:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to; bh=Qy0U36Y3385qWdj6RddXW0r3GFAbLpPf85ealpsHrCY=; b=1IqsmMmTi7+ju7vzPcSGNcqlygsFlBf/eItm+Ur/Wa1xSbnCKmsOGCuXijvQk8Vifc JBNTlXXxxHq+uBxRJ2kv0SPTtjur/xsmYYM0U/CHyrTsp3qWOMQRJAKURlVvBpAO2Bzy uR/BzlSl5ts33+p5abzxI/75m6ZIhxqyWBATk463iLLxQ+gIpVnrAm9tLXg0e+CW0hY3 WHX6+kauomGfNFcnR1iZrckZCfeodBSNj7XoBQdEKOPQ5LwXhGovj5oGTY0zh77dfD96 9gv4ZnYwmzpw9rUUV6QIh5KyMhl0HXfyrUBAcJ2cbfaeDpvn3L29ItKPTmWWbOKVizmS l6hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to; bh=Qy0U36Y3385qWdj6RddXW0r3GFAbLpPf85ealpsHrCY=; b=EHb72DcNWKQ29i754uqowdtq9MzyhmEu7WdELOH5PikaKiTClmb6H84nE1VpBy+aV5 6CtUVuyOcTjQ62Gvx4cAIcvcKUDSyPxGYgJFhGZZJwHvhnsE6MaSYKSP3gzV2UJGbovP Ip9fOFjSQWFzSruf9byHhl9sYs3cXc3yHbhl73qC9prNJ/lYxuoDgt3J14RFm7wJys/v VBQGz3Xd9oMG1XqXpfF8rA0B4k+ZInOnegqH6GBg99O2GO97uKKqAiByrGnSyRpDEa4u yKHjbV9C18Ee/O3QgvwG0+5LK9C7nACHyzYo5c5pIPIAiAYMSTcGMdZ4PECis2prD0UH 48Aw== X-Gm-Message-State: AE9vXwPSflphv9gHUHHwWEt7Lfu7MtUlRDqjtd9Cy8IJ6Ru4gvBJnRyd6HA8vfC6ivY12w== X-Received: by 10.194.101.42 with SMTP id fd10mr6477191wjb.182.1473190196354; Tue, 06 Sep 2016 12:29:56 -0700 (PDT) Original-Received: from keima.localdomain (x2f22f04.dyn.telefonica.de. [2.242.47.4]) by smtp.gmail.com with ESMTPSA id d62sm345078wmd.7.2016.09.06.12.29.55 for (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 06 Sep 2016 12:29:55 -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:96047 Archived-At: This is a multi-part message in MIME format. --===============0425144345492061510== Content-Type: multipart/alternative; boundary="------------050205000502070300040209" This is a multi-part message in MIME format. --------------050205000502070300040209 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit > Mikael P. Sundqvist > 1. September 2016 um 21:18 > Hi, > > I'm trying to use blocks for answers in a text, but cannot get the > numbering to work as I want. I have read about \processblocks at the > wiki (http://wiki.contextgarden.net/Command/processblocks), but I'm > not sure that is my cure. I probably miss something easy... > > The problem is probably easiest shown by an example: > > %%% > \defineblock[A] > \hideblocks[A] > > \defineenumeration[A][ > text=A, > prefix=yes, > prefixsegments=chapter, > way=bychapter, > ] > > \starttext > > \chapter{First chapter} > > \beginA > \startA > My first answer in the first chapter. > \stopA > \endA > > \beginA > \startA > My second answer in the first chapter. > \stopA > \endA > > > \chapter{Second chapter} > > \beginA > \startA > My first answer in the second chapter. > \stopA > \endA > > \beginA > \startA > My second answer in the second chapter. > \stopA > \endA > > \chapter{Answers} > \useblocks[A] > \stoptext > %%% > > I get, in the Answer chapter > > A 3.1, A 3.2, A 3.3 and A 3.4. > > What I want to have in the answer chapter is > > A 1.1, A 1.2, A 2.1 and A 2.2. > > (to follow the numbering in the chapters where the blocks were defined). > > Is it possible? What have I missed? Blocks only store their content without expanding counters etc. and when you flush them you have the same result as putting them into the appendices by hand. > Related: Is there a better way to set answers to questions? (Perhaps > not having to write both the \begin... \start... \stop... \end... for > every question? \setupblock[A][before=\startA,after=\stopA] but you can’t use the optional argument for a enumerations anymore (e.g. to set a title) with this method. Wolfgang --------------050205000502070300040209 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
1. September 2016 um 21:18
Hi,

I'm trying to use blocks for answers in a text, but cannot get the
numbering to work as I want. I have read about \processblocks at the
wiki (http://wiki.contextgarden.net/Command/processblocks), but I'm
not sure that is my cure. I probably miss something easy...

The problem is probably easiest shown by an example:

%%%
\defineblock[A]
\hideblocks[A]

\defineenumeration[A][
text=A,
prefix=yes,
prefixsegments=chapter,
way=bychapter,
]

\starttext

\chapter{First chapter}

\beginA
\startA
My first answer in the first chapter.
\stopA
\endA

\beginA
\startA
My second answer in the first chapter.
\stopA
\endA


\chapter{Second chapter}

\beginA
\startA
My first answer in the second chapter.
\stopA
\endA

\beginA
\startA
My second answer in the second chapter.
\stopA
\endA

\chapter{Answers}
\useblocks[A]
\stoptext
%%%

I get, in the Answer chapter

A 3.1, A 3.2, A 3.3 and A 3.4.

What I want to have in the answer chapter is

A 1.1, A 1.2, A 2.1 and A 2.2.

(to follow the numbering in the chapters where the blocks were defined).

Is it possible? What have I missed?
Blocks only store their content without expanding counters etc. and when
you flush them you have the same result as putting them into the appendices
by hand.
Related: Is there a better way to set answers to questions? (Perhaps
not having to write both the \begin... \start... \stop... \end... for
every question?
\setupblock[A][before=\startA,after=\stopA]

but you can’t use the optional argument for a enumerations anymore (e.g. to set a title) with this method.

Wolfgang
--------------050205000502070300040209-- --===============0425144345492061510== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly90ZXguYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHA6Ly9mb3VuZHJ5LnN1cGVsZWMu ZnIvcHJvamVjdHMvY29udGV4dHJldi8Kd2lraSAgICAgOiBodHRwOi8vY29udGV4dGdhcmRlbi5u ZXQKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX18= --===============0425144345492061510==--