slatex / LaTeXML-Plugin-sTeX

A LaTeXML Plugin for Semantic LaTeX (sTeX)
LaTeX Project Public License v1.3c
2 stars 3 forks source link

\nappa should create variable #31

Open kohlhase opened 8 years ago

kohlhase commented 8 years ago

From @kohlhase on October 30, 2014 7:56

in functions.en.tex we have $\nappa{f}x=y$, which is supposed to mark up the fact that the function (variable) f is applied to the argument z. I want this to generate

<om:OMOBJ>
  <om:OMA>
    <om:OMS cd="equal" name="equal"/>
    <om:OMA>
      <om:OMV name="f"/>
      <om:OMV name="x"/>
    </om:OMA>
    <om:OMV name="y"/>
  </om:OMA>
</om:OMOBJ>

but it generates

<om:OMOBJ>
  <om:OMA>
    <om:OMS cd="equal" name="equal"/>
    <om:OMA>
      <om:OMS cd="latexml" name="f"/>
      <om:OMV name="x"/>
    </om:OMA>
    <om:OMV name="y"/>
  </om:OMA>
</om:OMOBJ>

because we have in cmath.sty.ltxml

# \nappa{<function>}{<(const)(,\1)*>}
# @#1(#2)
DefConstructor('\nappa[]{}{}',
  "<ltx:XMApp>"
    ."<ltx:XMTok meaning='#2' />"
    ."<ltx:XMArg>#3</ltx:XMArg>"
  ."</ltx:XMApp>");

I have tried changing the first child of the XMApp to <ltx:XMTok name='#2' />, and indeed this gives me a variable, but it has the wrong name: it is <om:OMV name="normal-f"/> @dginev, could you have a look? I suspect this should be easy for you.

@m-iancu fixing this would solve the errors of the form

 parse error: Cannot resolve module for latexml?f from theory http://mathhub.info/smglom/sets/functions.en.omdoc?functions.en

which have been appearing lately (since I started using \nappa consistently in SMGloM).

Copied from original issue: KWARC/sTeX#33

kohlhase commented 8 years ago

I have currently applied the name= variant and updated the XSLT to clean up the normal-; but this is rather hacked, so I will leave this bug open.