mathematical 0.4.2 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +20 -9
  3. data/Rakefile +5 -24
  4. data/ext/mathematical/extconf.rb +8 -3
  5. data/ext/mathematical/lasem/src/lsmdomparser.c +7 -7
  6. data/ext/mathematical/lasem/src/lsmdomparser.h +2 -2
  7. data/ext/mathematical/lasem/src/lsmitex.c +8 -5
  8. data/ext/mathematical/lasem/src/lsmitex.h +1 -1
  9. data/ext/mathematical/lasem/src/lsmmathmldocument.c +2 -2
  10. data/ext/mathematical/lasem/src/lsmmathmldocument.h +1 -1
  11. data/ext/mathematical/lasem/tests/lsmtest.c +2 -2
  12. data/ext/mathematical/mathematical.c +119 -10
  13. data/ext/mathematical/mtex2MML/ext/extconf.rb +4 -0
  14. data/ext/mathematical/mtex2MML/src/lex.yy.c +6791 -0
  15. data/ext/mathematical/mtex2MML/src/mtex2MML.h +59 -0
  16. data/ext/mathematical/mtex2MML/src/parse_extras.c +306 -0
  17. data/ext/mathematical/mtex2MML/src/parse_extras.h +78 -0
  18. data/ext/mathematical/mtex2MML/src/stack.c +80 -0
  19. data/ext/mathematical/mtex2MML/src/stack.h +101 -0
  20. data/ext/mathematical/mtex2MML/src/string_extras.c +211 -0
  21. data/ext/mathematical/mtex2MML/src/string_extras.h +46 -0
  22. data/ext/mathematical/mtex2MML/src/y.tab.c +7090 -0
  23. data/ext/mathematical/mtex2MML/src/y.tab.h +393 -0
  24. data/lib/mathematical.rb +1 -0
  25. data/lib/mathematical/corrections.rb +34 -0
  26. data/lib/mathematical/render.rb +21 -12
  27. data/lib/mathematical/version.rb +1 -1
  28. data/mathematical.gemspec +2 -2
  29. data/test/mathematical/corrections_test.rb +56 -0
  30. data/test/mathematical/fixtures/png/pmatrix.png +0 -0
  31. data/test/mathematical/fixtures_test.rb +11 -1
  32. data/test/mathematical/maliciousness_test.rb +10 -2
  33. data/test/mathematical/mathml_test.rb +22 -0
  34. data/test/mathematical/png_test.rb +26 -0
  35. data/test/test_helper.rb +13 -0
  36. metadata +150 -134
  37. data/ext/mathematical/itexToMML/itex2MML.h +0 -63
  38. data/ext/mathematical/itexToMML/lex.yy.c +0 -6548
  39. data/ext/mathematical/itexToMML/y.tab.c +0 -6179
  40. data/ext/mathematical/itexToMML/y.tab.h +0 -389
@@ -1,3 +1,3 @@
1
1
  module Mathematical
2
- VERSION = "0.4.2"
2
+ VERSION = "0.5.0"
3
3
  end
data/mathematical.gemspec CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
8
8
  spec.version = Mathematical::VERSION
9
9
  spec.authors = ["Garen Torikian"]
10
10
  spec.email = ["gjtorikian@gmail.com"]
