1 ### standard glyphs, may be modifed at runtime by importing glyphs
3 import svg
# don't use glyphs in anything that gets imported into svg.py!
5 # things that get attached to Curves as marks should assume that the line is horizontal, points to the right, and passes through 0
6 # these marks are effectively like Pins at (0,0)
8 farrowhead
= svg
.SVG("path", "M0 0L-0.5 -1.2 3 0 -0.5 1.2 0 0Z", stroke
="none", fill
="black")
9 farrowhead
.repr = "<farrowhead>"
11 barrowhead
= svg
.SVG("path", "M0 0L0.5 -1.2 -3 0 0.5 1.2 0 0Z", stroke
="none", fill
="black")
12 barrowhead
.repr = "<barrowhead>"
14 tick
= svg
.SVG("path", "M0 -1.5L0 1.5")
17 minitick
= svg
.SVG("path", "M0 -0.75L0 0.75")
18 minitick
.repr = "<minitick>"
20 frtick
= svg
.SVG("path", "M0 0L0 1.5")
21 frtick
.repr = "<frtick>"
23 frminitick
= svg
.SVG("path", "M0 0L0 0.75")
24 frminitick
.repr = "<frminitick>"
26 ##############################################################################
28 # Map from standard LaTeX names to Unicode equivalents
29 # Values came from Steve's LaTeX-to-MathML translator (still organized like his page)
30 # Copyright (c) 2006 Steve Cheng <stevecheng@users.sourceforge.net>
31 # See http://www.gold-saucer.org/mathml/greasemonkey/dist/display-latex for details
38 "cdots": u
"\u00b7\u00b7\u00b7",
39 "dotsb": u
"\u00b7\u00b7\u00b7",
41 "dotsi": u
"\u22c5\u22c5\u22c5",
42 "dotsm": u
"\u22c5\u22c5\u22c5",
51 "lmoustache": u
"\u23b0",
57 "rmoustache": u
"\u23b1",
60 # TeX operator symbols
63 "barwedge": u
"\u22bc",
65 "bigtriangledown": u
"\u25bd",
66 "bigtriangleup": u
"\u25b3",
68 "boxminus": u
"\u229f",
70 "boxtimes": u
"\u22a0",
75 "centerdot": u
"\u00b7",
77 "circledast": u
"\u229b",
78 "circledcirc": u
"\u229a",
79 "circleddash": u
"\u229d",
82 "curlyvee": u
"\u22ce",
83 "curlywedge": u
"\u22cf",
88 "divideontimes": u
"\u22c7",
90 "doublebarwedge": u
"\u2306",
91 "doublecap": u
"\u22d2",
92 "doublecup": u
"\u22d3",
94 "intercal": u
"\u22ba",
96 "leftthreetimes": u
"\u22cb",
107 "rightthreetimes": u
"\u22cc",
109 "setminus": u
"\u2216",
110 "smallsetminus": u
"\u2216",
115 "triangleleft": u
"\u25c1",
116 "triangleright": u
"\u25b7",
123 # operator characters
135 "bigodot": u
"\u2a00",
136 "bigoplus": u
"\u2a01",
137 "bigotimes": u
"\u2a02",
138 "bigsqcup": u
"\u2a06",
139 "biguplus": u
"\u2a04",
141 "bigwedge": u
"\u22c0",
146 "smallint": u
"\u222b",
149 # miscellaneous simple symbols
151 "backprime": u
"\u2035",
152 "bigstar": u
"\u2605",
153 "blacklozenge": u
"\u29eb",
154 "blacksquare": u
"\u25aa",
155 "blacktriangle": u
"\u25b4",
156 "blacktriangledown": u
"\u25be",
158 "clubsuit": u
"\u2663",
159 "diagdown": u
"\u2572",
161 "diamondsuit": u
"\u2662",
162 "emptyset": u
"\u2205",
166 "heartsuit": u
"\u2661",
169 "lozenge": u
"\u25ca",
170 "measuredangle": u
"\u2221",
172 "laplacian": u
"\u2206", # why is this missing from LaTeX?
173 "natural": u
"\u266e",
175 "nexists": u
"\u2204",
177 "qedsymbol": u
"\u25a0",
179 "spadesuit": u
"\u2660",
180 "sphericalangle": u
"\u2222",
184 "triangle": u
"\u25b5",
185 "triangledown": u
"\u25bf",
186 "varnothing": u
"\u2205",
188 # other alphabetic symbols
192 "circledS": u
"\u24c8",
193 "complement": u
"\u2201",
204 "partial": u
"\u2202",
210 "approxeq": u
"\u224a",
212 "backsim": u
"\u223d",
213 "backsimeq": u
"\u22cd",
218 "curlyeqprec": u
"\u22de",
219 "curlyeqsucc": u
"\u22df",
221 "doteqdot": u
"\u2251",
224 "eqslantgtr": u
"\u2a96",
225 "eqslantless": u
"\u2a95",
227 "fallingdotseq": u
"\u2252",
231 "geqslant": u
"\u2a7e",
235 "gnapprox": u
"\u2a8a",
239 "gtrapprox": u
"\u2a86",
240 "gtreqless": u
"\u22db",
241 "gtreqqless": u
"\u2a8c",
242 "gtrless": u
"\u2277",
244 "gvertneqq": u
"\u2269",
248 "leqslant": u
"\u2a7d",
249 "lessapprox": u
"\u2a85",
250 "lesseqgtr": u
"\u22da",
251 "lesseqqgtr": u
"\u2a8b",
252 "lessgtr": u
"\u2276",
253 "lesssim": u
"\u2272",
256 "lnapprox": u
"\u2a89",
260 "lvertneqq": u
"\u2268",
266 "ngeqslant": u
"\u2a7e",
270 "nleqslant": u
"\u2a7d",
273 "npreceq": u
"\u2aaf",
276 "nsucceq": u
"\u2ab0",
278 "precapprox": u
"\u2ab7",
279 "preccurlyeq": u
"\u227c",
281 "precnapprox": u
"\u2ab9",
282 "precneqq": u
"\u2ab5",
283 "precnsim": u
"\u22e8",
284 "precsim": u
"\u227e",
285 "risingdotseq": u
"\u2253",
289 "succapprox": u
"\u2ab8",
290 "succcurlyeq": u
"\u227d",
292 "succnapprox": u
"\u2aba",
293 "succneqq": u
"\u2ab6",
294 "succnsim": u
"\u22e9",
295 "succsim": u
"\u227f",
296 "thickapprox": u
"\u2248",
297 "thicksim": u
"\u223c",
298 "triangleq": u
"\u225c",
301 "backepsilon": u
"\u03f6",
302 "because": u
"\u2235",
303 "between": u
"\u226c",
304 "blacktriangleleft": u
"\u25c0",
305 "blacktriangleright": u
"\u25b6",
315 "nparallel": u
"\u2226",
316 "nshortmid": u
"\u2224",
317 "nshortparallel": u
"\u2226",
318 "subseteq": u
"\u2286",
319 "nsubseteq": u
"\u2288",
320 "nsubseteqq": u
"\u2ac5",
321 "supseteq": u
"\u2287",
322 "nsupseteq": u
"\u2289",
323 "nsupseteqq": u
"\u2ac6",
324 "ntriangleleft": u
"\u22ea",
325 "ntrianglelefteq": u
"\u22ec",
326 "ntriangleright": u
"\u22eb",
327 "ntrianglerighteq": u
"\u22ed",
333 "parallel": u
"\u2225",
335 "pitchfork": u
"\u22d4",
337 "shortmid": u
"\u2223",
338 "shortparallel": u
"\u2225",
339 "smallfrown": u
"\u2322",
340 "smallsmile": u
"\u2323",
342 "sqsubset": u
"\u228f",
343 "sqsubseteq": u
"\u2291",
344 "sqsupset": u
"\u2290",
345 "sqsupseteq": u
"\u2292",
348 "subseteq": u
"\u2286",
349 "subseteqq": u
"\u2ac5",
350 "subsetneq": u
"\u228a",
351 "subsetneqq": u
"\u2acb",
354 "supseteq": u
"\u2287",
355 "supseteqq": u
"\u2ac6",
356 "supsetneq": u
"\u228b",
357 "supsetneqq": u
"\u2acc",
358 "therefore": u
"\u2234",
359 "trianglelefteq": u
"\u22b4",
360 "trianglerighteq": u
"\u22b5",
361 "varpropto": u
"\u221d",
362 "varsubsetneq": u
"\u228a",
363 "varsubsetneqq": u
"\u2acb",
364 "varsupsetneq": u
"\u228b",
365 "varsupsetneqq": u
"\u2acc",
366 "vartriangle": u
"\u25b5",
367 "vartriangleleft": u
"\u22b2",
368 "vartriangleright": u
"\u22b3",
375 "downarrow": u
"\u2193",
376 "Downarrow": u
"\u21d3",
377 "uparrow": u
"\u2191",
378 "Uparrow": u
"\u21d1",
379 "updownarrow": u
"\u2195",
380 "Updownarrow": u
"\u21d5",
381 "curvearrowleft": u
"\u21b6",
382 "curvearrowright": u
"\u21b7",
383 "downdownarrows": u
"\u21ca",
384 "downharpoonleft": u
"\u21c3",
385 "downharpoonright": u
"\u21c2",
387 "hookleftarrow": u
"\u21a9",
388 "hookrightarrow": u
"\u21aa",
389 "leftarrow": u
"\u2190",
390 "Leftarrow": u
"\u21d0",
391 "leftarrowtail": u
"\u21a2",
392 "leftharpoondown": u
"\u21bd",
393 "leftharpoonup": u
"\u21bc",
394 "leftleftarrows": u
"\u21c7",
395 "leftrightarrow": u
"\u2194",
396 "leftrightarrows": u
"\u21c6",
397 "leftrightharpoons": u
"\u21cb",
398 "leftrightsquigarrow": u
"\u21ad",
399 "Lleftarrow": u
"\u21da",
400 "longleftarrow": u
"\u27f5",
401 "Longleftarrow": u
"\u27f8",
402 "longleftrightarrow": u
"\u27f7",
403 "Longleftrightarrow": u
"\u27fa",
404 "looparrowleft": u
"\u21ab",
405 "looparrowright": u
"\u21ac",
408 "multimap": u
"\u22b8",
409 "nearrow": u
"\u2197",
410 "nleftarrow": u
"\u219a",
411 "nLeftarrow": u
"\u21cd",
412 "nleftrightarrow": u
"\u21ae",
413 "nLeftrightarrow": u
"\u21ce",
414 "nrightarrow": u
"\u219b",
415 "nRightarrow": u
"\u21cf",
416 "nwarrow": u
"\u2196",
417 "restriction": u
"\u21be",
418 "rightarrow": u
"\u2192",
419 "Rightarrow": u
"\u21d2",
420 "rightarrowtail": u
"\u21a3",
421 "rightharpoondown": u
"\u21c1",
422 "rightharpoonup": u
"\u21c0",
423 "rightleftarrows": u
"\u21c4",
424 "rightleftharpoons": u
"\u21cc",
425 "rightrightarrows": u
"\u21c9",
426 "rightsquigarrow": u
"\u219d",
427 "Rrightarrow": u
"\u21db",
429 "searrow": u
"\u2198",
430 "swarrow": u
"\u2199",
432 "twoheadleftarrow": u
"\u219e",
433 "twoheadrightarrow": u
"\u21a0",
434 "upharpoonleft": u
"\u21bf",
435 "upharpoonright": u
"\u21be",
436 "upuparrows": u
"\u21c8",
438 # accents and braces (use after the letter you want to modify; not
439 # all of these work well, and they usually don't work at all in the
440 # interactive viewer)
452 "underbrace": u
"\ufe38",
453 "overbrace": u
"\ufe37",
454 "underline": u
"\u0332",
455 "overline": u
"\u00af",
456 "widetilde": u
"\u0303",
457 "widehat": u
"\u0302",
460 # greek alphabet (for math)
466 "digamma": u
"\u03dd",
467 "epsilon": u
"\u03f5",
491 "upsilon": u
"\u03c5",
492 "Upsilon": u
"\u03d2",
493 "varepsilon": u
"\u03b5",
494 "varkappa": u
"\u03f0",
498 "varsigma": u
"\u03c2",
499 "vartheta": u
"\u03d1",
506 # Greek alphabet (uppercase)
511 "Epsilon": u
"\u0395",
521 "Omicron": u
"\u039f",
526 "Upsilon": u
"\u03a5",
532 # Greek alphabet (lowercase)
537 "epsilon": u
"\u03b5",
547 "omicron": u
"\u03bf",
550 "finalsigma": u
"\u03c2",
553 "upsilon": u
"\u03c5",
572 "FinalKaf": u
"\u05da",
575 "FinalMem": u
"\u05dd",
577 "FinalNun": u
"\u05df",
581 "FinalPe": u
"\u05e3",
583 "FinalTsadi": u
"\u05e5",
592 # Cyrillic alphabet (uppercase)
619 "HardSign": u
"\u042a",
621 "SoftSign": u
"\u042c",
626 # Cyrillic alphabet (lowercase)
653 "hardsign": u
"\u044a",
655 "softsign": u
"\u044c",
671 "sterling": u
"\u00a3",