katex-rails 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +7 -0
  2. data/.gitmodules +3 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +20 -0
  5. data/README.md +30 -0
  6. data/Rakefile +63 -0
  7. data/katex-rails.gemspec +22 -0
  8. data/lib/katex-rails.rb +1 -0
  9. data/lib/katex/rails.rb +7 -0
  10. data/lib/katex/rails/engine.rb +14 -0
  11. data/lib/katex/rails/version.rb +5 -0
  12. data/vendor/assets/fonts/katex/KaTeX_AMS-Regular.eot +0 -0
  13. data/vendor/assets/fonts/katex/KaTeX_AMS-Regular.ttf +0 -0
  14. data/vendor/assets/fonts/katex/KaTeX_AMS-Regular.woff +0 -0
  15. data/vendor/assets/fonts/katex/KaTeX_Caligraphic-Bold.eot +0 -0
  16. data/vendor/assets/fonts/katex/KaTeX_Caligraphic-Bold.ttf +0 -0
  17. data/vendor/assets/fonts/katex/KaTeX_Caligraphic-Bold.woff +0 -0
  18. data/vendor/assets/fonts/katex/KaTeX_Caligraphic-Regular.eot +0 -0
  19. data/vendor/assets/fonts/katex/KaTeX_Caligraphic-Regular.ttf +0 -0
  20. data/vendor/assets/fonts/katex/KaTeX_Caligraphic-Regular.woff +0 -0
  21. data/vendor/assets/fonts/katex/KaTeX_Fraktur-Bold.eot +0 -0
  22. data/vendor/assets/fonts/katex/KaTeX_Fraktur-Bold.ttf +0 -0
  23. data/vendor/assets/fonts/katex/KaTeX_Fraktur-Bold.woff +0 -0
  24. data/vendor/assets/fonts/katex/KaTeX_Fraktur-Regular.eot +0 -0
  25. data/vendor/assets/fonts/katex/KaTeX_Fraktur-Regular.ttf +0 -0
  26. data/vendor/assets/fonts/katex/KaTeX_Fraktur-Regular.woff +0 -0
  27. data/vendor/assets/fonts/katex/KaTeX_Greek-Bold.ttf +0 -0
  28. data/vendor/assets/fonts/katex/KaTeX_Greek-BoldItalic.ttf +0 -0
  29. data/vendor/assets/fonts/katex/KaTeX_Greek-Italic.ttf +0 -0
  30. data/vendor/assets/fonts/katex/KaTeX_Greek-Regular.ttf +0 -0
  31. data/vendor/assets/fonts/katex/KaTeX_Main-Bold.eot +0 -0
  32. data/vendor/assets/fonts/katex/KaTeX_Main-Bold.ttf +0 -0
  33. data/vendor/assets/fonts/katex/KaTeX_Main-Bold.woff +0 -0
  34. data/vendor/assets/fonts/katex/KaTeX_Main-Italic.eot +0 -0
  35. data/vendor/assets/fonts/katex/KaTeX_Main-Italic.ttf +0 -0
  36. data/vendor/assets/fonts/katex/KaTeX_Main-Italic.woff +0 -0
  37. data/vendor/assets/fonts/katex/KaTeX_Main-Regular.eot +0 -0
  38. data/vendor/assets/fonts/katex/KaTeX_Main-Regular.ttf +0 -0
  39. data/vendor/assets/fonts/katex/KaTeX_Main-Regular.woff +0 -0
  40. data/vendor/assets/fonts/katex/KaTeX_Math-BoldItalic.eot +0 -0
  41. data/vendor/assets/fonts/katex/KaTeX_Math-BoldItalic.ttf +0 -0
  42. data/vendor/assets/fonts/katex/KaTeX_Math-BoldItalic.woff +0 -0
  43. data/vendor/assets/fonts/katex/KaTeX_Math-Italic.eot +0 -0
  44. data/vendor/assets/fonts/katex/KaTeX_Math-Italic.ttf +0 -0
  45. data/vendor/assets/fonts/katex/KaTeX_Math-Italic.woff +0 -0
  46. data/vendor/assets/fonts/katex/KaTeX_Math-Regular.eot +0 -0
  47. data/vendor/assets/fonts/katex/KaTeX_Math-Regular.ttf +0 -0
  48. data/vendor/assets/fonts/katex/KaTeX_Math-Regular.woff +0 -0
  49. data/vendor/assets/fonts/katex/KaTeX_SansSerif-Bold.eot +0 -0
  50. data/vendor/assets/fonts/katex/KaTeX_SansSerif-Bold.ttf +0 -0
  51. data/vendor/assets/fonts/katex/KaTeX_SansSerif-Bold.woff +0 -0
  52. data/vendor/assets/fonts/katex/KaTeX_SansSerif-Italic.eot +0 -0
  53. data/vendor/assets/fonts/katex/KaTeX_SansSerif-Italic.ttf +0 -0
  54. data/vendor/assets/fonts/katex/KaTeX_SansSerif-Italic.woff +0 -0
  55. data/vendor/assets/fonts/katex/KaTeX_SansSerif-Regular.eot +0 -0
  56. data/vendor/assets/fonts/katex/KaTeX_SansSerif-Regular.ttf +0 -0
  57. data/vendor/assets/fonts/katex/KaTeX_SansSerif-Regular.woff +0 -0
  58. data/vendor/assets/fonts/katex/KaTeX_Script-Regular.eot +0 -0
  59. data/vendor/assets/fonts/katex/KaTeX_Script-Regular.ttf +0 -0
  60. data/vendor/assets/fonts/katex/KaTeX_Script-Regular.woff +0 -0
  61. data/vendor/assets/fonts/katex/KaTeX_Size1-Regular.eot +0 -0
  62. data/vendor/assets/fonts/katex/KaTeX_Size1-Regular.ttf +0 -0
  63. data/vendor/assets/fonts/katex/KaTeX_Size1-Regular.woff +0 -0
  64. data/vendor/assets/fonts/katex/KaTeX_Size2-Regular.eot +0 -0
  65. data/vendor/assets/fonts/katex/KaTeX_Size2-Regular.ttf +0 -0
  66. data/vendor/assets/fonts/katex/KaTeX_Size2-Regular.woff +0 -0
  67. data/vendor/assets/fonts/katex/KaTeX_Size3-Regular.eot +0 -0
  68. data/vendor/assets/fonts/katex/KaTeX_Size3-Regular.ttf +0 -0
  69. data/vendor/assets/fonts/katex/KaTeX_Size3-Regular.woff +0 -0
  70. data/vendor/assets/fonts/katex/KaTeX_Size4-Regular.eot +0 -0
  71. data/vendor/assets/fonts/katex/KaTeX_Size4-Regular.ttf +0 -0
  72. data/vendor/assets/fonts/katex/KaTeX_Size4-Regular.woff +0 -0
  73. data/vendor/assets/fonts/katex/KaTeX_Typewriter-Regular.eot +0 -0
  74. data/vendor/assets/fonts/katex/KaTeX_Typewriter-Regular.ttf +0 -0
  75. data/vendor/assets/fonts/katex/KaTeX_Typewriter-Regular.woff +0 -0
  76. data/vendor/assets/javascripts/katex/katex.js +4954 -0
  77. data/vendor/assets/stylesheets/katex/fonts.less +67 -0
  78. data/vendor/assets/stylesheets/katex/katex.less +429 -0
  79. metadata +177 -0
