mathtype_to_mathml_plus 0.0.10 → 0.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +14 -14
  3. data/.rspec +2 -2
  4. data/.ruby-version +1 -1
  5. data/.travis.yml +3 -3
  6. data/Gemfile +6 -6
  7. data/LICENSE.txt +22 -22
  8. data/README.md +45 -45
  9. data/Rakefile +7 -7
  10. data/convert.rb +6 -6
  11. data/lib/mathtype_to_mathml_plus/char_replacer.rb +366 -366
  12. data/lib/mathtype_to_mathml_plus/mover.rb +151 -151
  13. data/lib/mathtype_to_mathml_plus/version.rb +3 -3
  14. data/lib/mathtype_to_mathml_plus.rb +37 -37
  15. data/lib/transform.xsl +54 -53
  16. data/lib/xsl/arrow.xsl +319 -319
  17. data/lib/xsl/box.xsl +42 -42
  18. data/lib/xsl/char.xsl +1858 -1854
  19. data/lib/xsl/embellishment.xsl +389 -389
  20. data/lib/xsl/fence.xsl +228 -228
  21. data/lib/xsl/fontmaps/ArialMT+1.xml +148 -148
  22. data/lib/xsl/fontmaps/Euclid_Extra.xml +68 -68
  23. data/lib/xsl/fontmaps/Euclid_Fraktur.xml +126 -126
  24. data/lib/xsl/fontmaps/Euclid_Math_One.xml +51 -51
  25. data/lib/xsl/fontmaps/Euclid_Math_Two.xml +72 -72
  26. data/lib/xsl/fontmaps/Euclid_Symbol.xml +33 -33
  27. data/lib/xsl/fontmaps/LICENSE +23 -23
  28. data/lib/xsl/fontmaps/Lucida_Bright_Math_Extension.xml +4 -4
  29. data/lib/xsl/fontmaps/Lucida_Bright_Math_Italic.xml +21 -21
  30. data/lib/xsl/fontmaps/Lucida_Bright_Math_Symbol.xml +23 -23
  31. data/lib/xsl/fontmaps/MT_Extra.xml +75 -75
  32. data/lib/xsl/fontmaps/MT_Symbol.xml +585 -585
  33. data/lib/xsl/fontmaps/Marlett.xml +4 -4
  34. data/lib/xsl/fontmaps/Math1.xml +422 -422
  35. data/lib/xsl/fontmaps/MathType_MTCode.xml +325 -325
  36. data/lib/xsl/fontmaps/Monotype_Sorts.xml +5 -5
  37. data/lib/xsl/fontmaps/Origin.xml +6 -6
  38. data/lib/xsl/fontmaps/README.md +54 -54
  39. data/lib/xsl/fontmaps/Symbol.xml +581 -581
  40. data/lib/xsl/fontmaps/Test.xml +18 -18
  41. data/lib/xsl/fontmaps/TimesNewRomanPSMT+1.xml +148 -148
  42. data/lib/xsl/fontmaps/UniversalMath1_BT.xml +5 -5
  43. data/lib/xsl/fontmaps/VDESONDE.xml +5 -5
  44. data/lib/xsl/fontmaps/WP_Greek_Century.xml +192 -192
  45. data/lib/xsl/fontmaps/WP_Greek_Courier.xml +190 -190
  46. data/lib/xsl/fontmaps/WP_Greek_Helve.xml +190 -190
  47. data/lib/xsl/fontmaps/WP_IconicSymbolsA.xml +8 -8
  48. data/lib/xsl/fontmaps/WP_MathA.xml +22 -22
  49. data/lib/xsl/fontmaps/Webdings.xml +678 -678
  50. data/lib/xsl/fontmaps/Wingdings.xml +678 -678
  51. data/lib/xsl/fontmaps/Wingdings_2.xml +660 -660
  52. data/lib/xsl/fontmaps/Wingdings_3.xml +633 -633
  53. data/lib/xsl/fontmaps/ZWAdobeF.xml +80 -80
  54. data/lib/xsl/fontmaps/schema/fontmap_symbols.rng +74 -74
  55. data/lib/xsl/fontmaps/xmlcatalog/catalog.xml +8 -8
  56. data/lib/xsl/frac.xsl +46 -46
  57. data/lib/xsl/identity.xsl +19 -19
  58. data/lib/xsl/int.xsl +622 -622
  59. data/lib/xsl/lim.xsl +32 -32
  60. data/lib/xsl/long_division.xsl +32 -32
  61. data/lib/xsl/long_embellishment.xsl +150 -150
  62. data/lib/xsl/map-fonts.xsl +131 -131
  63. data/lib/xsl/matrix.xsl +115 -115
  64. data/lib/xsl/pile.xsl +54 -54
  65. data/lib/xsl/product_coproduct.xsl +107 -107
  66. data/lib/xsl/root.xsl +23 -23
  67. data/lib/xsl/subsup.xsl +55 -55
  68. data/lib/xsl/sum.xsl +81 -81
  69. data/lib/xsl/union_intersection.xsl +104 -104
  70. data/lib/xsl/util/decToHex.xsl +24 -24
  71. data/lib/xsl/util/hexToDec.xsl +34 -34
  72. data/lib/xsl/util/symbol-map-base-uri-to-name.xsl +70 -70
  73. data/mathtype.log +25368 -25368
  74. data/mathtype_to_mathml.gemspec +30 -29
  75. data/oleObject1.bin +0 -0
  76. data/oleObject2.bin +0 -0
  77. data/oleObject3.bin +0 -0
  78. data/oleObject4.bin +0 -0
  79. data/oleObject5.bin +0 -0
  80. data/spec/fixtures/expected/280.xml +122 -122
  81. data/spec/fixtures/expected/281.xml +60 -60
  82. data/spec/fixtures/expected/299.xml +70 -70
  83. data/spec/fixtures/expected/326.xml +173 -173
  84. data/spec/fixtures/expected/424.xml +425 -425
  85. data/spec/fixtures/expected/450.xml +174 -174
  86. data/spec/fixtures/expected/452.xml +166 -166
  87. data/spec/fixtures/expected/478.xml +303 -303
  88. data/spec/fixtures/expected/629.xml +98 -98
  89. data/spec/fixtures/expected/arrows.xml +389 -389
  90. data/spec/fixtures/expected/boxes.xml +22 -22
  91. data/spec/fixtures/expected/embellishments.xml +178 -178
  92. data/spec/fixtures/expected/embellishments_roots_long_divisions.xml +162 -162
  93. data/spec/fixtures/expected/equation1.xml +52 -52
  94. data/spec/fixtures/expected/equation10.xml +19 -19
  95. data/spec/fixtures/expected/equation11.xml +17 -17
  96. data/spec/fixtures/expected/equation12.xml +34 -34
  97. data/spec/fixtures/expected/equation13.xml +113 -113
  98. data/spec/fixtures/expected/equation14.xml +54 -54
  99. data/spec/fixtures/expected/equation2.xml +33 -33
  100. data/spec/fixtures/expected/equation3.xml +324 -324
  101. data/spec/fixtures/expected/equation4.xml +14 -14
  102. data/spec/fixtures/expected/equation5.xml +23 -23
  103. data/spec/fixtures/expected/equation6.xml +13 -13
  104. data/spec/fixtures/expected/equation7.xml +19 -19
  105. data/spec/fixtures/expected/equation8.xml +17 -17
  106. data/spec/fixtures/expected/equation9.xml +15 -15
  107. data/spec/fixtures/expected/fences.xml +64 -64
  108. data/spec/fixtures/expected/integrals.xml +264 -264
  109. data/spec/fixtures/expected/matrices.xml +253 -253
  110. data/spec/fixtures/expected/sums.xml +36 -36
  111. data/spec/fixtures/expected/unions_and_intersections.xml +140 -140
  112. data/spec/fixtures/input/281.bin +0 -0
  113. data/spec/fixtures/input/424.bin +0 -0
  114. data/spec/fixtures/input/arrows.bin +0 -0
  115. data/spec/fixtures/input/boxes.bin +0 -0
  116. data/spec/fixtures/input/embellishments.bin +0 -0
  117. data/spec/fixtures/input/embellishments_roots_long_divisions.bin +0 -0
  118. data/spec/fixtures/input/equation1.bin +0 -0
  119. data/spec/fixtures/input/equation10.bin +0 -0
  120. data/spec/fixtures/input/equation11.bin +0 -0
  121. data/spec/fixtures/input/equation12.bin +0 -0
  122. data/spec/fixtures/input/equation13.bin +0 -0
  123. data/spec/fixtures/input/equation14.bin +0 -0
  124. data/spec/fixtures/input/equation2.bin +0 -0
  125. data/spec/fixtures/input/equation3.bin +0 -0
  126. data/spec/fixtures/input/equation4.bin +0 -0
  127. data/spec/fixtures/input/equation5.bin +0 -0
  128. data/spec/fixtures/input/equation6.bin +0 -0
  129. data/spec/fixtures/input/equation7.bin +0 -0
  130. data/spec/fixtures/input/equation8.bin +0 -0
  131. data/spec/fixtures/input/equation9.bin +0 -0
  132. data/spec/fixtures/input/fences.bin +0 -0
  133. data/spec/fixtures/input/integrals.bin +0 -0
  134. data/spec/fixtures/input/matrices.bin +0 -0
  135. data/spec/fixtures/input/sums.bin +0 -0
  136. data/spec/fixtures/input/unions_and_intersections.bin +0 -0
  137. data/spec/html_output.rb +28 -28
  138. data/spec/mathtype_to_mathml_spec.rb +16 -16
  139. data/spec/spec_helper.rb +4 -4
  140. metadata +7 -7
  141. data/mathtype_to_mathml-0.0.7.gem +0 -0
  142. data/mathtype_to_mathml-0.0.8.gem +0 -0
  143. data/mathtype_to_mathml_plus-0.0.8.gem +0 -0
  144. data/mathtype_to_mathml_plus-0.0.9.gem +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eda49ad57386951bf0dd37e24bb241861f47409c396a160bfdd2eb3a092a171f
