mathtype 0.0.8 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -0
  3. data/.travis.yml +7 -0
  4. data/Rakefile +8 -0
  5. data/lib/file_parser/ole.rb +15 -0
  6. data/lib/file_parser/parser.rb +19 -0
  7. data/lib/file_parser/wmf.rb +28 -0
  8. data/lib/mathtype.rb +30 -7
  9. data/lib/mathtype/version.rb +1 -1
  10. data/lib/records/bintypes.rb +18 -0
  11. data/lib/records/mtef.rb +8 -114
  12. data/lib/records/nudge.rb +9 -5
  13. data/lib/records/ruler.rb +1 -1
  14. data/lib/records/typesizes.rb +5 -10
  15. data/lib/records3/char.rb +53 -0
  16. data/lib/records3/embell.rb +109 -0
  17. data/lib/records3/font.rb +27 -0
  18. data/lib/records3/line.rb +47 -0
  19. data/lib/records3/matrix.rb +80 -0
  20. data/lib/records3/mtef.rb +97 -0
  21. data/lib/records3/options.rb +5 -0
  22. data/lib/records3/pile.rb +43 -0
  23. data/lib/records3/size.rb +75 -0
  24. data/lib/records3/snapshot.rb +19 -0
  25. data/lib/records3/tmpl.rb +751 -0
  26. data/lib/{records → records5}/char.rb +6 -12
  27. data/lib/{records → records5}/color.rb +1 -1
  28. data/lib/{records → records5}/color_def.rb +8 -8
  29. data/lib/{records → records5}/embell.rb +2 -2
  30. data/lib/{records → records5}/encoding_def.rb +1 -1
  31. data/lib/{records → records5}/eqn_prefs.rb +2 -2
  32. data/lib/{records → records5}/font_def.rb +1 -1
  33. data/lib/{records → records5}/font_style_def.rb +1 -1
  34. data/lib/{records → records5}/future.rb +1 -1
  35. data/lib/{records → records5}/line.rb +3 -3
  36. data/lib/{records → records5}/matrix.rb +11 -3
  37. data/lib/records5/mtef.rb +129 -0
  38. data/lib/{records → records5}/pile.rb +2 -2
  39. data/lib/{records → records5}/size.rb +9 -7
  40. data/lib/records5/snapshot.rb +19 -0
  41. data/lib/{records → records5}/tmpl.rb +2 -2
  42. data/spec/fixtures/expected/mathtype3/ceil.xml +38 -0
  43. data/spec/fixtures/expected/mathtype3/fence.xml +77 -0
  44. data/spec/fixtures/expected/mathtype3/floor.xml +38 -0
  45. data/spec/fixtures/expected/mathtype3/frac.xml +136 -0
  46. data/spec/fixtures/expected/mathtype3/large_nudge.xml +135 -0
  47. data/spec/fixtures/expected/mathtype3/lim_embell.xml +247 -0
  48. data/spec/fixtures/expected/mathtype3/matrix_2x1.xml +500 -0
  49. data/spec/fixtures/expected/mathtype3/pile.xml +188 -0
  50. data/spec/fixtures/expected/mathtype3/sigma_subsup.xml +46 -0
  51. data/spec/fixtures/expected/mathtype3/small_nudge.xml +90 -0
  52. data/spec/fixtures/expected/mathtype3/sqrt.xml +132 -0
  53. data/spec/fixtures/expected/{299.xml → mathtype5/299.xml} +30 -15
  54. data/spec/fixtures/expected/{arrows.xml → mathtype5/arrows.xml} +30 -15
  55. data/spec/fixtures/expected/{embedded.xml → mathtype5/embedded.xml} +29 -14
  56. data/spec/fixtures/expected/{embellishments.xml → mathtype5/embellishments.xml} +30 -15
  57. data/spec/fixtures/expected/{equation1.xml → mathtype5/equation1.xml} +30 -15
  58. data/spec/fixtures/expected/{equation10.xml → mathtype5/equation10.xml} +30 -15
  59. data/spec/fixtures/expected/{equation11.xml → mathtype5/equation11.xml} +30 -15
  60. data/spec/fixtures/expected/{equation12.xml → mathtype5/equation12.xml} +30 -15
  61. data/spec/fixtures/expected/{equation13.xml → mathtype5/equation13.xml} +30 -15
  62. data/spec/fixtures/expected/{equation2.xml → mathtype5/equation2.xml} +30 -15
  63. data/spec/fixtures/expected/{equation3.xml → mathtype5/equation3.xml} +30 -15
  64. data/spec/fixtures/expected/{equation4.xml → mathtype5/equation4.xml} +30 -15
  65. data/spec/fixtures/expected/{equation5.xml → mathtype5/equation5.xml} +30 -15
  66. data/spec/fixtures/expected/{equation6.xml → mathtype5/equation6.xml} +30 -15
  67. data/spec/fixtures/expected/{equation7.xml → mathtype5/equation7.xml} +30 -15
  68. data/spec/fixtures/expected/{equation8.xml → mathtype5/equation8.xml} +30 -15
  69. data/spec/fixtures/expected/{equation9.xml → mathtype5/equation9.xml} +30 -15
  70. data/spec/fixtures/expected/{fences.xml → mathtype5/fences.xml} +30 -15
  71. data/spec/fixtures/expected/{integrals.xml → mathtype5/integrals.xml} +30 -15
  72. data/spec/fixtures/expected/mathtype5/matrix-border.xml +365 -0
  73. data/spec/fixtures/expected/mathtype5/matrix.xml +382 -0
  74. data/spec/fixtures/expected/{sizes.xml → mathtype5/sizes.xml} +30 -15
  75. data/spec/fixtures/input/mathtype3/ceil.bin +0 -0
  76. data/spec/fixtures/input/mathtype3/fence.bin +0 -0
  77. data/spec/fixtures/input/mathtype3/floor.bin +0 -0
  78. data/spec/fixtures/input/mathtype3/frac.bin +0 -0
  79. data/spec/fixtures/input/mathtype3/large_nudge.bin +0 -0
  80. data/spec/fixtures/input/mathtype3/lim_embell.bin +0 -0
  81. data/spec/fixtures/input/mathtype3/matrix_2x1.bin +0 -0
  82. data/spec/fixtures/input/mathtype3/pile.bin +0 -0
  83. data/spec/fixtures/input/mathtype3/sigma_subsup.bin +0 -0
  84. data/spec/fixtures/input/mathtype3/small_nudge.bin +0 -0
  85. data/spec/fixtures/input/mathtype3/sqrt.bin +0 -0
  86. data/spec/fixtures/input/{299.bin → mathtype5/299.bin} +0 -0
  87. data/spec/fixtures/input/{arrows.bin → mathtype5/arrows.bin} +0 -0
  88. data/spec/fixtures/input/{embedded.bin → mathtype5/embedded.bin} +0 -0
  89. data/spec/fixtures/input/{embellishments.bin → mathtype5/embellishments.bin} +0 -0
  90. data/spec/fixtures/input/{equation1.bin → mathtype5/equation1.bin} +0 -0
  91. data/spec/fixtures/input/{equation10.bin → mathtype5/equation10.bin} +0 -0
  92. data/spec/fixtures/input/{equation11.bin → mathtype5/equation11.bin} +0 -0
  93. data/spec/fixtures/input/{equation12.bin → mathtype5/equation12.bin} +0 -0
  94. data/spec/fixtures/input/{equation13.bin → mathtype5/equation13.bin} +0 -0
  95. data/spec/fixtures/input/{equation2.bin → mathtype5/equation2.bin} +0 -0
  96. data/spec/fixtures/input/{equation3.bin → mathtype5/equation3.bin} +0 -0
  97. data/spec/fixtures/input/{equation4.bin → mathtype5/equation4.bin} +0 -0
  98. data/spec/fixtures/input/{equation5.bin → mathtype5/equation5.bin} +0 -0
  99. data/spec/fixtures/input/{equation6.bin → mathtype5/equation6.bin} +0 -0
  100. data/spec/fixtures/input/{equation7.bin → mathtype5/equation7.bin} +0 -0
  101. data/spec/fixtures/input/{equation8.bin → mathtype5/equation8.bin} +0 -0
  102. data/spec/fixtures/input/{equation9.bin → mathtype5/equation9.bin} +0 -0
  103. data/spec/fixtures/input/{fences.bin → mathtype5/fences.bin} +0 -0
  104. data/spec/fixtures/input/{integrals.bin → mathtype5/integrals.bin} +0 -0
  105. data/spec/fixtures/input/mathtype5/matrix-border.bin +0 -0
  106. data/spec/fixtures/input/mathtype5/matrix.bin +0 -0
  107. data/spec/fixtures/input/{sizes.bin → mathtype5/sizes.bin} +0 -0
  108. data/spec/mathtype_spec.rb +11 -9
  109. data/test-mathtype.rb +2 -0
  110. metadata +168 -97
