slatex / LaTeXML-Plugin-sTeX

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

for attribute for n-th (n>1) definition wrong #53

Closed kohlhase closed 8 years ago

kohlhase commented 8 years ago

The for attribute of a definition element should reference all the symbols defined in this definition (and only these). They should be generated by the \defi* (and friends) in the definition body.

Unfortunately, the sTeX plugin generates these wrong, for second and later definitions it also includes the symbols from the previous definitions. For instance in graphs/source/graphregular.en.tex we see

\begin{definition}
  If in a graph $G$ all the vertices have the same degree, say $k$, then $G$ is called
  \defi[regular]{$k$-regular}, or simply \defi{regular}. 
\end{definition}
\begin{definition}
  A \atrefi{3-regular}{regular} graph is called \defii{cubic}{graph}.
\end{definition}

And this generates

    <omdoc:definition for="graphregular?regular" xml:id="graphregular.en.definition3"
...
   <omdoc:definition for="graphregular?cubic-graph graphregular?regular"

The reference to graphregular?regular is spurious and should not be there. I am sure that this is relatively easy to fix.

cmaeder commented 8 years ago

see #25 for other for-attribute problems. Is --expire=-1 a workaround?

kohlhase commented 8 years ago

Ah, interesting thanks for making the connection.

kohlhase commented 8 years ago

I doubt that --expire helps, since in this example it is all in one file. It seems that this is a problem in the definitionbody sub in statements.sty.ltxml, the symbols are computed incorrectly: I suspect in the line 139.

     my @symbols = @{$props{defs} || []};

which is set in line 185?

    $whatsit->setProperty(defs=>\@symbols);

and in a couple of other place, we find \@symbols, but I do not understand where this comes from. maybe this is something @dginev could have a look at?

kohlhase commented 8 years ago

But of course @angerhang you should also look at this as well.

kohlhase commented 8 years ago

@dginev, if you have LaTeXML-Plugin-sTeX installed, and smglom/graphs checked out, then

cd .../MathHub/smglom/graphs/source
latexmlc --profile stex-smglom-module.opt graphregular.en.tex --preamble ../../meta-inf/lib/pre.tex --postamble ../../meta-inf/lib/post.tex > foo.omdoc

will reproduce the problem

kohlhase commented 8 years ago

oh, and you would probably need the following file localpaths.tex (suitably localized)