@@ -0,0 +1,67 @@
1
+ @font-folder: "katex";
2
+ @use-eot: true;
3
+ @use-ttf: true;
4
+ @use-woff: true;
5
+
6
+ .use-eot(@family, @family-suffix) when (@use-eot = true) {
7
+ src: font-url('@{font-folder}/KaTeX_@{family}-@{family-suffix}.eot');
8
+ src+: font-url('@{font-folder}/KaTeX_@{family}-@{family-suffix}.eot#iefix') format('embedded-opentype')
9
+ }
10
+
11
+ .use-woff(@family, @family-suffix) when (@use-woff = true) {
12
+ src+: font-url('@{font-folder}/KaTeX_@{family}-@{family-suffix}.woff') format('woff')
13
+ }
14
+
15
+ .use-ttf(@family, @family-suffix) when (@use-ttf = true) {
16
+ src+: font-url('@{font-folder}/KaTeX_@{family}-@{family-suffix}.ttf') format('ttf')
17
+ }
18
+
19
+ .generate-suffix(@weight, @style) when (@weight = normal) and (@style = normal) {
20
+ @suffix: 'Regular';
21
+ }
22
+ .generate-suffix(@weight, @style) when (@weight = normal) and (@style = italic) {
23
+ @suffix: 'Italic';
24
+ }
25
+ .generate-suffix(@weight, @style) when (@weight = bold) and (@style = normal) {
26
+ @suffix: 'Bold';
27
+ }
28
+ .generate-suffix(@weight, @style) when (@weight = bold) and (@style = italic) {
29
+ @suffix: 'BoldItalic';
30
+ }
31
+
32
+ .font-face(@family, @weight, @style) {
33
+ .generate-suffix(@weight, @style);
34
+ @font-face {
35
+ font-family: 'KaTeX_@{family}';
36
+ .use-eot(@family, @suffix);
37
+ .use-woff(@family, @suffix);
38
+ .use-ttf(@family, @suffix);
39
+ font-weight: @weight;
40
+ font-style: @style;
41
+ }
42
+ }
43
+
44
+ .font-face('AMS', normal, normal);
45
+ .font-face('Caligraphic', bold, normal);
46
+ .font-face('Caligraphic', normal, normal);
47
+ .font-face('Fraktur', bold, normal);
48
+ .font-face('Fraktur', normal, normal);
49
+ .font-face('Greek', bold, normal);
50
+ .font-face('Greek', bold, italic);
51
+ .font-face('Greek', normal, italic);
52
+ .font-face('Greek', normal, normal);
53
+ .font-face('Main', bold, normal);
54
+ .font-face('Main', normal, italic);
55
+ .font-face('Main', normal, normal);
56
+ .font-face('Math', bold, italic);
57
+ .font-face('Math', normal, italic);
58
+ .font-face('Math', normal, normal);
59
+ .font-face('SansSerif', bold, normal);
60
+ .font-face('SansSerif', normal, italic);
61
+ .font-face('SansSerif', normal, normal);
62
+ .font-face('Script', normal, normal);
63
+ .font-face('Size1', normal, normal);
64
+ .font-face('Size2', normal, normal);
65
+ .font-face('Size3', normal, normal);
66
+ .font-face('Size4', normal, normal);
67
+ .font-face('Typewriter', normal, normal);
@@ -0,0 +1,429 @@
1
+ @import "fonts.less";
2
+
3
+ .katex {
4
+ font: normal 1.21em KaTeX_Main;
5
+ line-height: 1.2;
6
+ white-space: nowrap;
7
+
8
+ .katex-inner {
9
+ // Making .katex inline-block allows line breaks before and after,
10
+ // which is undesireable ("to $x$,"). Instead, adjust the .katex-inner
11
+ // style and put nowrap on the inline .katex element.
12
+ display: inline-block;
13
+ }
14
+
15
+ .base {
16
+ display: inline-block;
17
+ }
18
+
19
+ .strut {
20
+ display: inline-block;
21
+ }
22
+
23
+ .mathit {
24
+ font-family: KaTeX_Math;
25
+ font-style: italic;
26
+ }
27
+
28
+ .amsrm {
29
+ font-family: KaTeX_AMS;
30
+ }
31
+
32
+ // This value is also used in fontMetrics.js, if you change it make sure the
33
+ // values match.
34
+ @ptperem: 10.0;
35
+ @nulldelimiterspace: 1.2em / @ptperem;
36
+
37
+ @thinspace: 0.16667em;
38
+ @mediumspace: 0.22222em;
39
+ @thickspace: 0.27778em;
40
+
41
+ .textstyle {
42
+ > .mord {
43
+ & + .mord {}
44
+ & + .mop { margin-left: @thinspace; }
45
+ & + .mbin { margin-left: @mediumspace; }
46
+ & + .mrel { margin-left: @thickspace; }
47
+ & + .mopen {}
48
+ & + .mclose {}
49
+ & + .mpunct {}
50
+ & + .minner { margin-left: @thinspace; }
51
+ }
52
+
53
+ > .mop {
54
+ & + .mord { margin-left: @thinspace; }
55
+ & + .mop { margin-left: @thinspace; }
56
+ & + .mbin {}
57
+ & + .mrel { margin-left: @thickspace; }
58
+ & + .mopen {}
59
+ & + .mclose {}
60
+ & + .mpunct {}
61
+ & + .minner { margin-left: @thinspace; }
62
+ }
63
+
64
+ > .mbin {
65
+ & + .mord { margin-left: @mediumspace; }
66
+ & + .mop { margin-left: @mediumspace; }
67
+ & + .mbin {}
68
+ & + .mrel {}
69
+ & + .mopen { margin-left: @mediumspace; }
70
+ & + .mclose {}
71
+ & + .mpunct {}
72
+ & + .minner { margin-left: @mediumspace; }
73
+ }
74
+
75
+ > .mrel {
76
+ & + .mord { margin-left: @thickspace; }
77
+ & + .mop { margin-left: @thickspace; }
78
+ & + .mbin {}
79
+ & + .mrel {}
80
+ & + .mopen { margin-left: @thickspace; }
81
+ & + .mclose {}
82
+ & + .mpunct {}
83
+ & + .minner { margin-left: @thickspace; }
84
+ }
85
+
86
+ > .mopen {
87
+ & + .mord {}
88
+ & + .mop {}
89
+ & + .mbin {}
90
+ & + .mrel {}
91
+ & + .mopen {}
92
+ & + .mclose {}
93
+ & + .mpunct {}
94
+ & + .minner {}
95
+ }
96
+
97
+ > .mclose {
98
+ & + .mord {}
99
+ & + .mop { margin-left: @thinspace; }
100
+ & + .mbin { margin-left: @mediumspace; }
101
+ & + .mrel { margin-left: @thickspace; }
102
+ & + .mopen {}
103
+ & + .mclose {}
104
+ & + .mpunct {}
105
+ & + .minner { margin-left: @thinspace; }
106
+ }
107
+
108
+ > .mpunct {
109
+ & + .mord { margin-left: @thinspace; }
110
+ & + .mop { margin-left: @thinspace; }
111
+ & + .mbin {}
112
+ & + .mrel { margin-left: @thinspace; }
113
+ & + .mopen { margin-left: @thinspace; }
114
+ & + .mclose { margin-left: @thinspace; }
115
+ & + .mpunct { margin-left: @thinspace; }
116
+ & + .minner { margin-left: @thinspace; }
117
+ }
118
+
119
+ > .minner {
120
+ & + .mord { margin-left: @thinspace; }
121
+ & + .mop { margin-left: @thinspace; }
122
+ & + .mbin { margin-left: @mediumspace; }
123
+ & + .mrel { margin-left: @thickspace; }
124
+ & + .mopen { margin-left: @thinspace; }
125
+ & + .mclose {}
126
+ & + .mpunct { margin-left: @thinspace; }
127
+ & + .minner { margin-left: @thinspace; }
128
+ }
129
+ }
130
+
131
+ .mord {
132
+ & + .mop { margin-left: @thinspace; }
133
+ }
134
+
135
+ .mop {
136
+ & + .mord { margin-left: @thinspace; }
137
+ & + .mop { margin-left: @thinspace; }
138
+ }
139
+
140
+ .mclose {
141
+ & + .mop { margin-left: @thinspace; }
142
+ }
143
+
144
+ .minner {
145
+ & + .mop { margin-left: @thinspace; }
146
+ }
147
+
148
+ .reset-textstyle.textstyle { font-size: 1em; }
149
+ .reset-textstyle.scriptstyle { font-size: 0.7em; }
150
+ .reset-textstyle.scriptscriptstyle { font-size: 0.5em; }
151
+
152
+ .reset-scriptstyle.textstyle { font-size: 1.42857em; }
153
+ .reset-scriptstyle.scriptstyle { font-size: 1em; }
154
+ .reset-scriptstyle.scriptscriptstyle { font-size: 0.71429em; }
155
+
156
+ .reset-scriptscriptstyle.textstyle { font-size: 2em; }
157
+ .reset-scriptscriptstyle.scriptstyle { font-size: 1.4em; }
158
+ .reset-scriptscriptstyle.scriptscriptstyle { font-size: 1em; }
159
+
160
+ .style-wrap {
161
+ position: relative;
162
+ }
163
+
164
+ .vlist {
165
+ display: inline-block;
166
+
167
+ > span {
168
+ display: block;
169
+ height: 0;
170
+ position: relative;
171
+
172
+ > span {
173
+ display: inline-block;
174
+ }
175
+ }
176
+
177
+ .baseline-fix {
178
+ display: inline-table;
179
+ table-layout: fixed;
180
+ }
181
+ }
182
+
183
+ .msupsub {
184
+ text-align: left;
185
+ }
186
+
187
+ .mfrac {
188
+ > span > span {
189
+ text-align: center;
190
+ }
191
+
192
+ .frac-line {
193
+ width: 100%;
194
+
195
+ &:before {
196
+ border-bottom-style: solid;
197
+ border-bottom-width: 1px;
198
+ content: "";
199
+ display: block;
200
+ }
201
+
202
+ &:after {
203
+ border-bottom-style: solid;
204
+ border-bottom-width: 0.04em;
205
+ content: "";
206
+ display: block;
207
+ margin-top: -1px;
208
+ }
209
+ }
210
+ }
211
+
212
+ .mspace {
213
+ display: inline-block;
214
+
215
+ &.negativethinspace {
216
+ margin-left: -@thinspace;
217
+ }
218
+
219
+ &.thinspace {
220
+ width: @thinspace;
221
+ }
222
+
223
+ &.mediumspace {
224
+ width: @mediumspace;
225
+ }
226
+
227
+ &.thickspace {
228
+ width: @thickspace;
229
+ }
230
+
231
+ &.enspace {
232
+ width: 0.5em;
233
+ }
234
+
235
+ &.quad {
236
+ width: 1em;
237
+ }
238
+
239
+ &.qquad {
240
+ width: 2em;
241
+ }
242
+ }
243
+
244
+ .llap,
245
+ .rlap {
246
+ width: 0;
247
+ position: relative;
248
+
249
+ > .inner {
250
+ position: absolute;
251
+ }
252
+
253
+ > .fix {
254
+ display: inline-block;
255
+ }
256
+ }
257
+
258
+ .llap > .inner {
259
+ right: 0;
260
+ }
261
+
262
+ .rlap > .inner {
263
+ left: 0;
264
+ }
265
+
266
+ .katex-logo {
267
+ .a {
268
+ font-size: 0.75em;
269
+ margin-left: -0.32em;
270
+ position: relative;
271
+ top: -0.2em;
272
+ }
273
+ .t {
274
+ margin-left: -0.23em;
275
+ }
276
+ .e {
277
+ margin-left: -0.1667em;
278
+ position: relative;
279
+ top: 0.2155em;
280
+ }
281
+ .x {
282
+ margin-left: -0.125em;
283
+ }
284
+ }
285
+
286
+ .rule {
287
+ display: inline-block;
288
+ border-style: solid;
289
+ }
290
+
291
+ .overline {
292
+
293
+ .overline-line {
294
+ width: 100%;
295
+
296
+ &:before {
297
+ border-bottom-style: solid;
298
+ border-bottom-width: 1px;
299
+ content: "";
300
+ display: block;
301
+ }
302
+
303
+ &:after {
304
+ border-bottom-style: solid;
305
+ border-bottom-width: 0.04em;
306
+ content: "";
307
+ display: block;
308
+ margin-top: -1px;
309
+ }
310
+ }
311
+ }
312
+
313
+ .sqrt {
314
+ > .sqrt-sign {
315
+ position: relative;
316
+ }
317
+
318
+ .sqrt-line {
319
+ width: 100%;
320
+
321
+ &:before {
322
+ border-bottom-style: solid;
323
+ border-bottom-width: 1px;
324
+ content: "";
325
+ display: block;
326
+ }
327
+
328
+ &:after {
329
+ border-bottom-style: solid;
330
+ border-bottom-width: 0.04em;
331
+ content: "";
332
+ display: block;
333
+ margin-top: -1px;
334
+ }
335
+ }
336
+ }
337
+
338
+ .sizing, .fontsize-ensurer {
339
+ display: inline-block;
340
+
341
+ @size1: 0.5;
342
+ @size2: 0.7;
343
+ @size3: 0.8;
344
+ @size4: 0.9;
345
+ @size5: 1.0;
346
+ @size6: 1.2;
347
+ @size7: 1.44;
348
+ @size8: 1.73;
349
+ @size9: 2.07;
350
+ @size10: 2.49;
351
+
352
+ .generate-size-change(@from, @to) {
353
+ &.reset-size@{from}.size@{to} {
354
+ @sizeFromVariable: ~"size@{from}";
355
+ @sizeToVariable: ~"size@{to}";
356
+ font-size: (@@sizeToVariable / @@sizeFromVariable) * 1em;
357
+ }
358
+ }
359
+
360
+ .generate-to-size-change(@from, @currTo) when (@currTo =< 10) {
361
+ .generate-size-change(@from, @currTo);
362
+
363
+ .generate-to-size-change(@from, (@currTo + 1));
364
+ }
365
+
366
+ .generate-from-size-change(@currFrom) when (@currFrom =< 10) {
367
+ .generate-to-size-change(@currFrom, 1);
368
+
369
+ .generate-from-size-change((@currFrom + 1));
370
+ }
371
+
372
+ .generate-from-size-change(1);
373
+ }
374
+
375
+ .delimsizing {
376
+ &.size1 { font-family: KaTeX_Size1; }
377
+ &.size2 { font-family: KaTeX_Size2; }
378
+ &.size3 { font-family: KaTeX_Size3; }
379
+ &.size4 { font-family: KaTeX_Size4; }
380
+
381
+ &.mult {
382
+ .delim-size1 > span {
383
+ font-family: KaTeX_Size1;
384
+ }
385
+ .delim-size4 > span {
386
+ font-family: KaTeX_Size4;
387
+ }
388
+ }
389
+ }
390
+
391
+ .nulldelimiter {
392
+ display: inline-block;
393
+ width: @nulldelimiterspace;
394
+ }
395
+
396
+ .op-symbol {
397
+ position: relative;
398
+
399
+ &.small-op {
400
+ font-family: KaTeX_Size1;
401
+ }
402
+ &.large-op {
403
+ font-family: KaTeX_Size2;
404
+ }
405
+ }
406
+
407
+ .op-limits {
408
+ > .vlist > span {
409
+ text-align: center;
410
+ }
411
+ }
412
+
413
+ .accent {
414
+ > .vlist > span {
415
+ text-align: center;
416
+ }
417
+
418
+ .accent-body > span {
419
+ width: 0;
420
+ }
421
+
422
+ .accent-body.accent-vec > span {
423
+ position: relative;
424
+ // This value is half of the value that the MathJax's makeFF shifts
425
+ // it left. We center it by shifting it half way right again.
426
+ left: 0.326em;
427
+ }
428
+ }
429
+ }