temml 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +44 -0
  3. package/contrib/auto-render/README.md +89 -0
  4. package/contrib/auto-render/auto-render.js +128 -0
  5. package/contrib/auto-render/dist/auto-render.js +217 -0
  6. package/contrib/auto-render/dist/auto-render.min.js +1 -0
  7. package/contrib/auto-render/splitAtDelimiters.js +84 -0
  8. package/contrib/auto-render/test/auto-render-spec.js +234 -0
  9. package/contrib/auto-render/test/auto-render.js +217 -0
  10. package/contrib/auto-render/test/test_page.html +59 -0
  11. package/contrib/mhchem/README.md +26 -0
  12. package/contrib/mhchem/mhchem.js +1705 -0
  13. package/contrib/mhchem/mhchem.min.js +1 -0
  14. package/contrib/physics/README.md +20 -0
  15. package/contrib/physics/physics.js +131 -0
  16. package/contrib/texvc/README.md +23 -0
  17. package/contrib/texvc/texvc.js +61 -0
  18. package/dist/Temml-Asana.css +201 -0
  19. package/dist/Temml-Latin-Modern.css +216 -0
  20. package/dist/Temml-Libertinus.css +214 -0
  21. package/dist/Temml-Local.css +194 -0
  22. package/dist/Temml-STIX2.css +203 -0
  23. package/dist/Temml.woff2 +0 -0
  24. package/dist/temml.cjs +13122 -0
  25. package/dist/temml.js +11225 -0
  26. package/dist/temml.min.js +1 -0
  27. package/dist/temml.mjs +13120 -0
  28. package/dist/temmlPostProcess.js +70 -0
  29. package/package.json +34 -0
  30. package/src/Lexer.js +121 -0
  31. package/src/MacroExpander.js +437 -0
  32. package/src/Namespace.js +107 -0
  33. package/src/ParseError.js +64 -0
  34. package/src/Parser.js +977 -0
  35. package/src/Settings.js +49 -0
  36. package/src/SourceLocation.js +29 -0
  37. package/src/Style.js +144 -0
  38. package/src/Token.js +40 -0
  39. package/src/buildMathML.js +235 -0
  40. package/src/constants.js +25 -0
  41. package/src/defineEnvironment.js +25 -0
  42. package/src/defineFunction.js +69 -0
  43. package/src/defineMacro.js +11 -0
  44. package/src/domTree.js +185 -0
  45. package/src/environments/array.js +791 -0
  46. package/src/environments/cd.js +252 -0
  47. package/src/environments.js +8 -0
  48. package/src/functions/accent.js +127 -0
  49. package/src/functions/accentunder.js +38 -0
  50. package/src/functions/arrow.js +204 -0
  51. package/src/functions/cancelto.js +36 -0
  52. package/src/functions/char.js +33 -0
  53. package/src/functions/color.js +253 -0
  54. package/src/functions/cr.js +46 -0
  55. package/src/functions/def.js +259 -0
  56. package/src/functions/delimsizing.js +304 -0
  57. package/src/functions/enclose.js +193 -0
  58. package/src/functions/envTag.js +38 -0
  59. package/src/functions/environment.js +59 -0
  60. package/src/functions/font.js +123 -0
  61. package/src/functions/genfrac.js +333 -0
  62. package/src/functions/hbox.js +29 -0
  63. package/src/functions/horizBrace.js +32 -0
  64. package/src/functions/href.js +90 -0
  65. package/src/functions/html.js +95 -0
  66. package/src/functions/includegraphics.js +131 -0
  67. package/src/functions/kern.js +75 -0
  68. package/src/functions/label.js +29 -0
  69. package/src/functions/lap.js +75 -0
  70. package/src/functions/math.js +40 -0
  71. package/src/functions/mathchoice.js +41 -0
  72. package/src/functions/mclass.js +201 -0
  73. package/src/functions/multiscript.js +91 -0
  74. package/src/functions/not.js +46 -0
  75. package/src/functions/op.js +338 -0
  76. package/src/functions/operatorname.js +139 -0
  77. package/src/functions/ordgroup.js +9 -0
  78. package/src/functions/phantom.js +73 -0
  79. package/src/functions/pmb.js +31 -0
  80. package/src/functions/raise.js +68 -0
  81. package/src/functions/ref.js +28 -0
  82. package/src/functions/relax.js +16 -0
  83. package/src/functions/rule.js +52 -0
  84. package/src/functions/sizing.js +64 -0
  85. package/src/functions/smash.js +66 -0
  86. package/src/functions/sqrt.js +31 -0
  87. package/src/functions/styling.js +58 -0
  88. package/src/functions/supsub.js +135 -0
  89. package/src/functions/symbolsOp.js +53 -0
  90. package/src/functions/symbolsOrd.js +102 -0
  91. package/src/functions/symbolsSpacing.js +53 -0
  92. package/src/functions/tag.js +8 -0
  93. package/src/functions/text.js +75 -0
  94. package/src/functions/tip.js +63 -0
  95. package/src/functions/toggle.js +13 -0
  96. package/src/functions/verb.js +33 -0
  97. package/src/functions.js +57 -0
  98. package/src/linebreaking.js +159 -0
  99. package/src/macros.js +708 -0
  100. package/src/mathMLTree.js +175 -0
  101. package/src/parseNode.js +42 -0
  102. package/src/parseTree.js +40 -0
  103. package/src/postProcess.js +57 -0
  104. package/src/replace.js +225 -0
  105. package/src/stretchy.js +66 -0
  106. package/src/svg.js +110 -0
  107. package/src/symbols.js +972 -0
  108. package/src/tree.js +50 -0
  109. package/src/unicodeAccents.js +16 -0
  110. package/src/unicodeScripts.js +119 -0
  111. package/src/unicodeSupOrSub.js +108 -0
  112. package/src/unicodeSymbolBuilder.js +31 -0
  113. package/src/unicodeSymbols.js +320 -0
  114. package/src/units.js +109 -0
  115. package/src/utils.js +109 -0
  116. package/src/variant.js +103 -0
  117. package/temml.js +181 -0