% this file defines root path local repository
\defpath{MathHub}{/Users/kohlhase/localmh/MathHub}
\mhcurrentrepos{smglom/graphs}
\libinput{WApersons}
% we also set the base URI for the LaTeXML transformation
\baseURI[\MathHub{}]{https://mathhub.info/smglom/graphs}
angerhang commented 8 years ago

I also agree that the problem comes from definitionBody.

The problem, however, has to do with the $for value which contains the symbols from previous definitions. $for is later on added to the $for_attr in

if (ToString($for)) {
      $for = ToString($for);
      $for =~ s/^{(.+)}$/$1/eg;
      foreach (split(/,\s*/,$for)) {
        $for_attr{$_}=1;
      }}

$for_attr contain the symbols shown in the for attribute.

I don't know why we need this block of code from the first place. Whilst if we remove it, the problem can be solved.

kohlhase commented 8 years ago

well, just try it out, then you will see whether you get the right result.

angerhang commented 8 years ago

Yes I did try out and here is the output:

Hangs-MBP:source Hang$ latexmlc --profile stex-smglom-module.opt graphregular.en.tex --preamble ../../meta-inf/lib/pre.tex --path ../../../../ext/sTeX/sty/etc/ --postamble ../../meta-inf/lib/post.tex > foo.omdoc

...
Conversion complete: No obvious problems.

(post-processing...
(Scan  processing... 0.00 sec)
(CrossRef  processing... 0.00 sec)
(XMath[w/OpenMath+MathML::Presentation]  4 to process... 0.00 sec)
(XSLT[using omdocpost.xsl]  processing... 0.00 sec) 0.01 sec)
Post-processing complete: No obvious problems
Hangs-MBP:source Hang$ cat foo.omdoc 
...
<omdoc:definition for="graphregular?regular" xml:id="graphregular.en.definition3" about="#graphregular.en.definition3" stex:srcref="smglom/graphs/source/graphregular.en.tex#textrange(from=3;1,to=6;16)">
...
<omdoc:definition for="graphregular?cubic-graph" xml:id="graphregular.en.definition4" about="#graphregular.en.definition4" stex:srcref="smglom/graphs/source/graphregular.en.tex#textrange(from=8;1,to=10;16)">
kohlhase commented 8 years ago

hmm, that looks good. please commit, and we will run this over larger examples (i.e. the glossary @m-iancu)

angerhang commented 8 years ago

I pushed it to the for-fix branch https://github.com/KWARC/LaTeXML-Plugin-sTeX/tree/for-fix

dginev commented 8 years ago

The reason for that code block has been to record all defined symbols in a definition, as there can be multiple.

What I wonder from Michael's example is whether the \atrefi doesn't add to the for attribute by accident.

kohlhase commented 8 years ago

do you mean \atrefi or \adefi? the \*trefi* should not add anything to the for attributes at all, only the `*defi*``.

kohlhase commented 8 years ago

@angerhang please test it on smlgom/numberfields/source/ratarith.en.tex, this has multiple definitions and is therefore a better test case. The For attributes should mention exactly the <term elements. I suspect that the branch will miss some now.

kohlhase commented 8 years ago

unfortunately, I cannot, since for some reason latexml crashes for me without error messages.

angerhang commented 8 years ago
<?xml version="1.0"?>
<!--This OMDoc document is generated from an sTeX-encoded one via LaTeXML, you
  may want to reconsider editing it.-->
<omdoc xmlns:omdoc="http://omdoc.org/ns" xmlns="http://omdoc.org/ns" xmlns:stex="http://kwarc.info/ns/sTeX" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:om="http://www.openmath.org/OpenMath" xmlns:m="http://www.w3.org/1998/Math/MathML" xml:base="https://mathhub.info/smglom/graphs" xml:id="omdoc1" about="#omdoc1" stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=4;0,to=0;0)">
  <omdoc:theory xml:id="ratarith.en" about="#ratarith.en" stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=1;0,to=40;11)">
    <omdoc:imports from="smglom/numberfields/source/arithmetics#arithmetics"/>
    <omdoc:imports from="smglom/mv/source/equal#equal"/>
    <omdoc:metadata xml:id="ratarith.en.metadata1" about="#ratarith.en.metadata1" stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=1;0,to=40;11)">
      <dc:creator xml:id="ratarith.en.metadata1.creator1" about="#ratarith.en.metadata1.creator1" stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=1;0,to=40;11)">miko</dc:creator>
    </omdoc:metadata>
    <omdoc:imports from="smglom/numberfields/source/ratarith#ratarith" xml:id="ratarith.en.imports2" about="#ratarith.en.imports2" stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=1;0,to=40;11)"/>
    <omdoc:definition xml:id="ratarith.en.definition3" about="#ratarith.en.definition3" stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=2;1,to=6;18)">
      <omdoc:CMP xml:id="ratarith.en.definition3.CMP1" about="#ratarith.en.definition3.CMP1" stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=2;1,to=6;18)">
<p xmlns="http://www.w3.org/1999/xhtml" id="ratarith.en.definition3.CMP1.p1" class="ltx_p" about="#ratarith.en.definition3.CMP1.p1" stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=2;1,to=2;21)">On the <omdoc:term cd="rationalnumbers" name="rational-number" xml:id="ratarith.en.definition3.CMP1.p1.term1" about="#ratarith.en.definition3.CMP1.p1.term1" stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=2;11,to=3;54)">rational numbers</omdoc:term>, we define
<om:OMOBJ stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=3;51,to=4;61)"><om:OMA><om:OMS cd="ratarith" name="addition"/><om:OMA ic="variant:frac"><om:OMS cd="ratarith" name="division"/><om:OMV name="&#x1D44E;"/><om:OMV name="&#x1D44F;"/></om:OMA><om:OMA ic="variant:frac"><om:OMS cd="ratarith" name="division"/><om:OMV name="&#x1D450;"/><om:OMV name="&#x1D451;"/></om:OMA></om:OMA></om:OMOBJ> as
<om:OMOBJ stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=4;77,to=5;86)"><om:OMA><om:OMS cd="arithmetics" name="division"/><om:OMA><om:OMS cd="intarith" name="addition"/><om:OMA ic="variant:cdot"><om:OMS cd="intarith" name="multiplication"/><om:OMV name="&#x1D44E;"/><om:OMV name="&#x1D451;"/></om:OMA><om:OMA ic="variant:cdot"><om:OMS cd="intarith" name="multiplication"/><om:OMV name="&#x1D44F;"/><om:OMV name="&#x1D450;"/></om:OMA></om:OMA><om:OMA ic="variant:cdot"><om:OMS cd="intarith" name="multiplication"/><om:OMV name="&#x1D44F;"/><om:OMV name="&#x1D451;"/></om:OMA></om:OMA></om:OMOBJ>.</p></omdoc:CMP>
    </omdoc:definition>
    <omdoc:definition for="ratarith?difference ratarith?subtraction" xml:id="ratarith.en.definition4" about="#ratarith.en.definition4" stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=8;1,to=12;18)">
      <omdoc:CMP xml:id="ratarith.en.definition4.CMP1" about="#ratarith.en.definition4.CMP1" stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=8;1,to=12;18)">
<p xmlns="http://www.w3.org/1999/xhtml" id="ratarith.en.definition4.CMP1.p1" class="ltx_p" about="#ratarith.en.definition4.CMP1.p1" stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=8;1,to=8;21)">The <omdoc:term cd="ratarith" name="subtraction" role="definiendum" xml:id="ratarith.en.definition4.CMP1.p1.term1" about="#ratarith.en.definition4.CMP1.p1.term1" stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=8;59,to=9;27)">subtraction</omdoc:term> operator computes the <omdoc:term cd="ratarith" name="difference" role="definiendum" xml:id="ratarith.en.definition4.CMP1.p1.term2" about="#ratarith.en.definition4.CMP1.p1.term2" stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=8;19,to=9;67)">difference</omdoc:term> <om:OMOBJ stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=8;9,to=9;83)"><om:OMA><om:OMS cd="ratarith" name="subtraction"/><om:OMV name="&#x1D44E;"/><om:OMV name="&#x1D44F;"/></om:OMA></om:OMOBJ> of
<om:OMOBJ stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=9;77,to=10;31)"><om:OMA><om:OMS cd="set" name="inset"/><om:OMV name="&#x1D44E;"/><om:OMS cd="rationalnumbers" name="rational-number"/></om:OMA></om:OMOBJ> and <om:OMOBJ stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=9;45,to=10;71)"><om:OMA><om:OMS cd="set" name="inset"/><om:OMA><om:OMS cd="arithmetics" name="division"/><om:OMV name="&#x1D44F;"/><om:OMV name="&#x1D450;"/></om:OMA><om:OMS cd="rationalnumbers" name="rational-number"/></om:OMA></om:OMOBJ> which is defined
as <om:OMOBJ stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=10;24,to=11;39)"><om:OMA><om:OMS cd="ratarith" name="addition"/><om:OMV name="&#x1D44E;"/><om:OMA><om:OMS cd="arithmetics" name="division"/><om:OMA><om:OMS cd="integernumbers" name="uminus"/><om:OMV name="&#x1D44F;"/></om:OMA><om:OMV name="&#x1D450;"/></om:OMA></om:OMA></om:OMOBJ>.</p></omdoc:CMP>
    </omdoc:definition>
    <omdoc:definition xml:id="ratarith.en.definition5" about="#ratarith.en.definition5" stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=14;1,to=17;18)">
      <omdoc:CMP xml:id="ratarith.en.definition5.CMP1" about="#ratarith.en.definition5.CMP1" stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=14;1,to=17;18)">
<p xmlns="http://www.w3.org/1999/xhtml" id="ratarith.en.definition5.CMP1.p1" class="ltx_p" about="#ratarith.en.definition5.CMP1.p1" stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=14;1,to=14;21)">On <om:OMOBJ stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=14;11,to=15;25)"><om:OMS cd="rationalnumbers" name="rational-number"/></om:OMOBJ> we define
<om:OMOBJ stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=15;79,to=16;92)"><om:OMA><om:OMS cd="equal" name="equal"/><om:OMA ic="variant:cdot"><om:OMS cd="ratarith" name="multiplication"/><om:OMA><om:OMS cd="arithmetics" name="division"/><om:OMV name="&#x1D44E;"/><om:OMV name="&#x1D44F;"/></om:OMA><om:OMA><om:OMS cd="arithmetics" name="division"/><om:OMV name="&#x1D450;"/><om:OMV name="&#x1D451;"/></om:OMA></om:OMA><om:OMA><om:OMS cd="arithmetics" name="division"/><om:OMA ic="variant:cdot"><om:OMS cd="intarith" name="multiplication"/><om:OMV name="&#x1D44E;"/><om:OMV name="&#x1D450;"/></om:OMA><om:OMA ic="variant:cdot"><om:OMS cd="intarith" name="multiplication"/><om:OMV name="&#x1D44F;"/><om:OMV name="&#x1D451;"/></om:OMA></om:OMA></om:OMA></om:OMOBJ>.</p></omdoc:CMP>
    </omdoc:definition>
    <omdoc:definition for="ratarith?division ratarith?quotient" xml:id="ratarith.en.definition6" about="#ratarith.en.definition6" stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=19;1,to=24;18)">
      <omdoc:CMP xml:id="ratarith.en.definition6.CMP1" about="#ratarith.en.definition6.CMP1" stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=19;1,to=24;18)">
<p xmlns="http://www.w3.org/1999/xhtml" id="ratarith.en.definition6.CMP1.p1" class="ltx_p" about="#ratarith.en.definition6.CMP1.p1" stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=19;1,to=19;21)">The <omdoc:term cd="ratarith" name="division" role="definiendum" xml:id="ratarith.en.definition6.CMP1.p1.term1" about="#ratarith.en.definition6.CMP1.p1.term1" stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=19;57,to=20;24)">division</omdoc:term> operator computes the <omdoc:term cd="ratarith" name="quotient" role="definiendum" xml:id="ratarith.en.definition6.CMP1.p1.term2" about="#ratarith.en.definition6.CMP1.p1.term2" stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=19;19,to=20;62)">quotient</omdoc:term> <om:OMOBJ stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=19;8,to=20;78)"><om:OMA><om:OMS cd="ratarith" name="division"/><om:OMV name="&#x1D44E;"/><om:OMV name="&#x1D44F;"/></om:OMA></om:OMOBJ> of
<om:OMOBJ stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=20;78,to=21;31)"><om:OMA><om:OMS cd="set" name="inset"/><om:OMV name="&#x1D44E;"/><om:OMS cd="rationalnumbers" name="rational-number"/></om:OMA></om:OMOBJ> and <om:OMOBJ stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=20;46,to=21;63)"><om:OMA><om:OMS cd="set" name="inset"/><om:OMV name="&#x1D44F;"/><om:OMS cd="rationalnumbers" name="rational-number"/></om:OMA></om:OMOBJ>. On <om:OMOBJ stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=20;4,to=21;86)"><om:OMS cd="rationalnumbers" name="rational-number"/></om:OMOBJ> we
define
<om:OMOBJ stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=22;74,to=23;88)"><om:OMA><om:OMS cd="equal" name="equal"/><om:OMA><om:OMS cd="ratarith" name="division"/><om:OMA><om:OMS cd="arithmetics" name="division"/><om:OMV name="&#x1D44E;"/><om:OMV name="&#x1D44F;"/></om:OMA><om:OMA><om:OMS cd="arithmetics" name="division"/><om:OMV name="&#x1D450;"/><om:OMV name="&#x1D451;"/></om:OMA></om:OMA><om:OMA><om:OMS cd="arithmetics" name="division"/><om:OMA ic="variant:cdot"><om:OMS cd="ratarith" name="multiplication"/><om:OMV name="&#x1D44E;"/><om:OMV name="&#x1D450;"/></om:OMA><om:OMA ic="variant:cdot"><om:OMS cd="ratarith" name="multiplication"/><om:OMV name="&#x1D44F;"/><om:OMV name="&#x1D451;"/></om:OMA></om:OMA></om:OMA></om:OMOBJ>.</p></omdoc:CMP>
    </omdoc:definition>
    <omdoc:definition for="ratarith?base ratarith?exponent ratarith?exponentiation ratarith?power" xml:id="ratarith.en.definition7" about="#ratarith.en.definition7" stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=26;1,to=34;18)">
      <omdoc:CMP xml:id="ratarith.en.definition7.CMP1" about="#ratarith.en.definition7.CMP1" stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=26;1,to=34;18)">
<p xmlns="http://www.w3.org/1999/xhtml" id="ratarith.en.definition7.CMP1.p1" class="ltx_p" about="#ratarith.en.definition7.CMP1.p1" stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=26;23,to=27;45)"><omdoc:term cd="ratarith" name="exponentiation" role="definiendum" xml:id="ratarith.en.definition7.CMP1.p1.term1" about="#ratarith.en.definition7.CMP1.p1.term1" stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=26;23,to=27;45)">Exponentiation</omdoc:term>peration raises a number
<om:OMOBJ stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=27;58,to=28;31)"><om:OMA><om:OMS cd="set" name="inset"/><om:OMV name="&#x1D44E;"/><om:OMS cd="rationalnumbers" name="rational-number"/></om:OMA></om:OMOBJ> (the <omdoc:term cd="ratarith" name="base" role="definiendum" xml:id="ratarith.en.definition7.CMP1.p1.term3" about="#ratarith.en.definition7.CMP1.p1.term3" stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=27;20,to=28;49)">base</omdoc:term>) to the <omdoc:term cd="ratarith" name="power" role="definiendum" xml:id="ratarith.en.definition7.CMP1.p1.term4" about="#ratarith.en.definition7.CMP1.p1.term4" stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=28;1,to=28;70)">power</omdoc:term>
<om:OMOBJ stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=28;53,to=29;31)"><om:OMA><om:OMS cd="set" name="inset"/><om:OMV name="&#x1D45B;"/><om:OMS cd="rationalnumbers" name="rational-number"/></om:OMA></om:OMOBJ> (the <omdoc:term cd="ratarith" name="exponent" role="definiendum" xml:id="ratarith.en.definition7.CMP1.p1.term6" about="#ratarith.en.definition7.CMP1.p1.term6" stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=28;11,to=29;53)">exponent</omdoc:term>). We define</p>
<table xmlns="http://www.w3.org/1999/xhtml" id="S0.Ex1" class="ltx_equation ltx_eqn_table">

<tr class="ltx_equation ltx_eqn_row ltx_align_baseline">
<td class="ltx_eqn_cell ltx_eqn_center_padleft"/>
<td class="ltx_eqn_cell ltx_align_center"><om:OMOBJ stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=29;18,to=33;6)"><om:OMA><om:OMS cd="fundefeq" name="fundefeq"/><om:OMV name="&#x1D44E;"/><om:OMV name="&#x1D44F;"/><om:OMV name="&#x1D45B;"/><om:OMV name="&#x1D45A;"/><om:OMA><om:OMS cd="ratarith" name="exponentiation"/><om:OMA><om:OMS cd="arithmetics" name="division"/><om:OMV name="&#x1D44E;"/><om:OMV name="&#x1D44F;"/></om:OMA><om:OMA><om:OMS cd="arithmetics" name="division"/><om:OMV name="&#x1D45B;"/><om:OMV name="&#x1D45A;"/></om:OMA></om:OMA><om:OMA><om:OMS cd="arithmetics" name="division"/><om:OMA><om:OMS cd="intarith" name="root"/><om:OMV name="&#x1D45A;"/><om:OMA><om:OMS cd="intarith" name="exponentiation"/><om:OMV name="&#x1D44E;"/><om:OMV name="&#x1D45B;"/></om:OMA></om:OMA><om:OMA><om:OMS cd="intarith" name="root"/><om:OMV name="&#x1D45A;"/><om:OMA><om:OMS cd="intarith" name="exponentiation"/><om:OMV name="&#x1D44F;"/><om:OMV name="&#x1D45B;"/></om:OMA></om:OMA></om:OMA></om:OMA></om:OMOBJ></td>
<td class="ltx_eqn_cell ltx_eqn_center_padright"/></tr>
</table></omdoc:CMP>
    </omdoc:definition>
    <omdoc:definition xml:id="ratarith.en.definition8" about="#ratarith.en.definition8" stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=36;1,to=39;18)">
      <omdoc:CMP xml:id="ratarith.en.definition8.CMP1" about="#ratarith.en.definition8.CMP1" stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=36;1,to=39;18)">
<p xmlns="http://www.w3.org/1999/xhtml" id="ratarith.en.definition8.CMP1.p1" class="ltx_p" about="#ratarith.en.definition8.CMP1.p1" stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=36;1,to=36;21)">For <om:OMOBJ stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=36;69,to=37;35)"><om:OMA><om:OMS cd="set" name="inset"/><om:OMV name="&#x1D44F;"/><om:OMS cd="rationalnumbers" name="rational-number"/></om:OMA></om:OMOBJ>, <om:OMOBJ stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=36;40,to=37;64)"><om:OMA><om:OMS cd="set" name="inset"/><om:OMV name="&#x1D45F;"/><om:OMS cd="rationalnumbers" name="rational-number"/></om:OMA></om:OMOBJ> is a <om:OMOBJ stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=36;12,to=37;73)"><om:OMV name="&#x1D44F;"/></om:OMOBJ>-th root of
<om:OMOBJ stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=37;69,to=38;31)"><om:OMA><om:OMS cd="set" name="inset"/><om:OMV name="&#x1D44E;"/><om:OMS cd="rationalnumbers" name="rational-number"/></om:OMA></om:OMOBJ> (we write <om:OMOBJ stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=37;29,to=38;56)"><om:OMA><om:OMS cd="ratarith" name="root"/><om:OMV name="&#x1D44F;"/><om:OMV name="&#x1D44E;"/></om:OMA></om:OMOBJ>), if <om:OMOBJ stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=37;8,to=38;79)"><om:OMA><om:OMS cd="equal" name="equal"/><om:OMA><om:OMS cd="ratarith" name="exponentiation"/><om:OMV name="&#x1D45F;"/><om:OMV name="&#x1D44F;"/></om:OMA><om:OMV name="&#x1D44E;"/></om:OMA></om:OMOBJ>.</p></omdoc:CMP>
    </omdoc:definition>
  </omdoc:theory>
  <omdoc:bibliography files="local" xml:id="omdoc1.bibliography2" about="#omdoc1.bibliography2" stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=2;0,to=2;20)"/>
  <omdoc:index xml:id="omdoc1.index3" about="#omdoc1.index3" stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=3;1,to=3;12)"/>
</omdoc>

The output seems to be correct to me.

kohlhase commented 8 years ago

indeed, that looks good. I have just pushed a change to ratarith.en.tex, could you try again? I have added a [for=addition] on the first definition. This should show up as for="ratarith?addition" in the XML. If that is the case, please merge the branch and close the issue.

angerhang commented 8 years ago

It comes out as

    <omdoc:definition for="addition" xml:id="ratarith.en.definition3" about="#ratarith.en.definition3" stex:srcref="smglom/numberfields/source/ratarith.en.tex#textrange(from=2;0,to=6;18)">
kohlhase commented 8 years ago

hmmm, I guess that is good enough for now.