On 4/11/2015 9:07 AM, Wolfgang Schuster wrote:

Am 10.04.2015 um 15:22 schrieb Hans Hagen <pra...@wxs.nl
<mailto:pra...@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’t 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 “RIGHT”.


%%%% begin example
\useMPlibrary[dum]

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

\definereferenceformat[infigure][label=*]

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

\starttext

\startplacefigure[reference=fig:dummy,title=Dummy figure]
\externalfigure[dummy]
\stopplacefigure

See \infigure[fig:dummy].

\stoptext
%%%% end example

beta:

\useMPlibrary[dum]

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

\definereferenceformat[infigure][label=*]

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

\starttext

   \startplacefigure[reference=fig:dummy,title=Dummy 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\relax
               \thecurrentfloatnumbersuffix}}%
      \fi
    \fi \fi}
\protect

\useMPlibrary[dum]

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

\definereferenceformat[infigure][label=*]

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

\starttext

    \startplacefigure[reference=fig:dummy,title=Dummy figure]
        \externalfigure[dummy]
    \stopplacefigure

    See \infigure[fig:dummy].

\stoptext

hm, tricky as then the part wrapped around the number will not get tagged properly ... needs a bit more work

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
    tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to