@@ -0,0 +1,203 @@
1
+ /*
2
+ XITS is released under the SIL Open Font License.
3
+ See https://github.com/stipub/stixfonts/blob/master/OFL.txt details.
4
+
5
+ The STIX2 WOFF font has been obtained from
6
+ https://github.com/stipub/stixfonts
7
+ */
8
+
9
+ @font-face {
10
+ font-family: STIX2;
11
+ src: local('STIXTwoMath-Regular'),
12
+ url('./STIXTwoMath-Regular.woff2');
13
+ }
14
+
15
+ math {
16
+ font-style: normal;
17
+ font-weight: normal;
18
+ line-height: normal;
19
+ font-size-adjust: none;
20
+ text-indent: 0;
21
+ text-transform: none;
22
+ letter-spacing: normal;
23
+ word-wrap: normal;
24
+ direction: ltr;
25
+ }
26
+
27
+ math * {
28
+ border-color: currentColor;
29
+ }
30
+
31
+ mtext {
32
+ font-family: STIX2;
33
+ }
34
+
35
+ math {
36
+ font-family: STIX2, math;
37
+ }
38
+
39
+ *.mathscr {
40
+ font-feature-settings: 'ss01';
41
+ }
42
+
43
+ .oldstylenums {
44
+ font-family: "Cambria Math", math;
45
+ font-feature-settings: 'onum';
46
+ }
47
+
48
+ mo.tml-prime {
49
+ font-feature-settings: 'ss04';
50
+ }
51
+
52
+ /* AMS environment auto-numbering via CSS counter. */
53
+ .tml-eqn::before {
54
+ counter-increment: tmlEqnNo;
55
+ content: "(" counter(tmlEqnNo) ")";
56
+ }
57
+
58
+ body {
59
+ counter-reset: tmlEqnNo;
60
+ }
61
+
62
+ /* Environment arrays */
63
+
64
+ /* Environments that addjot to row spacing */
65
+ mtable.tml-jot > mtr > mtd {
66
+ padding-top: calc(0.5ex + 0.09em);
67
+ padding-bottom: calc(0.5ex + 0.09em);
68
+ }
69
+
70
+ /* Zero column gap for {alignat}, {split}, etc */
71
+ mtable.tml-abut > mtr > mtd,
72
+ mtable.tml-align > mtr > mtd:nth-child(odd),
73
+ mtable.tml-align-star > mtr > mtd:nth-child(even) {
74
+ padding-left: 0em;
75
+ padding-right: 0em;
76
+ }
77
+
78
+ mtable.tml-align > mtr > mtd:nth-child(even),
79
+ mtable.tml-align-star > mtr > mtd:nth-child(odd) {
80
+ padding-left: 1em;
81
+ padding-right: 0em;
82
+ }
83
+
84
+ mtable.tml-align > mtr > mtd:nth-child(1) {
85
+ padding-left: 0em;
86
+ }
87
+
88
+ mtable.tml-align > mtr > mtd:nth-child(odd),
89
+ mtable.tml-alignat > mtr > mtd:nth-child(odd),
90
+ mtable.tml-aligned > mtr > mtd:nth-child(even) {
91
+ text-align: -webkit-left;
92
+ }
93
+
94
+ mtable.tml-align > mtr > mtd:nth-child(even),
95
+ mtable.tml-alignat > mtr > mtd:nth-child(even),
96
+ mtable.tml-aligned > mtr > mtd:nth-child(odd) {
97
+ text-align: -webkit-right;
98
+ }
99
+
100
+ mtable.tml-cases > mtr > mtd {
101
+ padding-left: 0em;
102
+ padding-right: 0em;
103
+ text-align: -webkit-left;
104
+ }
105
+
106
+ mtable.tml-cases > mtr > mtd:nth-child(2) {
107
+ padding-left: 1em;
108
+ }
109
+
110
+ mtable.tml-small > mtr > mtd {
111
+ padding-top: 0.35ex;
112
+ padding-bottom: 0.35ex;
113
+ padding-left: 0.1389em;
114
+ padding-right: 0.1389em;
115
+ }
116
+
117
+ mtable.tml-subarray > mtr > mtd {
118
+ padding-top: 0em;
119
+ padding-left: 0em;
120
+ }
121
+
122
+ mtable.tml-cd > mtr > mtd {
123
+ padding-left: 0.25em;
124
+ padding-right: 0.25em;
125
+ }
126
+
127
+ mtable > mtr:first-child > mtr > mtd {
128
+ padding-top: 0em;
129
+ }
130
+
131
+ mtable > mtr:last-child > mtr > mtd {
132
+ padding-bottom: 0em;
133
+ }
134
+
135
+ mtable:not(.tml-array) > mtr > mtd:first-child {
136
+ padding-left: 0em;
137
+ }
138
+
139
+ mtable:not(.tml-array) > mtr > mtd:last-child {
140
+ padding-right: 0em;
141
+ }
142
+
143
+ mtr.tml-top-solid > mtd {
144
+ border-top: 0.06em solid;
145
+ }
146
+
147
+ mtr.tml-top-double > mtd {
148
+ border-top: 0.15em double;
149
+ }
150
+
151
+ mtr.tml-top-dashed > mtd {
152
+ border-top: 0.06em dashed;
153
+ }
154
+
155
+ mtr.tml-hline-solid > mtd {
156
+ border-bottom: 0.06em solid;
157
+ }
158
+
159
+ mtr.tml-hline-double > mtd {
160
+ border-bottom: 0.15em double;
161
+ }
162
+
163
+ mtr.tml-hline-dashed > mtd {
164
+ border-bottom: 0.06em dashed;
165
+ }
166
+
167
+ /* MathML-Core does not support <menclose> attributes.
168
+ * So Use background images for \cancel */
169
+ menclose.cancel {
170
+ background:
171
+ linear-gradient(to top left,
172
+ rgba(0,0,0,0) 0%,
173
+ rgba(0,0,0,0) calc(50% - 0.06em),
174
+ rgba(0,0,0,1) 50%,
175
+ rgba(0,0,0,0) calc(50% + 0.06em),
176
+ rgba(0,0,0,0) 100%);
177
+ }
178
+
179
+ menclose.bcancel {
180
+ background:
181
+ linear-gradient(to top right,
182
+ rgba(0,0,0,0) 0%,
183
+ rgba(0,0,0,0) calc(50% - 0.06em),
184
+ rgba(0,0,0,1) 50%,
185
+ rgba(0,0,0,0) calc(50% + 0.06em),
186
+ rgba(0,0,0,0) 100%);
187
+ }
188
+
189
+ menclose.xcancel {
190
+ background:
191
+ linear-gradient(to top left,
192
+ rgba(0,0,0,0) 0%,
193
+ rgba(0,0,0,0) calc(50% - 0.06em),
194
+ rgba(0,0,0,1) 50%,
195
+ rgba(0,0,0,0) calc(50% + 0.06em),
196
+ rgba(0,0,0,0) 100%),
197
+ linear-gradient(to top right,
198
+ rgba(0,0,0,0) 0%,
199
+ rgba(0,0,0,0) calc(50% - 0.06em),
200
+ rgba(0,0,0,1) 50%,
201
+ rgba(0,0,0,0) calc(50% + 0.06em),
202
+ rgba(0,0,0,0) 100%);
203
+ }
Binary file