[NTG-context] working on page refs with MP

Werner Hennrich wehe at gmx.at
Fri Mar 19 11:56:08 CET 2021


yes I had realized this already but I still don't know how to get those
page numbers down into MP - they keep being strings with macro code instead

is there a way the I can get \setupMPvariables[hdrPgs] in
\setupheadertexts[\setups{page:header}]
to be fully evaluated and stored as the page number in the MPvariables
first= and next= ??

    \startsetups page:header
         \setupMPvariables[hdrPgs]
             [curr=\pagenumber,
             first={\ref[page][\headerfirst]},
             next={\ref[page][\headernext]}]

     I've tried \expanded and \numeric without success

or alternatively in MP how would I call TeX (from MP) with a string like
"\ref[page][a]" and have the page number stored in a numeric var?

Thanks in advance,
Werner


Am 18.03.21 um 19:55 schrieb Hans Hagen:
> On 3/18/2021 6:14 PM, Werner Hennrich wrote:
>
>> metafun         > log >
>> metafun         > log > error: Improper subscript has been replaced
>> by zero
>> metapost        > log > <*> ... numeric numFirst; numFirst := \ref
>> [page]
> watch closely to the previous log line ... you're missing quotes so mp
> sees \ref [page] and as it ignores a \ it sees ref[page] which unless
> you defined 'ref' and 'page' triggers an error
>
> -----------------------------------------------------------------
>                                           Hans Hagen | PRAGMA ADE
>               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -----------------------------------------------------------------


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20210319/77649ad0/attachment-0001.htm>


More information about the ntg-context mailing list