Skip to content

Commit

Permalink
samples and tools
Browse files Browse the repository at this point in the history
  • Loading branch information
zorkow committed May 2, 2024
1 parent cc2b5ef commit 89ed78a
Show file tree
Hide file tree
Showing 17 changed files with 455 additions and 0 deletions.
1 change: 1 addition & 0 deletions samples/abs_det01.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<math><mrow><mrow><mo>|</mo><mrow><mtable><mtr><mtd><mn>2</mn></mtd><mtd><mn>1</mn></mtd></mtr><mtr><mtd><mn>7</mn></mtd><mtd><mn>5</mn></mtd></mtr></mtable></mrow><mo>|</mo></mrow></mrow></math>
26 changes: 26 additions & 0 deletions samples/matrix1.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mstyle displaystyle="true" scriptlevel="0">
<mrow>
<mo>(</mo>
<mtable rowspacing="4pt" columnspacing="1em">
<mtr>
<mtd>
<mi>a</mi>
</mtd>
<mtd>
<mi>b</mi>
</mtd>
</mtr>
<mtr>
<mtd>
<mi>c</mi>
</mtd>
<mtd>
<mi>d</mi>
</mtd>
</mtr>
</mtable>
<mo>)</mo>
</mrow>
</mstyle>
</math>
26 changes: 26 additions & 0 deletions samples/matrix2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mstyle displaystyle="true" scriptlevel="0">
<mrow>
<mo>|</mo>
<mtable rowspacing="4pt" columnspacing="1em">
<mtr>
<mtd>
<mi>a</mi>
</mtd>
<mtd>
<mi>b</mi>
</mtd>
</mtr>
<mtr>
<mtd>
<mi>c</mi>
</mtd>
<mtd>
<mi>d</mi>
</mtd>
</mtr>
</mtable>
<mo>|</mo>
</mrow>
</mstyle>
</math>
26 changes: 26 additions & 0 deletions samples/matrix3.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mstyle displaystyle="true" scriptlevel="0">
<mrow>
<mo>[</mo>
<mtable rowspacing="4pt" columnspacing="1em">
<mtr>
<mtd>
<mi>a</mi>
</mtd>
<mtd>
<mi>b</mi>
</mtd>
</mtr>
<mtr>
<mtd>
<mi>c</mi>
</mtd>
<mtd>
<mi>d</mi>
</mtd>
</mtr>
</mtable>
<mo>]</mo>
</mrow>
</mstyle>
</math>
26 changes: 26 additions & 0 deletions samples/matrix4.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mstyle displaystyle="true" scriptlevel="0">
<mrow>
<mo symmetric="true">&#x2016;</mo>
<mtable columnalign="center center" rowspacing="4pt" columnspacing="1em">
<mtr>
<mtd>
<mi>a</mi>
</mtd>
<mtd>
<mi>b</mi>
</mtd>
</mtr>
<mtr>
<mtd>
<mi>c</mi>
</mtd>
<mtd>
<mi>d</mi>
</mtd>
</mtr>
</mtable>
<mo symmetric="true">&#x2016;</mo>
</mrow>
</mstyle>
</math>
2 changes: 2 additions & 0 deletions samples/nested_frac.mml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

