From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/90979 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Request: Numbercommand key for \setupcaption Date: Sat, 11 Apr 2015 09:07:36 +0200 Message-ID: References: <5527CEA9.50200@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Content-Type: multipart/mixed; boundary="===============1663890893==" X-Trace: ger.gmane.org 1428736117 7131 80.91.229.3 (11 Apr 2015 07:08:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 11 Apr 2015 07:08:37 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Apr 11 09:08:27 2015 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YgpWk-0000dy-Qt for gctc-ntg-context-518@m.gmane.org; Sat, 11 Apr 2015 09:08:26 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id EB42C10275 for ; Sat, 11 Apr 2015 09:08:25 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Ao06ygJpSEzc for ; Sat, 11 Apr 2015 09:08:24 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 44FD810292 for ; Sat, 11 Apr 2015 09:07:47 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id DE66D10205 for ; Sat, 11 Apr 2015 09:07:41 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id BLYiPb5HLGFr for ; Sat, 11 Apr 2015 09:07:41 +0200 (CEST) Original-Received: from filter3-til.mf.surf.net (filter3-til.mf.surf.net [194.171.167.219]) by balder.ntg.nl (Postfix) with ESMTP id F240E10202 for ; Sat, 11 Apr 2015 09:07:40 +0200 (CEST) Original-Received: from mail-wi0-x22d.google.com (mail-wi0-x22d.google.com [IPv6:2a00:1450:400c:c05::22d]) by filter3-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id t3B77dxr017499 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Sat, 11 Apr 2015 09:07:39 +0200 Original-Received: by widdi4 with SMTP id di4so18668312wid.0 for ; Sat, 11 Apr 2015 00:07:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:message-id:mime-version:subject:date:references :to:in-reply-to; bh=Eim8JfAL9V2nXR7XWKlol4Fh236V/axJpBzK7BXZ78c=; b=DdPbrigN2ojHnzicv43fVevtJRXbcMrPF4c5dgTFDX6zxcVLH3fJ4amJx22xdyFua4 ikm71InZ4FuGQXgzqDzw4AtL0kbns0xIu07lV9YGowB/0qs6nJ8JbxnZXB+8TZa+RDEU yhiwVvJYZIHtyP1Zzuzlh8Ge2LaxTX+2oMvKx0i8ycsmwPOV6bihvO0pGJ4IHRZTphV9 VeK3Hmhz0IXh3OzJhZ0e3O8CqQ+E8Dqzi2Fv+V7QdN6SFNc+6GgSHAVG3CG6Ej0Chw/g V+nptGeF1k21ptOKCBD43DrpIjGFxNFQD+qf23FNKgcbuuE+InLUPx0iFjCslYRmggHt sACA== X-Received: by 10.180.74.144 with SMTP id t16mr3944449wiv.33.1428736059272; Sat, 11 Apr 2015 00:07:39 -0700 (PDT) Original-Received: from keima.localdomain (x2f34000.dyn.telefonica.de. [2.243.64.0]) by mx.google.com with ESMTPSA id c3sm1530941wiz.2.2015.04.11.00.07.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 11 Apr 2015 00:07:38 -0700 (PDT) In-Reply-To: <5527CEA9.50200@wxs.nl> X-Mailer: Apple Mail (2.2098) X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=2a00:1450:400c:c05::22d; country=IE; latitude=53.3478; longitude=-6.2597; http://maps.google.com/maps?q=53.3478,-6.2597&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 06Oev7DTg - e13e782761a3 - 20150411 (trained as not-spam) Received-SPF: pass (filter3-til.mf.surf.net: domain of schuster.wolfgang@gmail.com designates 2a00:1450:400c:c05::22d as permitted sender) receiver=filter3-til.mf.surf.net; client-ip=2a00:1450:400c:c05::22d; envelope-from=; helo=mail-wi0-x22d.google.com; identity=mailfrom X-Scanned-By: CanIt (www . roaringpenguin . com) 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:90979 Archived-At: --===============1663890893== Content-Type: multipart/alternative; boundary="Apple-Mail=_6E83F8F3-B09C-4BEF-9995-BBE2D6C5E260" --Apple-Mail=_6E83F8F3-B09C-4BEF-9995-BBE2D6C5E260 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > Am 10.04.2015 um 15:22 schrieb Hans Hagen : >=20 > On 4/10/2015 12:38 PM, Wolfgang Schuster wrote: >> Hi Hans, >>=20 >> can you add a number command key to \setupcaption because when you = use a language which uses left and right labels for the number >> the numberstopper key can=E2=80=99t be used anymore to put a symbol = after the float counter without misusing the label texts. >>=20 >>=20 >> For example the following example should print >>=20 >> LEFT 1 RIGHT: Dummy figure >>=20 >> as figure caption but it shows only >>=20 >> LEFT 1 RIGHT Dummy figure >>=20 >> without the color after =E2=80=9CRIGHT=E2=80=9D. >>=20 >>=20 >> %%%% begin example >> \useMPlibrary[dum] >>=20 >> \setuplabeltext[en][figure=3D{LEFT , RIGHT}] >>=20 >> \definereferenceformat[infigure][label=3D*] >>=20 >> \setupcaption[figure][numbercommand=3D\groupedcommand{}{:}] >>=20 >> \starttext >>=20 >> \startplacefigure[reference=3Dfig:dummy,title=3DDummy figure] >> \externalfigure[dummy] >> \stopplacefigure >>=20 >> See \infigure[fig:dummy]. >>=20 >> \stoptext >> %%%% end example >=20 > beta: >=20 > \useMPlibrary[dum] >=20 > \setuplabeltext[en][figure=3D{LEFT , RIGHT}] >=20 > \definereferenceformat[infigure][label=3D*] >=20 > \setupcaption > [figure] > [textcommand=3D\groupedcommand{<}{>}, > numbercommand=3D\groupedcommand{[}{]}] >=20 > \starttext >=20 > \startplacefigure[reference=3Dfig:dummy,title=3DDummy figure] > \externalfigure[dummy] > \stopplacefigure >=20 > See \infigure[fig:dummy]. >=20 > \stoptext The numbercommand key should include the labels. \unprotect \unexpanded\def\thecurrentfloatnumber {\ifnofloatcaption \else \ifnofloatnumber \else \ifx\currentfloatnumber\relax\else \floatcaptionparameter\c!numbercommand {\namedtaggedlabeltexts \t!floatlabel \currentfloat \t!floatnumber\currentfloat = {\clf_savedlistprefixednumber{\currentfloat}\currentfloatnumber\relax \thecurrentfloatnumbersuffix}}% \fi \fi \fi} \protect \useMPlibrary[dum] \setuplabeltext[en][figure=3D{LEFT , RIGHT}] \definereferenceformat[infigure][label=3D*] \setupcaption [figure] [textcommand=3D\groupedcommand{<}{>}, numbercommand=3D\groupedcommand{[}{]}] \starttext \startplacefigure[reference=3Dfig:dummy,title=3DDummy figure] \externalfigure[dummy] \stopplacefigure See \infigure[fig:dummy]. \stoptext Wolfgang= --Apple-Mail=_6E83F8F3-B09C-4BEF-9995-BBE2D6C5E260 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
Am 10.04.2015 um 15:22 schrieb Hans Hagen <pragma@wxs.nl>:

On 4/10/2015 12:38 PM, Wolfgang Schuster = wrote:
Hi Hans,

can you add a = number command key to \setupcaption because when you use a language = which uses left and right labels for the number
the = numberstopper key can=E2=80=99t be used anymore to put a symbol after = the float counter without misusing the label texts.


For example the following example should = print

    LEFT 1 RIGHT: = Dummy figure

as figure caption but it shows = only

    LEFT 1 RIGHT = Dummy figure

without the color after = =E2=80=9CRIGHT=E2=80=9D.


%%%% = begin example
\useMPlibrary[dum]

\setuplabeltext[en][figure=3D{LEFT , RIGHT}]

\definereferenceformat[infigure][label=3D*]

\setupcaption[figure][numbercommand=3D\groupedcommand{}{:}]

\starttext

\startplacefigure[reference=3Dfig:dummy,title=3DDummy = figure]
\externalfigure[dummy]
\stopplacefigure

See \infigure[fig:dummy].

\stoptext
%%%% end example

beta:

\useMPlibrary[dum]

\setuplabeltext[en][figure=3D{LEFT , = RIGHT}]

\definereferenceformat[infigure][label=3D*]

\setupcaption
 [figure]
 [textcommand=3D\groupedcommand{<}{>},
  numbercommand=3D\groupedcommand{[}{]}]

\starttext

   \startplacefigure[reference=3Dfig:dummy,title= =3DDummy figure]
       \externalfigure[dummy= ]
   \stopplacefigure

   See = \infigure[fig:dummy].

\stoptext

The = numbercommand key should include the labels.

\unprotect
\unexpanded\def\thecurrentfloatnumber
  {\ifnofloatcaption \else \ifnofloatnumber = \else
    =  \ifx\currentfloatnumber\relax\else
  =      \floatcaptionparameter\c!numbercommand
        =  {\namedtaggedlabeltexts
      =      \t!floatlabel \currentfloat
          =  \t!floatnumber\currentfloat
    =         =  {\clf_savedlistprefixednumber{\currentfloat}\currentfloatnumber\rela= x
              = \thecurrentfloatnumbersuffix}}%
    =  \fi
   \fi \fi}
\protect

\useMPlibrary[dum]

\setuplabeltext[en][figure=3D{LEFT , = RIGHT}]

\definereferenceformat[infigure][label=3D*]

\setupcaption
 [figure]
 [textcommand=3D\groupedcommand{<}{>},
  numbercommand=3D\groupedcommand{[}{]}]

\starttext

  =  \startplacefigure[reference=3Dfig:dummy,title=3DDummy = figure]
      =  \externalfigure[dummy]
  =  \stopplacefigure

   See \infigure[fig:dummy].
\stoptext
Wolfgang
= --Apple-Mail=_6E83F8F3-B09C-4BEF-9995-BBE2D6C5E260-- --===============1663890893== 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= --===============1663890893==--