@@ -0,0 +1,188 @@
1
+ <?xml version="1.0"?>
2
+ <root>
3
+ <mtef>
4
+ <mtef_version>3</mtef_version>
5
+ <platform>1</platform>
6
+ <product>1</product>
7
+ <product_version>3</product_version>
8
+ <product_subversion>10</product_subversion>
9
+ <full/>
10
+ <pile>
11
+ <options>0</options>
12
+ <halign>left</halign>
13
+ <valign>center_baseline</valign>
14
+ <slot>
15
+ <options>0</options>
16
+ <font>
17
+ <options>0</options>
18
+ <name>Arial Narrow</name>
19
+ <typeface>131</typeface>
20
+ <style>2</style>
21
+ </font>
22
+ <char>
23
+ <options>0</options>
24
+ <typeface>253</typeface>
25
+ <mt_code_value>0x0061</mt_code_value>
26
+ </char>
27
+ <char>
28
+ <options>0</options>
29
+ <typeface>6</typeface>
30
+ <mt_code_value>0x002B</mt_code_value>
31
+ </char>
32
+ <char>
33
+ <options>1</options>
34
+ <typeface>3</typeface>
35
+ <mt_code_value>0x0063</mt_code_value>
36
+ </char>
37
+ <char>
38
+ <options>0</options>
39
+ <typeface>6</typeface>
40
+ <mt_code_value>0x002B</mt_code_value>
41
+ </char>
42
+ <tmpl>
43
+ <options>0</options>
44
+ <selector>tmROOT</selector>
45
+ <variation>tvROOT_SQ</variation>
46
+ <template_specific_options>0</template_specific_options>
47
+ <slot>
48
+ <options>0</options>
49
+ <char>
50
+ <options>1</options>
51
+ <typeface>3</typeface>
52
+ <mt_code_value>0x0062</mt_code_value>
53
+ </char>
54
+ <sub/>
55
+ <char>
56
+ <options>8</options>
57
+ <nudge>
58
+ <dx>-256</dx>
59
+ <dy>-96</dy>
60
+ </nudge>
61
+ <typeface>8</typeface>
62
+ <mt_code_value>0x0032</mt_code_value>
63
+ </char>
64
+ <full/>
65
+ <char>
66
+ <options>0</options>
67
+ <typeface>6</typeface>
68
+ <mt_code_value>0x002B</mt_code_value>
69
+ </char>
70
+ <char>
71
+ <options>1</options>
72
+ <typeface>3</typeface>
73
+ <mt_code_value>0x0066</mt_code_value>
74
+ </char>
75
+ <sub/>
76
+ <char>
77
+ <options>8</options>
78
+ <nudge>
79
+ <dx>-256</dx>
80
+ <dy>-96</dy>
81
+ </nudge>
82
+ <typeface>8</typeface>
83
+ <mt_code_value>0x0032</mt_code_value>
84
+ </char>
85
+ <end/>
86
+ </slot>
87
+ <slot>
88
+ <options>1</options>
89
+ </slot>
90
+ <end/>
91
+ </tmpl>
92
+ <end/>
93
+ </slot>
94
+ <full/>
95
+ <slot>
96
+ <options>0</options>
97
+ <char>
98
+ <options>0</options>
99
+ <typeface>6</typeface>
100
+ <mt_code_value>0x002B</mt_code_value>
101
+ </char>
102
+ <tmpl>
103
+ <options>0</options>
104
+ <selector>tmROOT</selector>
105
+ <variation>tvROOT_SQ</variation>
106
+ <template_specific_options>0</template_specific_options>
107
+ <slot>
108
+ <options>0</options>
109
+ <char>
110
+ <options>0</options>
111
+ <typeface>2</typeface>
112
+ <mt_code_value>0x0028</mt_code_value>
113
+ </char>
114
+ <char>
115
+ <options>0</options>
116
+ <typeface>253</typeface>
117
+ <mt_code_value>0x0061</mt_code_value>
118
+ </char>
119
+ <char>
120
+ <options>0</options>
121
+ <typeface>6</typeface>
122
+ <mt_code_value>0x2212</mt_code_value>
123
+ </char>
124
+ <char>
125
+ <options>1</options>
126
+ <typeface>3</typeface>
127
+ <mt_code_value>0x0063</mt_code_value>
128
+ </char>
129
+ <char>
130
+ <options>0</options>
131
+ <typeface>6</typeface>
132
+ <mt_code_value>0x2212</mt_code_value>
133
+ </char>
134
+ <char>
135
+ <options>1</options>
136
+ <typeface>3</typeface>
137
+ <mt_code_value>0x0066</mt_code_value>
138
+ </char>
139
+ <char>
140
+ <options>0</options>
141
+ <typeface>2</typeface>
142
+ <mt_code_value>0x0029</mt_code_value>
143
+ </char>
144
+ <sub/>
145
+ <char>
146
+ <options>8</options>
147
+ <nudge>
148
+ <dx>-256</dx>
149
+ <dy>-96</dy>
150
+ </nudge>
151
+ <typeface>8</typeface>
152
+ <mt_code_value>0x0032</mt_code_value>
153
+ </char>
154
+ <full/>
155
+ <char>
156
+ <options>0</options>
157
+ <typeface>6</typeface>
158
+ <mt_code_value>0x002B</mt_code_value>
159
+ </char>
160
+ <char>
161
+ <options>1</options>
162
+ <typeface>3</typeface>
163
+ <mt_code_value>0x0062</mt_code_value>
164
+ </char>
165
+ <sub/>
166
+ <char>
167
+ <options>8</options>
168
+ <nudge>
169
+ <dx>-256</dx>
170
+ <dy>-96</dy>
171
+ </nudge>
172
+ <typeface>8</typeface>
173
+ <mt_code_value>0x0032</mt_code_value>
174
+ </char>
175
+ <end/>
176
+ </slot>
177
+ <slot>
178
+ <options>1</options>
179
+ </slot>
180
+ <end/>
181
+ </tmpl>
182
+ <end/>
183
+ </slot>
184
+ <end/>
185
+ </pile>
186
+ <end/>
187
+ </mtef>
188
+ </root>
@@ -0,0 +1,46 @@
1
+ <?xml version="1.0"?>
2
+ <root>
3
+ <mtef>
4
+ <mtef_version>3</mtef_version>
5
+ <platform>1</platform>
6
+ <product>1</product>
7
+ <product_version>3</product_version>
8
+ <product_subversion>10</product_subversion>
9
+ <full/>
10
+ <slot>
11
+ <options>0</options>
12
+ <char>
13
+ <options>0</options>
14
+ <typeface>4</typeface>
15
+ <mt_code_value>0x03B4</mt_code_value>
16
+ </char>
17
+ <tmpl>
18
+ <options>0</options>
19
+ <selector>tmSUBSUP</selector>
20
+ <template_specific_options>0</template_specific_options>
21
+ <sub/>
22
+ <slot>
23
+ <options>0</options>
24
+ <char>
25
+ <options>1</options>
26
+ <typeface>3</typeface>
27
+ <mt_code_value>0x006A</mt_code_value>
28
+ </char>
29
+ <end/>
30
+ </slot>
31
+ <slot>
32
+ <options>0</options>
33
+ <char>
34
+ <options>0</options>
35
+ <typeface>2</typeface>
36
+ <mt_code_value>0x002A</mt_code_value>
37
+ </char>
38
+ <end/>
39
+ </slot>
40
+ <end/>
41
+ </tmpl>
42
+ <end/>
43
+ </slot>
44
+ <end/>
45
+ </mtef>
46
+ </root>
@@ -0,0 +1,90 @@
1
+ <?xml version="1.0"?>
2
+ <root>
3
+ <mtef>
4
+ <mtef_version>3</mtef_version>
5
+ <platform>1</platform>
6
+ <product>1</product>
7
+ <product_version>3</product_version>
8
+ <product_subversion>10</product_subversion>
9
+ <full/>
10
+ <slot>
11
+ <options>0</options>
12
+ <tmpl>
13
+ <options>0</options>
14
+ <selector>tmROOT</selector>
15
+ <variation>tvROOT_SQ</variation>
16
+ <template_specific_options>0</template_specific_options>
17
+ <slot>
18
+ <options>0</options>
19
+ <tmpl>
20
+ <options>0</options>
21
+ <selector>tmPAREN</selector>
22
+ <variation>tvFENCE_L</variation>
23
+ <variation>tvFENCE_R</variation>
24
+ <template_specific_options>0</template_specific_options>
25
+ <slot>
26
+ <options>0</options>
27
+ <char>
28
+ <options>1</options>
29
+ <typeface>3</typeface>
30
+ <mt_code_value>0x006C</mt_code_value>
31
+ </char>
32
+ <sub/>
33
+ <char>
34
+ <options>8</options>
35
+ <nudge>
36
+ <dx>-256</dx>
37
+ <dy>-96</dy>
38
+ </nudge>
39
+ <typeface>8</typeface>
40
+ <mt_code_value>0x0032</mt_code_value>
41
+ </char>
42
+ <full/>
43
+ <char>
44
+ <options>0</options>
45
+ <typeface>6</typeface>
46
+ <mt_code_value>0x002B</mt_code_value>
47
+ </char>
48
+ <char>
49
+ <options>1</options>
50
+ <typeface>3</typeface>
51
+ <mt_code_value>0x0065</mt_code_value>
52
+ </char>
53
+ <sub/>
54
+ <char>
55
+ <options>8</options>
56
+ <nudge>
57
+ <dx>-256</dx>
58
+ <dy>-96</dy>
59
+ </nudge>
60
+ <typeface>8</typeface>
61
+ <mt_code_value>0x0032</mt_code_value>
62
+ </char>
63
+ <end/>
64
+ </slot>
65
+ <full/>
66
+ <char>
67
+ <options>0</options>
68
+ <typeface>22</typeface>
69
+ <mt_code_value>0x0028</mt_code_value>
70
+ </char>
71
+ <char>
72
+ <options>0</options>
73
+ <typeface>22</typeface>
74
+ <mt_code_value>0x0029</mt_code_value>
75
+ </char>
76
+ <end/>
77
+ </tmpl>
78
+ <end/>
79
+ </slot>
80
+ <sub/>
81
+ <slot>
82
+ <options>1</options>
83
+ </slot>
84
+ <end/>
85
+ </tmpl>
86
+ <end/>
87
+ </slot>
88
+ <end/>
89
+ </mtef>
90
+ </root>
@@ -0,0 +1,132 @@
1
+ <?xml version="1.0"?>
2
+ <root>
3
+ <mtef>
4
+ <mtef_version>3</mtef_version>
5
+ <platform>1</platform>
6
+ <product>1</product>
7
+ <product_version>3</product_version>
8
+ <product_subversion>10</product_subversion>
9
+ <full/>
10
+ <slot>
11
+ <options>0</options>
12
+ <char>
13
+ <options>0</options>
14
+ <typeface>4</typeface>
15
+ <mt_code_value>0x03C3</mt_code_value>
16
+ </char>
17
+ <tmpl>
18
+ <options>0</options>
19
+ <selector>tmSUB</selector>
20
+ <template_specific_options>0</template_specific_options>
21
+ <sub/>
22
+ <slot>
23
+ <options>0</options>
24
+ <font>
25
+ <options>0</options>
26
+ <name>Arial</name>
27
+ <typeface>130</typeface>
28
+ <style>0</style>
29
+ </font>
30
+ <char>
31
+ <options>0</options>
32
+ <typeface>254</typeface>
33
+ <mt_code_value>0x0074</mt_code_value>
34
+ </char>
35
+ <end/>
36
+ </slot>
37
+ <slot>
38
+ <options>1</options>
39
+ </slot>
40
+ <end/>
41
+ </tmpl>
42
+ <full/>
43
+ <char>
44
+ <options>0</options>
45
+ <typeface>6</typeface>
46
+ <mt_code_value>0x003D</mt_code_value>
47
+ </char>
48
+ <tmpl>
49
+ <options>0</options>
50
+ <selector>tmROOT</selector>
51
+ <variation>tvROOT_SQ</variation>
52
+ <template_specific_options>0</template_specific_options>
53
+ <slot>
54
+ <options>0</options>
55
+ <char>
56
+ <options>0</options>
57
+ <typeface>4</typeface>
58
+ <mt_code_value>0x03C3</mt_code_value>
59
+ </char>
60
+ <tmpl>
61
+ <options>0</options>
62
+ <selector>tmSUBSUP</selector>
63
+ <template_specific_options>0</template_specific_options>
64
+ <sub/>
65
+ <slot>
66
+ <options>0</options>
67
+ <char>
68
+ <options>0</options>
69
+ <typeface>254</typeface>
70
+ <mt_code_value>0x0052</mt_code_value>
71
+ </char>
72
+ <end/>
73
+ </slot>
74
+ <slot>
75
+ <options>0</options>
76
+ <char>
77
+ <options>0</options>
78
+ <typeface>8</typeface>
79
+ <mt_code_value>0x0032</mt_code_value>
80
+ </char>
81
+ <end/>
82
+ </slot>
83
+ <end/>
84
+ </tmpl>
85
+ <full/>
86
+ <char>
87
+ <options>0</options>
88
+ <typeface>6</typeface>
89
+ <mt_code_value>0x002B</mt_code_value>
90
+ </char>
91
+ <char>
92
+ <options>0</options>
93
+ <typeface>4</typeface>
94
+ <mt_code_value>0x03C3</mt_code_value>
95
+ </char>
96
+ <tmpl>
97
+ <options>0</options>
98
+ <selector>tmSUBSUP</selector>
99
+ <template_specific_options>0</template_specific_options>
100
+ <sub/>
101
+ <slot>
102
+ <options>0</options>
103
+ <char>
104
+ <options>0</options>
105
+ <typeface>254</typeface>
106
+ <mt_code_value>0x0050</mt_code_value>
107
+ </char>
108
+ <end/>
109
+ </slot>
110
+ <slot>
111
+ <options>0</options>
112
+ <char>
113
+ <options>0</options>
114
+ <typeface>8</typeface>
115
+ <mt_code_value>0x0032</mt_code_value>
116
+ </char>
117
+ <end/>
118
+ </slot>
119
+ <end/>
120
+ </tmpl>
121
+ <end/>
122
+ </slot>
123
+ <slot>
124
+ <options>1</options>
125
+ </slot>
126
+ <end/>
127
+ </tmpl>
128
+ <end/>
129
+ </slot>
130
+ <end/>
131
+ </mtef>
132
+ </root>