<math><mrow><mfrac><mrow><mfrac><mrow><mi>x</mi><mo>+</mo><mn>1</mn></mrow><mrow><mi>x</mi><mo>−</mo><mn>4</mn></mrow></mfrac><mo>+</mo><mfrac><mn>1</mn><mn>2</mn></mfrac></mrow><mrow><mi>x</mi><mo>+</mo><mfrac><mn>1</mn><mrow><mn>16</mn></mrow></mfrac></mrow></mfrac></mrow></math>
1 change: 1 addition & 0 deletions samples/simons/mfemced1.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<math><mfenced close=""><mrow/><mi>a</mi><mrow/></mfenced></math>
1 change: 1 addition & 0 deletions samples/simons/mfenced3.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<math><mfenced><mrow/><mrow/><mrow/></mfenced></math>
1 change: 1 addition & 0 deletions samples/simons/mrow-exp1-short.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<math><mrow><mi>y</mi><mo>=</mo><mo>(</mo><msup><mrow><mo/><mi>x</mi></mrow><mrow><mn>2</mn></mrow></msup><mo>+</mo><mn>1</mn><mrow><mo>)</mo><mo>(</mo><msup><mrow><mi>x</mi></mrow><mrow><mn>2</mn></mrow></msup></mrow><mo>+</mo><mn>3</mn><mo>)</mo></mrow></math>
33 changes: 33 additions & 0 deletions samples/simons/mrow-exp1.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<math>
<mrow>
<mi>y</mi>
<mo>=</mo>
<mo>(</mo>
<msup>
<mrow>
<mo/>
<mi>x</mi>
</mrow>
<mrow>
<mn>2</mn>
</mrow>
</msup>
<mo>+</mo>
<mn>1</mn>
<mrow>
<mo>)</mo>
<mo>(</mo>
<msup>
<mrow>
<mi>x</mi>
</mrow>
<mrow>
<mn>2</mn>
</mrow>
</msup>
</mrow>
<mo>+</mo>
<mn>3</mn>
<mo>)</mo>
</mrow>
</math>
1 change: 1 addition & 0 deletions samples/simons/mrow-exp2-short.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<math><mrow><mi mathvariant="sans-serif">E</mi><mfenced open="(" close=")"><mrow><munder><mrow><mo stretchy="true">&#x2211;</mo></mrow><mrow><mi>I</mi><mo>&#x2208;</mo><msub><mrow><mi>E</mi></mrow><mrow><mi>k</mi><mo>+</mo><mn>1</mn></mrow></msub></mrow></munder><mo>&#x007C;</mo><mi>I</mi><msup><mrow><mo>&#x007C;</mo></mrow><mrow><mi>s</mi></mrow></msup></mrow></mfenced><mo>=</mo><mi mathvariant="sans-serif">E</mi><mfenced open="(" close=")"><mrow><munder><mrow><mo stretchy="true">&#x2211;</mo></mrow><mrow><mi>I</mi><mo>&#x2208;</mo><msub><mrow><mi>E</mi></mrow><mrow><mi>k</mi></mrow></msub></mrow></munder><mo>&#x007C;</mo><mi>I</mi><msup><mrow><mo>&#x007C;</mo></mrow><mrow><mi>s</mi></mrow></msup></mrow></mfenced><mi mathvariant="sans-serif">E</mi><mo stretchy="false">(</mo><msubsup><mrow><mi>R</mi></mrow><mrow><mn>1</mn></mrow><mrow><mi>s</mi></mrow></msubsup><mo>+</mo><msubsup><mrow><mi>R</mi></mrow><mrow><mn>2</mn></mrow><mrow><mi>s</mi></mrow></msubsup><mo stretchy="false">)</mo><mo>.</mo></mrow></math>
98 changes: 98 additions & 0 deletions samples/simons/mrow-exp2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<math>
<mrow>
<mi mathvariant="sans-serif">E</mi>
<mfenced open="(" close=")">
<mrow>
<munder>
<mrow>
<mo stretchy="true">&#x2211;</mo>
</mrow>
<mrow>
<mi>I</mi>
<mo>&#x2208;</mo>
<msub>
<mrow>
<mi>E</mi>
</mrow>
<mrow>
<mi>k</mi>
<mo>+</mo>
<mn>1</mn>
</mrow>
</msub>
</mrow>
</munder>
<mo>&#x007C;</mo>
<mi>I</mi>
<msup>
<mrow>
<mo>&#x007C;</mo>
</mrow>
<mrow>
<mi>s</mi>
</mrow>
</msup>
</mrow>
</mfenced>
<mo>=</mo>
<mi mathvariant="sans-serif">E</mi>
<mfenced open="(" close=")">
<mrow>
<munder>
<mrow>
<mo stretchy="true">&#x2211;</mo>
</mrow>
<mrow>
<mi>I</mi>
<mo>&#x2208;</mo>
<msub>
<mrow>
<mi>E</mi>
</mrow>
<mrow>
<mi>k</mi>
</mrow>
</msub>
</mrow>
</munder>
<mo>&#x007C;</mo>
<mi>I</mi>
<msup>
<mrow>
<mo>&#x007C;</mo>
</mrow>
<mrow>
<mi>s</mi>
</mrow>
</msup>
</mrow>
</mfenced>
<mi mathvariant="sans-serif">E</mi>
<mo stretchy="false">(</mo>
<msubsup>
<mrow>
<mi>R</mi>
</mrow>
<mrow>
<mn>1</mn>
</mrow>
<mrow>
<mi>s</mi>
</mrow>
</msubsup>
<mo>+</mo>
<msubsup>
<mrow>
<mi>R</mi>
</mrow>
<mrow>
<mn>2</mn>
</mrow>
<mrow>
<mi>s</mi>
</mrow>
</msubsup>
<mo stretchy="false">)</mo>
<mo>.</mo>
</mrow>
</math>
1 change: 1 addition & 0 deletions samples/simons/mrow-exp3-short.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<math><msub><mo>\u222B</mo><mi>X</mi></msub><mrow><msub><mo>\u2211</mo><mi>Y</mi></msub><mi>a</mi></mrow><mi>dx</mi></math>
1 change: 1 addition & 0 deletions samples/simons/xfenced2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<math><mfenced><mrow/><mi>a</mi><mrow/></mfenced></math>
78 changes: 78 additions & 0 deletions tools/misc/mj-diff.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#! /bin/bash

mj=/home/sorge/git/MathJax/MathJax-src/ts/
sre=/home/sorge/git/sre/speech-rule-engine/ts/latex/

mjtree=$mj"core/Tree"
sretree=$sre"core/Tree"

mjmmltree=$mj"core/MmlTree"
sremmltree=$sre"core/MmlTree"

mjmmlnodes=$mj"core/MmlNodes"
sremmlnodes=$sre"core/MmlNodes"

mjparser=$mj"input/tex"
sreparser=$sre"parser"

mjbase=$mj"input/tex/base"
srebase=$sre"parser/base"

mjams=$mj"input/tex/ams"
sreams=$sre"parser/ams"

mjutil=$mj"util"
sreutil=$sre"util"

compare() {
files=`ls $1/*.ts`
for file in $files; do
base=`basename $file`
echo emacs $file $2/$basename
diff $file $2/$basename
done
}

echo MJ TREE
compare $sretree $mjtree
echo
echo MJ MMLTREE
compare $sremmltree $mjmmltree
echo
echo MJ MMLNODES
compare $sremmlnodes $mjmmlnodes
echo
echo MJ PARSER
compare $sreparser $mjparser
echo
echo MJ BASE
compare $srebase $mjbase
echo
echo MJ AMS
compare $sreams $mjams
echo
echo MJ UTIL
compare $sreutil $mjutil
echo

exit 0

ls -R $mjcore
echo SRE CORE
ls -R $srecore

echo MJ PARSER
ls -R $mjparser
echo
echo SRE PARSER
ls -R $sreparser

echo MJ UTIL
ls -R $mjutil
echo
echo SRE UTIL
ls -R $sreutil



# diff $sre$1 $mj$2
Loading

0 comments on commit 89ed78a

Please sign in to comment.