4
- data.tar.gz: f750fdb625827242fc022056c35dbe269f9f1a07c2864520392f7528c76bc4c0
3
+ metadata.gz: 85cd0eb5c630726efb03ca85bd1335c1774c5dafbd375d91d443301c68dacee0
4
+ data.tar.gz: 5521407466e6e3499f9be4e2c3120bfcb4b37ffc10b0aabc2bddd5059e2e442f
5
5
  SHA512:
6
- metadata.gz: 3db4d404107d8a392ff2f623a3b4d18b8b1f4ab57ce74010df62515687371d073423ee3e026e73a5fe3116b46b90084f27ff5f4c821ad14962296631604e045f
7
- data.tar.gz: 0c275cc5b834b3539e28ffc4546860ceb976382a22387148e8f5224af045593b7d5728afd295319a0cd84ea74a0f4a1020ea0c2aa747a0d05717aa88cd15fcf7
6
+ metadata.gz: 683bfd2ecb5f2e4581360d65ccb90d6b409b2b2c8923d1ebde7bd136ccaf8af2579fb8335bae069255ca9e671da0885304c3e93ef2d21400d0f49ec53d41ed89
7
+ data.tar.gz: 87e7fef3002301d52e2b442c11e2087738350961f1f4503d2c6fa85604d1a92fc99ea360a943e77dd790db0ccda56d24272251058f113bba65f0e026be1614cf
data/.gitignore CHANGED
@@ -1,14 +1,14 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
10
- *.bundle
11
- *.so
12
- *.o
13
- *.a
14
- mkmf.log
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/.rspec CHANGED
@@ -1,2 +1,2 @@
1
- --format documentation
2
- --color
1
+ --format documentation
2
+ --color
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.2.2
1
+ 3.4.4
data/.travis.yml CHANGED
@@ -1,3 +1,3 @@
1
- language: ruby
2
- rvm:
3
- - 2.2.2
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.2
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
-
2
- source 'https://rubygems.org'
3
-
4
- # Specify your gem's dependencies in mathtype_to_mathml.gemspec
5
-
6
- gemspec
1
+
2
+ source 'https://rubygems.org'
3
+
4
+ # Specify your gem's dependencies in mathtype_to_mathml.gemspec
5
+
6
+ gemspec
data/LICENSE.txt CHANGED
@@ -1,22 +1,22 @@
1
- Copyright (c) 2015 Jure Triglav
2
-
3
- MIT License
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ Copyright (c) 2015 Jure Triglav
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,45 +1,45 @@
1
- # MathTypeToMathMLPlus
2
-
3
- This gem can be used to convert MathType equations from a binary format (e.g. embedded in Word documents) to an open MathML representation. It achieves that in several stages, first using the [`mathtype`](https://github.com/jure/mathtype) gem to convert from a binary to an XML form of MTEF, and second, using XSLTs to convert XML to MathML.
4
-
5
- ## Installation
6
-
7
- Add this line to your application's Gemfile:
8
-
9
- ```ruby
10
- gem 'mathtype_to_mathml_plus'
11
- ```
12
-
13
- And then execute:
14
-
15
- $ bundle
16
-
17
- Or install it yourself as:
18
-
19
- $ gem install mathtype_to_mathml_plus
20
-
21
- ## Usage
22
-
23
- To convert a MathType equation embedded in a Word document (the file is usually named something like `oleObject1.bin`):
24
-
25
- ```
26
- mathml = MathTypeToMathMLPlus::Converter.new(`oleObject1.bin`).convert
27
- ```
28
-
29
- This will return a MathML string of the MathType equation.
30
-
31
- # Testing
32
-
33
- Run `bundle exec rspec` to run specs. Additionally, you can create a visual output using `html_output.rb`, like so:
34
-
35
- ```
36
- bundle exec ruby spec/html_output.rb > test.html
37
- ```
38
-
39
- ## Contributing
40
-
41
- 1. Fork it ( https://github.com/jure/mathtype_to_mathml/fork )
42
- 2. Create your feature branch (`git checkout -b my-new-feature`)
43
- 3. Commit your changes (`git commit -am 'Add some feature'`)
44
- 4. Push to the branch (`git push origin my-new-feature`)
45
- 5. Create a new Pull Request
1
+ # MathTypeToMathMLPlus
2
+
3
+ This gem can be used to convert MathType equations from a binary format (e.g. embedded in Word documents) to an open MathML representation. It achieves that in several stages, first using the [`mathtype`](https://github.com/jure/mathtype) gem to convert from a binary to an XML form of MTEF, and second, using XSLTs to convert XML to MathML.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'mathtype_to_mathml_plus'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install mathtype_to_mathml_plus
20
+
21
+ ## Usage
22
+
23
+ To convert a MathType equation embedded in a Word document (the file is usually named something like `oleObject1.bin`):
24
+
25
+ ```
26
+ mathml = MathTypeToMathMLPlus::Converter.new(`oleObject1.bin`).convert
27
+ ```
28
+
29
+ This will return a MathML string of the MathType equation.
30
+
31
+ # Testing
32
+
33
+ Run `bundle exec rspec` to run specs. Additionally, you can create a visual output using `html_output.rb`, like so:
34
+
35
+ ```
36
+ bundle exec ruby spec/html_output.rb > test.html
37
+ ```
38
+
39
+ ## Contributing
40
+
41
+ 1. Fork it ( https://github.com/jure/mathtype_to_mathml/fork )
42
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
43
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
44
+ 4. Push to the branch (`git push origin my-new-feature`)
45
+ 5. Create a new Pull Request
data/Rakefile CHANGED
@@ -1,7 +1,7 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
3
-
4
- RSpec::Core::RakeTask.new(:spec)
5
-
6
- task :default => :spec
7
-
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
7
+
data/convert.rb CHANGED
@@ -1,6 +1,6 @@
1
- require_relative 'lib/mathtype_to_mathml_plus'
2
-
3
- converter = MathTypeToMathMLPlus::Converter.new("oleObject1.bin")
4
- xml = converter.convert
5
-
6
- puts xml
1
+ require_relative 'lib/mathtype_to_mathml_plus'
2
+
3
+ converter = MathTypeToMathMLPlus::Converter.new("oleObject2.bin")
4
+ xml = converter.convert
5
+
6
+ puts xml