11
- spec.summary = %q{Quickly convert math equations into beautiful SVGs.}
12
- spec.description = %q{A very fast way to turn itex math equations into beautifully rendered SVGs, to embed on the web. This library is a general purpose wrapper to GNOME's Lasem. }
11
+ spec.summary = %q{Quickly convert math equations into beautiful SVGs/PNGs/MathML.}
12
+ spec.description = %q{A very fast way to turn itex math equations into beautifully rendered SVGs, to embed on the web. This library is mostly written in C and is a general purpose wrapper to GNOME's Lasem. }
13
13
  spec.homepage = "https://github.com/gjtorikian/mathematical"
14
14
  spec.license = "MIT"
15
15
 
@@ -0,0 +1,56 @@
1
+ require "test_helper"
2
+
3
+ class Mathematical::CorrectionsTest < Test::Unit::TestCase
4
+
5
+ def setup
6
+ @render = Mathematical::Render.new
7
+ @slash_maths = '''
8
+ $$
9
+ \dot{x} & = \sigma(y-x) \\\\
10
+ \dot{y} & = \rho x - y - xz \\\\
11
+ \dot{z} & = -\beta z + xy
12
+ $$
13
+ '''
14
+
15
+ @aligned_maths = '''
16
+ $$
17
+ \begin{align}
18
+ \dot{x} & = \sigma(y-x) \\\\
19
+ \dot{y} & = \rho x - y - xz \\\\
20
+ \dot{z} & = -\beta z + xy
21
+ \end{align}
22
+ $$
23
+ '''
24
+ end
25
+
26
+ def test_expect_slashes_failures
27
+ @render.expects(:apply_corrections).returns(@slash_maths)
28
+
29
+ printed = capture_stderr do
30
+ @render.render @slash_maths
31
+ end
32
+ assert_match /Failed to parse mtex/, printed
33
+ end
34
+
35
+ def test_adjust_aligned
36
+ assert_no_match /align\}/, @render.apply_corrections(@aligned_maths)
37
+ end
38
+
39
+ def test_adjust_fracs
40
+ simple_frac = '$\frac25$'
41
+ assert_match /frac\{2\}\{5\}/, @render.apply_corrections(simple_frac)
42
+ end
43
+
44
+ def test_adjust_lt_gt
45
+ simple_lt = '$|q| < 1$'
46
+ assert_match /|q| \\lt 1/, @render.apply_corrections(simple_lt)
47
+
48
+ simple_gt = '$|q| > 1$'
49
+ assert_match /|q| \\gt 1/, @render.apply_corrections(simple_gt)
50
+ end
51
+
52
+ def test_adjust_limits
53
+ integral = '\int\limits_{-\pi}^{\pi}'
54
+ assert_equal '\int_{-\pi}^{\pi}', @render.apply_corrections(integral)
55
+ end
56
+ end
@@ -6,12 +6,22 @@ class Mathematical::FixturesTest < Test::Unit::TestCase
6
6
  blob.gsub(/id="surface.+?"/, '')
7
7
  end
8
8
 
9
- Dir['test/mathematical/fixtures/before/*.text'].each do |before|
9
+ Dir["#{fixtures_dir}/before/*.text"].each do |before|
10
10
  name = before.split('/').last
11
11
 
12
12
  define_method "test_#{name}" do
13
13
  source = File.read(before)
14
14
 
15
+ if ENV['MATHEMATICAL_GENERATE_SAMPLE']
16
+ next unless name.match /compliance/
17
+ actual = MathToItex(source).convert do |eq, type|
18
+ svg_content = Mathematical::Render.new(:base64 => false).render(eq)
19
+ # remove \ and $, remove whitespace, keep alphanums, remove extraneous - and trailing -
20
+ filename = eq.gsub(/[\$\\]*/, '').gsub(/\s+/, '-').gsub(/[^a-zA-Z\d]/, '-').gsub(/-{2,}/, '-').gsub(/-$/, '')
21
+ File.open("samples/fixtures/#{filename}.svg", "w") { |file| file.write svg_content["svg"] }
22
+ end
23
+ end
24
+
15
25
  actual = MathToItex(source).convert do |eq, type|
16
26
  svg_content = Mathematical::Render.new(:base64 => true).render(eq)
17
27
 
@@ -5,8 +5,8 @@ class Mathematical::MaliciousnessTest < Test::Unit::TestCase
5
5
  def test_it_does_not_error_on_unrecognized_commands
6
6
  render = Mathematical::Render.new
7
7
  output = nil
8
- assert_nothing_raised { output = render.render('$\align$') }
9
- assert_equal output, '$\align$'
8
+ # In C, we raise a ParseError, but Mathematical suppresses it.
9
+ assert_nothing_raised { output = render.render('$\not_real_comment$') }
10
10
  end
11
11
 
12
12
  def test_it_does_not_blow_up_on_bad_arguments
@@ -43,6 +43,14 @@ class Mathematical::MaliciousnessTest < Test::Unit::TestCase
43
43
  render = Mathematical::Render.new({:maxsize => 5.3})
44
44
  end
45
45
 
46
+ assert_raise TypeError do
47
+ render = Mathematical::Render.new({:format => 123})
48
+ end
49
+
50
+ assert_raise TypeError do
51
+ render = Mathematical::Render.new({:format => "something amazing"})
52
+ end
53
+
46
54
  assert_raise Mathematical::MaxsizeError do
47
55
  render = Mathematical::Render.new({:maxsize => 2})
48
56
  render.render('$a \ne b$')
@@ -0,0 +1,22 @@
1
+ require "test_helper"
2
+ require 'benchmark'
3
+
4
+ class Mathematical::MathMLTest < Test::Unit::TestCase
5
+
6
+ def test_it_returns_mathml
7
+ string = '''
8
+ $$
9
+ \begin{pmatrix}
10
+ 1 & a_1 & a_1^2 & \cdots & a_1^n \\\\
11
+ 1 & a_2 & a_2^2 & \cdots & a_2^n \\\\
12
+ \vdots & \vdots& \vdots & \ddots & \vdots \\\\
13
+ 1 & a_m & a_m^2 & \cdots & a_m^n
14
+ \end{pmatrix}
15
+ $$
16
+ '''
17
+ render = Mathematical::Render.new({:format => "mathml"})
18
+ mathml = render.render(string)["mathml"]
19
+
20
+ assert_match /<math xmlns='http:\/\/www.w3.org\/1998\/Math\/MathML' display='block'><semantics><mrow><mrow><mo>\(/, mathml
21
+ end
22
+ end
@@ -0,0 +1,26 @@
1
+ require "test_helper"
2
+ require 'benchmark'
3
+
4
+ class Mathematical::PNGTest < Test::Unit::TestCase
5
+ def before
6
+ File.delete("#{fixtures_dir}/png/pmatrix.png") if File.exists?("#{fixtures_dir}/png/pmatrix.png")
7
+ end
8
+
9
+ def test_it_creates_a_png
10
+ string = '''
11
+ $$
12
+ \begin{pmatrix}
13
+ 1 & a_1 & a_1^2 & \cdots & a_1^n \\\\
14
+ 1 & a_2 & a_2^2 & \cdots & a_2^n \\\\
15
+ \vdots & \vdots& \vdots & \ddots & \vdots \\\\
16
+ 1 & a_m & a_m^2 & \cdots & a_m^n
17
+ \end{pmatrix}
18
+ $$
19
+ '''
20
+ render = Mathematical::Render.new({:format => "png"})
21
+ data_hash = render.render(string)
22
+ header = data_hash["png"].unpack('H*').first.slice(0, 18)
23
+ File.open("#{fixtures_dir}/png/pmatrix.png", "w") { |f| f.write(data_hash["png"])}
24
+ assert_equal header, "89504e470d0a1a0a00"
25
+ end
26
+ end
data/test/test_helper.rb CHANGED
@@ -3,3 +3,16 @@ require 'mathematical'
3
3
  require 'test/unit'
4
4
  require 'mocha/test_unit'
5
5
  require 'math-to-itex'
6
+
7
+ def fixtures_dir
8
+ "test/mathematical/fixtures"
9
+ end
10
+
11
+ def capture_stderr(&blk)
12
+ old = $stderr
13
+ $stderr = fake = StringIO.new
14
+ blk.call
15
+ fake.string
16
+ ensure
17
+ $stderr = old
18
+ end
metadata CHANGED
@@ -1,74 +1,74 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mathematical
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen Torikian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-13 00:00:00.000000000 Z
11
+ date: 2014-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0.9'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0.9'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.5'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.5'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: mocha
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '1.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: math-to-itex
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0.3'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0.3'
69
69
  description: 'A very fast way to turn itex math equations into beautifully rendered
70
- SVGs, to embed on the web. This library is a general purpose wrapper to GNOME''s
71
- Lasem. '
70
+ SVGs, to embed on the web. This library is mostly written in C and is a general
71
+ purpose wrapper to GNOME''s Lasem. '
72
72
  email:
73
73
  - gjtorikian@gmail.com
74
74
  executables: []
@@ -79,238 +79,247 @@ files:
79
79
  - LICENSE.txt
80
80
  - README.md
81
81
  - Rakefile
82
- - mathematical.gemspec
83
- - lib/mathematical/render.rb
84
- - lib/mathematical/version.rb
85
- - lib/mathematical.rb
86
- - ext/mathematical/itexToMML/lex.yy.c
87
- - ext/mathematical/itexToMML/y.tab.c
82
+ - ext/mathematical/extconf.rb
83
+ - ext/mathematical/lasem/itex2mml/itex2MML.h
88
84
  - ext/mathematical/lasem/src/lasemrender.c
89
85
  - ext/mathematical/lasem/src/lsm.c
90
- - ext/mathematical/lasem/src/lsmattributes.c
91
- - ext/mathematical/lasem/src/lsmcairo.c
92
- - ext/mathematical/lasem/src/lsmdebug.c
93
- - ext/mathematical/lasem/src/lsmdomcharacterdata.c
94
- - ext/mathematical/lasem/src/lsmdomdocument.c
95
- - ext/mathematical/lasem/src/lsmdomdocumentfragment.c
96
- - ext/mathematical/lasem/src/lsmdomelement.c
97
- - ext/mathematical/lasem/src/lsmdomentities.c
98
- - ext/mathematical/lasem/src/lsmdomimplementation.c
99
- - ext/mathematical/lasem/src/lsmdomnamednodemap.c
100
- - ext/mathematical/lasem/src/lsmdomnode.c
101
- - ext/mathematical/lasem/src/lsmdomnodelist.c
102
- - ext/mathematical/lasem/src/lsmdomparser.c
103
- - ext/mathematical/lasem/src/lsmdomtext.c
104
- - ext/mathematical/lasem/src/lsmdomview.c
105
- - ext/mathematical/lasem/src/lsmitex.c
106
- - ext/mathematical/lasem/src/lsmmathmlactionelement.c
107
- - ext/mathematical/lasem/src/lsmmathmlaligngroupelement.c
108
- - ext/mathematical/lasem/src/lsmmathmlalignmarkelement.c
109
- - ext/mathematical/lasem/src/lsmmathmlattributes.c
110
- - ext/mathematical/lasem/src/lsmmathmldocument.c
111
- - ext/mathematical/lasem/src/lsmmathmlelement.c
112
- - ext/mathematical/lasem/src/lsmmathmlenums.c
113
- - ext/mathematical/lasem/src/lsmmathmlerrorelement.c
114
- - ext/mathematical/lasem/src/lsmmathmlfencedelement.c
115
- - ext/mathematical/lasem/src/lsmmathmlfractionelement.c
116
- - ext/mathematical/lasem/src/lsmmathmlglyphtableams.c
117
- - ext/mathematical/lasem/src/lsmmathmlitexelement.c
118
- - ext/mathematical/lasem/src/lsmmathmllayoututils.c
119
- - ext/mathematical/lasem/src/lsmmathmlmathelement.c
120
- - ext/mathematical/lasem/src/lsmmathmloperatordictionary.c
121
- - ext/mathematical/lasem/src/lsmmathmloperatorelement.c
122
- - ext/mathematical/lasem/src/lsmmathmlpaddedelement.c
123
- - ext/mathematical/lasem/src/lsmmathmlphantomelement.c
124
- - ext/mathematical/lasem/src/lsmmathmlpresentationcontainer.c
125
- - ext/mathematical/lasem/src/lsmmathmlpresentationtoken.c
126
- - ext/mathematical/lasem/src/lsmmathmlradicalelement.c
127
- - ext/mathematical/lasem/src/lsmmathmlrowelement.c
128
- - ext/mathematical/lasem/src/lsmmathmlscriptelement.c
129
- - ext/mathematical/lasem/src/lsmmathmlsemanticselement.c
130
- - ext/mathematical/lasem/src/lsmmathmlspaceelement.c
131
- - ext/mathematical/lasem/src/lsmmathmlstringelement.c
132
- - ext/mathematical/lasem/src/lsmmathmlstyle.c
133
- - ext/mathematical/lasem/src/lsmmathmlstyleelement.c
134
- - ext/mathematical/lasem/src/lsmmathmltablecellelement.c
135
- - ext/mathematical/lasem/src/lsmmathmltableelement.c
136
- - ext/mathematical/lasem/src/lsmmathmltablerowelement.c
137
- - ext/mathematical/lasem/src/lsmmathmltraits.c
138
- - ext/mathematical/lasem/src/lsmmathmlunderoverelement.c
139
- - ext/mathematical/lasem/src/lsmmathmlutils.c
140
- - ext/mathematical/lasem/src/lsmmathmlview.c
141
- - ext/mathematical/lasem/src/lsmproperties.c
142
- - ext/mathematical/lasem/src/lsmstr.c
143
- - ext/mathematical/lasem/src/lsmsvgaelement.c
144
- - ext/mathematical/lasem/src/lsmsvgcircleelement.c
145
- - ext/mathematical/lasem/src/lsmsvgclippathelement.c
146
- - ext/mathematical/lasem/src/lsmsvgcolors.c
147
- - ext/mathematical/lasem/src/lsmsvgdefselement.c
148
- - ext/mathematical/lasem/src/lsmsvgdocument.c
149
- - ext/mathematical/lasem/src/lsmsvgelement.c
150
- - ext/mathematical/lasem/src/lsmsvgellipseelement.c
151
- - ext/mathematical/lasem/src/lsmsvgenums.c
152
- - ext/mathematical/lasem/src/lsmsvgfilterblend.c
153
- - ext/mathematical/lasem/src/lsmsvgfiltercomposite.c
154
- - ext/mathematical/lasem/src/lsmsvgfilterelement.c
155
- - ext/mathematical/lasem/src/lsmsvgfilterflood.c
156
- - ext/mathematical/lasem/src/lsmsvgfiltergaussianblur.c
157
- - ext/mathematical/lasem/src/lsmsvgfiltermerge.c
158
- - ext/mathematical/lasem/src/lsmsvgfiltermergenode.c
159
- - ext/mathematical/lasem/src/lsmsvgfilteroffset.c
160
- - ext/mathematical/lasem/src/lsmsvgfilterprimitive.c
161
- - ext/mathematical/lasem/src/lsmsvgfilterspecularlighting.c
162
- - ext/mathematical/lasem/src/lsmsvgfiltersurface.c
163
- - ext/mathematical/lasem/src/lsmsvgfiltertile.c
164
- - ext/mathematical/lasem/src/lsmsvggelement.c
165
- - ext/mathematical/lasem/src/lsmsvggradientelement.c
166
- - ext/mathematical/lasem/src/lsmsvgimageelement.c
167
- - ext/mathematical/lasem/src/lsmsvglength.c
168
- - ext/mathematical/lasem/src/lsmsvglineargradientelement.c
169
- - ext/mathematical/lasem/src/lsmsvglineelement.c
170
- - ext/mathematical/lasem/src/lsmsvgmarkerelement.c
171
- - ext/mathematical/lasem/src/lsmsvgmaskelement.c
172
- - ext/mathematical/lasem/src/lsmsvgmatrix.c
173
- - ext/mathematical/lasem/src/lsmsvgpathelement.c
174
- - ext/mathematical/lasem/src/lsmsvgpatternelement.c
175
- - ext/mathematical/lasem/src/lsmsvgpolygonelement.c
176
- - ext/mathematical/lasem/src/lsmsvgpolylineelement.c
177
- - ext/mathematical/lasem/src/lsmsvgradialgradientelement.c
178
- - ext/mathematical/lasem/src/lsmsvgrectelement.c
179
- - ext/mathematical/lasem/src/lsmsvgstopelement.c
180
- - ext/mathematical/lasem/src/lsmsvgstyle.c
181
- - ext/mathematical/lasem/src/lsmsvgsvgelement.c
182
- - ext/mathematical/lasem/src/lsmsvgswitchelement.c
183
- - ext/mathematical/lasem/src/lsmsvgsymbolelement.c
184
- - ext/mathematical/lasem/src/lsmsvgtextelement.c
185
- - ext/mathematical/lasem/src/lsmsvgtraits.c
186
- - ext/mathematical/lasem/src/lsmsvgtransformable.c
187
- - ext/mathematical/lasem/src/lsmsvgtspanelement.c
188
- - ext/mathematical/lasem/src/lsmsvguseelement.c
189
- - ext/mathematical/lasem/src/lsmsvgview.c
190
- - ext/mathematical/lasem/src/lsmtraits.c
191
- - ext/mathematical/lasem/src/lsmutils.c
192
- - ext/mathematical/lasem/tests/dom.c
193
- - ext/mathematical/lasem/tests/lsmtest.c
194
- - ext/mathematical/lasem/tests/str.c
195
- - ext/mathematical/lasem/tests/suite.c
196
- - ext/mathematical/lasem/tools/generate-entity-array.c
197
- - ext/mathematical/mathematical.c
198
- - ext/mathematical/itexToMML/itex2MML.h
199
- - ext/mathematical/itexToMML/y.tab.h
200
- - ext/mathematical/lasem/itex2mml/itex2MML.h
201
86
  - ext/mathematical/lasem/src/lsm.h
87
+ - ext/mathematical/lasem/src/lsmattributes.c
202
88
  - ext/mathematical/lasem/src/lsmattributes.h
89
+ - ext/mathematical/lasem/src/lsmcairo.c
203
90
  - ext/mathematical/lasem/src/lsmcairo.h
91
+ - ext/mathematical/lasem/src/lsmdebug.c
204
92
  - ext/mathematical/lasem/src/lsmdebug.h
205
93
  - ext/mathematical/lasem/src/lsmdom.h
94
+ - ext/mathematical/lasem/src/lsmdomcharacterdata.c
206
95
  - ext/mathematical/lasem/src/lsmdomcharacterdata.h
96
+ - ext/mathematical/lasem/src/lsmdomdocument.c
207
97
  - ext/mathematical/lasem/src/lsmdomdocument.h
98
+ - ext/mathematical/lasem/src/lsmdomdocumentfragment.c
208
99
  - ext/mathematical/lasem/src/lsmdomdocumentfragment.h
100
+ - ext/mathematical/lasem/src/lsmdomelement.c
209
101
  - ext/mathematical/lasem/src/lsmdomelement.h
102
+ - ext/mathematical/lasem/src/lsmdomentities.c
210
103
  - ext/mathematical/lasem/src/lsmdomentities.h
104
+ - ext/mathematical/lasem/src/lsmdomimplementation.c
211
105
  - ext/mathematical/lasem/src/lsmdomimplementation.h
106
+ - ext/mathematical/lasem/src/lsmdomnamednodemap.c
212
107
  - ext/mathematical/lasem/src/lsmdomnamednodemap.h
108
+ - ext/mathematical/lasem/src/lsmdomnode.c
213
109
  - ext/mathematical/lasem/src/lsmdomnode.h
110
+ - ext/mathematical/lasem/src/lsmdomnodelist.c
214
111
  - ext/mathematical/lasem/src/lsmdomnodelist.h
112
+ - ext/mathematical/lasem/src/lsmdomparser.c
215
113
  - ext/mathematical/lasem/src/lsmdomparser.h
114
+ - ext/mathematical/lasem/src/lsmdomtext.c
216
115
  - ext/mathematical/lasem/src/lsmdomtext.h
217
116
  - ext/mathematical/lasem/src/lsmdomtypes.h
117
+ - ext/mathematical/lasem/src/lsmdomview.c
218
118
  - ext/mathematical/lasem/src/lsmdomview.h
119
+ - ext/mathematical/lasem/src/lsmitex.c
219
120
  - ext/mathematical/lasem/src/lsmitex.h
220
121
  - ext/mathematical/lasem/src/lsmmathml.h
122
+ - ext/mathematical/lasem/src/lsmmathmlactionelement.c
221
123
  - ext/mathematical/lasem/src/lsmmathmlactionelement.h
124
+ - ext/mathematical/lasem/src/lsmmathmlaligngroupelement.c
222
125
  - ext/mathematical/lasem/src/lsmmathmlaligngroupelement.h
126
+ - ext/mathematical/lasem/src/lsmmathmlalignmarkelement.c
223
127
  - ext/mathematical/lasem/src/lsmmathmlalignmarkelement.h
128
+ - ext/mathematical/lasem/src/lsmmathmlattributes.c
224
129
  - ext/mathematical/lasem/src/lsmmathmlattributes.h
130
+ - ext/mathematical/lasem/src/lsmmathmldocument.c
225
131
  - ext/mathematical/lasem/src/lsmmathmldocument.h
132
+ - ext/mathematical/lasem/src/lsmmathmlelement.c
226
133
  - ext/mathematical/lasem/src/lsmmathmlelement.h
134
+ - ext/mathematical/lasem/src/lsmmathmlenums.c
227
135
  - ext/mathematical/lasem/src/lsmmathmlenums.h
136
+ - ext/mathematical/lasem/src/lsmmathmlerrorelement.c
228
137
  - ext/mathematical/lasem/src/lsmmathmlerrorelement.h
138
+ - ext/mathematical/lasem/src/lsmmathmlfencedelement.c
229
139
  - ext/mathematical/lasem/src/lsmmathmlfencedelement.h
140
+ - ext/mathematical/lasem/src/lsmmathmlfractionelement.c
230
141
  - ext/mathematical/lasem/src/lsmmathmlfractionelement.h
142
+ - ext/mathematical/lasem/src/lsmmathmlglyphtableams.c
231
143
  - ext/mathematical/lasem/src/lsmmathmlglyphtableams.h
144
+ - ext/mathematical/lasem/src/lsmmathmlitexelement.c
232
145
  - ext/mathematical/lasem/src/lsmmathmlitexelement.h
146
+ - ext/mathematical/lasem/src/lsmmathmllayoututils.c
233
147
  - ext/mathematical/lasem/src/lsmmathmllayoututils.h
148
+ - ext/mathematical/lasem/src/lsmmathmlmathelement.c
234
149
  - ext/mathematical/lasem/src/lsmmathmlmathelement.h
150
+ - ext/mathematical/lasem/src/lsmmathmloperatordictionary.c
235
151
  - ext/mathematical/lasem/src/lsmmathmloperatordictionary.h
152
+ - ext/mathematical/lasem/src/lsmmathmloperatorelement.c
236
153
  - ext/mathematical/lasem/src/lsmmathmloperatorelement.h
154
+ - ext/mathematical/lasem/src/lsmmathmlpaddedelement.c
237
155
  - ext/mathematical/lasem/src/lsmmathmlpaddedelement.h
156
+ - ext/mathematical/lasem/src/lsmmathmlphantomelement.c
238
157
  - ext/mathematical/lasem/src/lsmmathmlphantomelement.h
158
+ - ext/mathematical/lasem/src/lsmmathmlpresentationcontainer.c
239
159
  - ext/mathematical/lasem/src/lsmmathmlpresentationcontainer.h
160
+ - ext/mathematical/lasem/src/lsmmathmlpresentationtoken.c
240
161
  - ext/mathematical/lasem/src/lsmmathmlpresentationtoken.h
162
+ - ext/mathematical/lasem/src/lsmmathmlradicalelement.c
241
163
  - ext/mathematical/lasem/src/lsmmathmlradicalelement.h
164
+ - ext/mathematical/lasem/src/lsmmathmlrowelement.c
242
165
  - ext/mathematical/lasem/src/lsmmathmlrowelement.h
166
+ - ext/mathematical/lasem/src/lsmmathmlscriptelement.c
243
167
  - ext/mathematical/lasem/src/lsmmathmlscriptelement.h
168
+ - ext/mathematical/lasem/src/lsmmathmlsemanticselement.c
244
169
  - ext/mathematical/lasem/src/lsmmathmlsemanticselement.h
170
+ - ext/mathematical/lasem/src/lsmmathmlspaceelement.c
245
171
  - ext/mathematical/lasem/src/lsmmathmlspaceelement.h
172
+ - ext/mathematical/lasem/src/lsmmathmlstringelement.c
246
173
  - ext/mathematical/lasem/src/lsmmathmlstringelement.h
174
+ - ext/mathematical/lasem/src/lsmmathmlstyle.c
247
175
  - ext/mathematical/lasem/src/lsmmathmlstyle.h
176
+ - ext/mathematical/lasem/src/lsmmathmlstyleelement.c
248
177
  - ext/mathematical/lasem/src/lsmmathmlstyleelement.h
178
+ - ext/mathematical/lasem/src/lsmmathmltablecellelement.c
249
179
  - ext/mathematical/lasem/src/lsmmathmltablecellelement.h
180
+ - ext/mathematical/lasem/src/lsmmathmltableelement.c
250
181
  - ext/mathematical/lasem/src/lsmmathmltableelement.h
182
+ - ext/mathematical/lasem/src/lsmmathmltablerowelement.c
251
183
  - ext/mathematical/lasem/src/lsmmathmltablerowelement.h
184
+ - ext/mathematical/lasem/src/lsmmathmltraits.c
252
185
  - ext/mathematical/lasem/src/lsmmathmltraits.h
253
186
  - ext/mathematical/lasem/src/lsmmathmltypes.h
187
+ - ext/mathematical/lasem/src/lsmmathmlunderoverelement.c
254
188
  - ext/mathematical/lasem/src/lsmmathmlunderoverelement.h
189
+ - ext/mathematical/lasem/src/lsmmathmlutils.c
255
190
  - ext/mathematical/lasem/src/lsmmathmlutils.h
191
+ - ext/mathematical/lasem/src/lsmmathmlview.c
256
192
  - ext/mathematical/lasem/src/lsmmathmlview.h
193
+ - ext/mathematical/lasem/src/lsmproperties.c
257
194
  - ext/mathematical/lasem/src/lsmproperties.h
195
+ - ext/mathematical/lasem/src/lsmstr.c
258
196
  - ext/mathematical/lasem/src/lsmstr.h
259
197
  - ext/mathematical/lasem/src/lsmsvg.h
198
+ - ext/mathematical/lasem/src/lsmsvgaelement.c
260
199
  - ext/mathematical/lasem/src/lsmsvgaelement.h
261
200
  - ext/mathematical/lasem/src/lsmsvgattributes.h
201
+ - ext/mathematical/lasem/src/lsmsvgcircleelement.c
262
202
  - ext/mathematical/lasem/src/lsmsvgcircleelement.h
203
+ - ext/mathematical/lasem/src/lsmsvgclippathelement.c
263
204
  - ext/mathematical/lasem/src/lsmsvgclippathelement.h
205
+ - ext/mathematical/lasem/src/lsmsvgcolors.c
264
206
  - ext/mathematical/lasem/src/lsmsvgcolors.h
207
+ - ext/mathematical/lasem/src/lsmsvgdefselement.c
265
208
  - ext/mathematical/lasem/src/lsmsvgdefselement.h
209
+ - ext/mathematical/lasem/src/lsmsvgdocument.c
266
210
  - ext/mathematical/lasem/src/lsmsvgdocument.h
211
+ - ext/mathematical/lasem/src/lsmsvgelement.c
267
212
  - ext/mathematical/lasem/src/lsmsvgelement.h
213
+ - ext/mathematical/lasem/src/lsmsvgellipseelement.c
268
214
  - ext/mathematical/lasem/src/lsmsvgellipseelement.h
215
+ - ext/mathematical/lasem/src/lsmsvgenums.c
269
216
  - ext/mathematical/lasem/src/lsmsvgenums.h
217
+ - ext/mathematical/lasem/src/lsmsvgfilterblend.c
270
218
  - ext/mathematical/lasem/src/lsmsvgfilterblend.h
219
+ - ext/mathematical/lasem/src/lsmsvgfiltercomposite.c
271
220
  - ext/mathematical/lasem/src/lsmsvgfiltercomposite.h
221
+ - ext/mathematical/lasem/src/lsmsvgfilterelement.c
272
222
  - ext/mathematical/lasem/src/lsmsvgfilterelement.h
223
+ - ext/mathematical/lasem/src/lsmsvgfilterflood.c
273
224
  - ext/mathematical/lasem/src/lsmsvgfilterflood.h
225
+ - ext/mathematical/lasem/src/lsmsvgfiltergaussianblur.c
274
226
  - ext/mathematical/lasem/src/lsmsvgfiltergaussianblur.h
227
+ - ext/mathematical/lasem/src/lsmsvgfiltermerge.c
275
228
  - ext/mathematical/lasem/src/lsmsvgfiltermerge.h
229
+ - ext/mathematical/lasem/src/lsmsvgfiltermergenode.c
276
230
  - ext/mathematical/lasem/src/lsmsvgfiltermergenode.h
231
+ - ext/mathematical/lasem/src/lsmsvgfilteroffset.c
277
232
  - ext/mathematical/lasem/src/lsmsvgfilteroffset.h
233
+ - ext/mathematical/lasem/src/lsmsvgfilterprimitive.c
278
234
  - ext/mathematical/lasem/src/lsmsvgfilterprimitive.h
235
+ - ext/mathematical/lasem/src/lsmsvgfilterspecularlighting.c
279
236
  - ext/mathematical/lasem/src/lsmsvgfilterspecularlighting.h
237
+ - ext/mathematical/lasem/src/lsmsvgfiltersurface.c
280
238
  - ext/mathematical/lasem/src/lsmsvgfiltersurface.h
239
+ - ext/mathematical/lasem/src/lsmsvgfiltertile.c
281
240
  - ext/mathematical/lasem/src/lsmsvgfiltertile.h
241
+ - ext/mathematical/lasem/src/lsmsvggelement.c
282
242
  - ext/mathematical/lasem/src/lsmsvggelement.h
243
+ - ext/mathematical/lasem/src/lsmsvggradientelement.c
283
244
  - ext/mathematical/lasem/src/lsmsvggradientelement.h
245
+ - ext/mathematical/lasem/src/lsmsvgimageelement.c
284
246
  - ext/mathematical/lasem/src/lsmsvgimageelement.h
247
+ - ext/mathematical/lasem/src/lsmsvglength.c
285
248
  - ext/mathematical/lasem/src/lsmsvglength.h
249
+ - ext/mathematical/lasem/src/lsmsvglineargradientelement.c
286
250
  - ext/mathematical/lasem/src/lsmsvglineargradientelement.h
251
+ - ext/mathematical/lasem/src/lsmsvglineelement.c
287
252
  - ext/mathematical/lasem/src/lsmsvglineelement.h
253
+ - ext/mathematical/lasem/src/lsmsvgmarkerelement.c
288
254
  - ext/mathematical/lasem/src/lsmsvgmarkerelement.h
255
+ - ext/mathematical/lasem/src/lsmsvgmaskelement.c
289
256
  - ext/mathematical/lasem/src/lsmsvgmaskelement.h
257
+ - ext/mathematical/lasem/src/lsmsvgmatrix.c
290
258
  - ext/mathematical/lasem/src/lsmsvgmatrix.h
259
+ - ext/mathematical/lasem/src/lsmsvgpathelement.c
291
260
  - ext/mathematical/lasem/src/lsmsvgpathelement.h
261
+ - ext/mathematical/lasem/src/lsmsvgpatternelement.c
292
262
  - ext/mathematical/lasem/src/lsmsvgpatternelement.h
263
+ - ext/mathematical/lasem/src/lsmsvgpolygonelement.c
293
264
  - ext/mathematical/lasem/src/lsmsvgpolygonelement.h
265
+ - ext/mathematical/lasem/src/lsmsvgpolylineelement.c
294
266
  - ext/mathematical/lasem/src/lsmsvgpolylineelement.h
267
+ - ext/mathematical/lasem/src/lsmsvgradialgradientelement.c
295
268
  - ext/mathematical/lasem/src/lsmsvgradialgradientelement.h
269
+ - ext/mathematical/lasem/src/lsmsvgrectelement.c
296
270
  - ext/mathematical/lasem/src/lsmsvgrectelement.h
271
+ - ext/mathematical/lasem/src/lsmsvgstopelement.c
297
272
  - ext/mathematical/lasem/src/lsmsvgstopelement.h
273
+ - ext/mathematical/lasem/src/lsmsvgstyle.c
298
274
  - ext/mathematical/lasem/src/lsmsvgstyle.h
275
+ - ext/mathematical/lasem/src/lsmsvgsvgelement.c
299
276
  - ext/mathematical/lasem/src/lsmsvgsvgelement.h
277
+ - ext/mathematical/lasem/src/lsmsvgswitchelement.c
300
278
  - ext/mathematical/lasem/src/lsmsvgswitchelement.h
279
+ - ext/mathematical/lasem/src/lsmsvgsymbolelement.c
301
280
  - ext/mathematical/lasem/src/lsmsvgsymbolelement.h
281
+ - ext/mathematical/lasem/src/lsmsvgtextelement.c
302
282
  - ext/mathematical/lasem/src/lsmsvgtextelement.h
283
+ - ext/mathematical/lasem/src/lsmsvgtraits.c
303
284
  - ext/mathematical/lasem/src/lsmsvgtraits.h
285
+ - ext/mathematical/lasem/src/lsmsvgtransformable.c
304
286
  - ext/mathematical/lasem/src/lsmsvgtransformable.h
287
+ - ext/mathematical/lasem/src/lsmsvgtspanelement.c
305
288
  - ext/mathematical/lasem/src/lsmsvgtspanelement.h
306
289
  - ext/mathematical/lasem/src/lsmsvgtypes.h
290
+ - ext/mathematical/lasem/src/lsmsvguseelement.c
307
291
  - ext/mathematical/lasem/src/lsmsvguseelement.h
292
+ - ext/mathematical/lasem/src/lsmsvgview.c
308
293
  - ext/mathematical/lasem/src/lsmsvgview.h
294
+ - ext/mathematical/lasem/src/lsmtraits.c
309
295
  - ext/mathematical/lasem/src/lsmtraits.h
310
296
  - ext/mathematical/lasem/src/lsmtypes.h
297
+ - ext/mathematical/lasem/src/lsmutils.c
311
298
  - ext/mathematical/lasem/src/lsmutils.h
312
- - ext/mathematical/extconf.rb
299
+ - ext/mathematical/lasem/tests/dom.c
300
+ - ext/mathematical/lasem/tests/lsmtest.c
301
+ - ext/mathematical/lasem/tests/str.c
302
+ - ext/mathematical/lasem/tests/suite.c
303
+ - ext/mathematical/lasem/tools/generate-entity-array.c
304
+ - ext/mathematical/mathematical.c
305
+ - ext/mathematical/mtex2MML/ext/extconf.rb
306
+ - ext/mathematical/mtex2MML/src/lex.yy.c
307
+ - ext/mathematical/mtex2MML/src/mtex2MML.h
308
+ - ext/mathematical/mtex2MML/src/parse_extras.c
309
+ - ext/mathematical/mtex2MML/src/parse_extras.h
310
+ - ext/mathematical/mtex2MML/src/stack.c
311
+ - ext/mathematical/mtex2MML/src/stack.h
312
+ - ext/mathematical/mtex2MML/src/string_extras.c
313
+ - ext/mathematical/mtex2MML/src/string_extras.h
314
+ - ext/mathematical/mtex2MML/src/y.tab.c
315
+ - ext/mathematical/mtex2MML/src/y.tab.h
316
+ - lib/mathematical.rb
317
+ - lib/mathematical/corrections.rb
318
+ - lib/mathematical/render.rb
319
+ - lib/mathematical/version.rb
320
+ - mathematical.gemspec
313
321
  - test/mathematical/basic_test.rb
322
+ - test/mathematical/corrections_test.rb
314
323
  - test/mathematical/fixtures/after/backslashes.html
315
324
  - test/mathematical/fixtures/after/brackets_display.html
316
325
  - test/mathematical/fixtures/after/compliance_accents.html
@@ -338,9 +347,12 @@ files:
338
347
  - test/mathematical/fixtures/before/multiple_dollar_inline.text
339
348
  - test/mathematical/fixtures/before/parens_inline.text
340
349
  - test/mathematical/fixtures/performance/big_file.text
350
+ - test/mathematical/fixtures/png/pmatrix.png
341
351
  - test/mathematical/fixtures_test.rb
342
352
  - test/mathematical/maliciousness_test.rb
353
+ - test/mathematical/mathml_test.rb
343
354
  - test/mathematical/performance_test.rb
355
+ - test/mathematical/png_test.rb
344
356
  - test/test_helper.rb
345
357
  homepage: https://github.com/gjtorikian/mathematical
346
358
  licenses:
@@ -353,22 +365,23 @@ require_paths:
353
365
  - ext
354
366
  required_ruby_version: !ruby/object:Gem::Requirement
355
367
  requirements:
356
- - - '>='
368
+ - - ">="
357
369
  - !ruby/object:Gem::Version
358
370
  version: '0'
359
371
  required_rubygems_version: !ruby/object:Gem::Requirement
360
372
  requirements:
361
- - - '>='
373
+ - - ">="
362
374
  - !ruby/object:Gem::Version
363
375
  version: '0'
364
376
  requirements: []
365
377
  rubyforge_project:
366
- rubygems_version: 2.0.3
378
+ rubygems_version: 2.2.2
367
379
  signing_key:
368
380
  specification_version: 4
369
- summary: Quickly convert math equations into beautiful SVGs.
381
+ summary: Quickly convert math equations into beautiful SVGs/PNGs/MathML.
370
382
  test_files:
371
383
  - test/mathematical/basic_test.rb
384
+ - test/mathematical/corrections_test.rb
372
385
  - test/mathematical/fixtures/after/backslashes.html
373
386
  - test/mathematical/fixtures/after/brackets_display.html
374
387
  - test/mathematical/fixtures/after/compliance_accents.html
@@ -396,7 +409,10 @@ test_files:
396
409
  - test/mathematical/fixtures/before/multiple_dollar_inline.text
397
410
  - test/mathematical/fixtures/before/parens_inline.text
398
411
  - test/mathematical/fixtures/performance/big_file.text
412
+ - test/mathematical/fixtures/png/pmatrix.png
399
413
  - test/mathematical/fixtures_test.rb
400
414
  - test/mathematical/maliciousness_test.rb
415
+ - test/mathematical/mathml_test.rb
401
416
  - test/mathematical/performance_test.rb
417
+ - test/mathematical/png_test.rb
402
418
  - test/test_helper.rb