Hi Hans, can you extend the \setupreferencestructureprefix command with number (e.g. numberconversion) keys. In strc-ref.mkvi the definition of \getreferencestructureprefix should be changed to (besides the number keys I added starter and stopper keys to the prefix) \def\getreferencestructureprefix#kind#name#category% name will change {{ prefix = "\referencestructureprefixparameter{#kind}{#name}{#category}\c!prefix", separatorset = "\referencestructureprefixparameter{#kind}{#name}{#category}\c!prefixseparatorset", conversion = "\referencestructureprefixparameter{#kind}{#name}{#category}\c!prefixconversion", conversionset = "\referencestructureprefixparameter{#kind}{#name}{#category}\c!prefixconversionset", starter = \!!bs\referencestructureprefixparameter{#kind}{#name}{#category}\c!prefixstarter\!!es, stopper = \!!bs\referencestructureprefixparameter{#kind}{#name}{#category}\c!prefixstopper\!!es, set = "\referencestructureprefixparameter{#kind}{#name}{#category}\c!prefixset", segments = "\referencestructureprefixparameter{#kind}{#name}{#category}\c!prefixsegments", connector = \!!bs\referencestructureprefixparameter{#kind}{#name}{#category}\c!prefixconnector\!!es, }, { separatorset = "\referencestructureprefixparameter{#kind}{#name}{#category}\c!numberseparatorset", conversion = "\referencestructureprefixparameter{#kind}{#name}{#category}\c!numberconversion", conversionset = "\referencestructureprefixparameter{#kind}{#name}{#category}\c!numberconversionset", starter = \!!bs\referencestructureprefixparameter{#kind}{#name}{#category}\c!numberstarter\!!es, stopper = \!!bs\referencestructureprefixparameter{#kind}{#name}{#category}\c!numberstopper\!!es, segments = "\referencestructureprefixparameter{#kind}{#name}{#category}\c!numbersegments", }} In the Lua file src-ref.lua a small change is necessary to use this extra table: -function genericfilters.number(data,what,prefixspec) -- todo: spec and then no stopper +function genericfilters.number(data,what,prefixspec,numberspec) -- todo: spec and then no stopper if data then numberdata = lists.reordered(data) -- data.numberdata if numberdata then helpers.prefix(data,prefixspec) - sections.typesetnumber(numberdata,"number",numberdata) + sections.typesetnumber(numberdata,"number",numberspec,numberdata) else local useddata = data.useddata if useddata and useddata.number then context(useddata.number) end end end end BTW: The \setupreferencestructureprefix command needs a better name %%%% begin example \setupreferencestructureprefix[default][prefixstopper={\symbol[none]},numberstopper={\symbol[none]}] %\setupreferencestructureprefix[section][default][prefixconversion=A] %\setupreferencestructureprefix[float] [default][numberconversion=A] \setuphead [chapter][sectionstopper=.] \setupcaption[figure] [numberstopper=:] \starttext \chapter[sec:dummy]{Dummy chapter} \placefigure[][fig:dummy]{Dummy figure}{\externalfigure[dummy]} Section: \in[sec:dummy] Float: \in[fig:dummy] \stoptext %%%% end example Wolfgang
On 3/6/2015 3:16 PM, Wolfgang Schuster wrote:
can you extend the \setupreferencestructureprefix command with number (e.g. numberconversion) keys.
sure, thanks for figuring it out
In strc-ref.mkvi the definition of \getreferencestructureprefix should be changed to (besides the number keys I added starter and stopper keys to the prefix)
ok
In the Lua file src-ref.lua a small change is necessary to use this extra table:
ok ----------------------------------------------------------------- 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 -----------------------------------------------------------------
participants (2)
-
Hans Hagen
-
Wolfgang Schuster