Re: [NTG-context] Override MathML formula label

2019-07-29 Thread Duncan Hothersall
Brilliant, thanks Hans. Looks like I need to start delving properly into
the power of the XML setups.

Duncan

On Sun, 28 Jul 2019 at 21:04, Hans Hagen  wrote:

>
> \usemodule[mathml]
>
> \startxmlsetups mml:formula
>  \edef\mmlformulalabel{\xmlatt{#1}{label}}
>  \edef\mmlformulatitle{\xmlatt{#1}{title}}
>  \doifsomethingelse {\mmlformulalabel\mmlformulatitle} {
>
> \startplaceformula[reference=\mmlformulalabel,title=\mmlformulatitle]
>  \startformula
>  \xmlfirst{#1}{/mml:math}
>  \stopformula
>  \stopplaceformula
>  } {
>  \startformula
>  \xmlfirst{#1}{/mml:math}
>  \stopformula
>  }
> \stopxmlsetups
>
> Duncan
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Override MathML formula label

2019-07-28 Thread Hans Hagen

On 7/27/2019 8:23 AM, Duncan Hothersall wrote:

Hi all.

In processing MathML if I want a formula to be numbered I add a 
label="X" attribute to the  tag as per:


\usemodule[mathml]
\starttext
\xmlprocessdata{}{
  
   p=c-t
  
}{}
\stoptext

This will label the formula as (1). I know I can adjust how the 
automatic numbering is generated using \setupformulae, but how can I 
override the label used for a specific formula, say to set it to (36A)?

**

Basically I have a setup where formulae are mostly numbered sequentially 
but occasionally individual formulae need to have an out-of-sequence or 
differently formatted number.


Thanks as ever for any help.


\usemodule[mathml]

\startxmlsetups mml:formula
\edef\mmlformulalabel{\xmlatt{#1}{label}}
\edef\mmlformulatitle{\xmlatt{#1}{title}}
\doifsomethingelse {\mmlformulalabel\mmlformulatitle} {

\startplaceformula[reference=\mmlformulalabel,title=\mmlformulatitle]
\startformula
\xmlfirst{#1}{/mml:math}
\stopformula
\stopplaceformula
} {
\startformula
\xmlfirst{#1}{/mml:math}
\stopformula
}
\stopxmlsetups


\starttext
\xmlprocessdata {} {



p=c-t




p=c-t




p=c-t



}{}
\stoptext

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___