├── .gitignore ├── assets ├── PT-Sans │ ├── bold-latin.woff2 │ ├── bold-cyrillic.woff2 │ ├── regular-latin.woff2 │ ├── bold-latin-ext.woff2 │ ├── bold-cyrillic-ext.woff2 │ ├── regular-cyrillic.woff2 │ ├── regular-latin-ext.woff2 │ ├── regular-cyrillic-ext.woff2 │ ├── License.txt │ └── index.sass ├── katex │ ├── fonts │ │ ├── KaTeX_Main-Bold.ttf │ │ ├── KaTeX_Main-Bold.woff │ │ ├── KaTeX_AMS-Regular.ttf │ │ ├── KaTeX_AMS-Regular.woff │ │ ├── KaTeX_Fraktur-Bold.ttf │ │ ├── KaTeX_Main-Bold.woff2 │ │ ├── KaTeX_Main-Italic.ttf │ │ ├── KaTeX_Main-Italic.woff │ │ ├── KaTeX_Main-Regular.ttf │ │ ├── KaTeX_Math-Italic.ttf │ │ ├── KaTeX_Math-Italic.woff │ │ ├── KaTeX_AMS-Regular.woff2 │ │ ├── KaTeX_Fraktur-Bold.woff │ │ ├── KaTeX_Fraktur-Bold.woff2 │ │ ├── KaTeX_Fraktur-Regular.ttf │ │ ├── KaTeX_Main-BoldItalic.ttf │ │ ├── KaTeX_Main-Italic.woff2 │ │ ├── KaTeX_Main-Regular.woff │ │ ├── KaTeX_Main-Regular.woff2 │ │ ├── KaTeX_Math-BoldItalic.ttf │ │ ├── KaTeX_Math-Italic.woff2 │ │ ├── KaTeX_SansSerif-Bold.ttf │ │ ├── KaTeX_SansSerif-Bold.woff │ │ ├── KaTeX_Script-Regular.ttf │ │ ├── KaTeX_Script-Regular.woff │ │ ├── KaTeX_Size1-Regular.ttf │ │ ├── KaTeX_Size1-Regular.woff │ │ ├── KaTeX_Size1-Regular.woff2 │ │ ├── KaTeX_Size2-Regular.ttf │ │ ├── KaTeX_Size2-Regular.woff │ │ ├── KaTeX_Size2-Regular.woff2 │ │ ├── KaTeX_Size3-Regular.ttf │ │ ├── KaTeX_Size3-Regular.woff │ │ ├── KaTeX_Size3-Regular.woff2 │ │ ├── KaTeX_Size4-Regular.ttf │ │ ├── KaTeX_Size4-Regular.woff │ │ ├── KaTeX_Size4-Regular.woff2 │ │ ├── KaTeX_Caligraphic-Bold.ttf │ │ ├── KaTeX_Caligraphic-Bold.woff │ │ ├── KaTeX_Fraktur-Regular.woff │ │ ├── KaTeX_Fraktur-Regular.woff2 │ │ ├── KaTeX_Main-BoldItalic.woff │ │ ├── KaTeX_Main-BoldItalic.woff2 │ │ ├── KaTeX_Math-BoldItalic.woff │ │ ├── KaTeX_Math-BoldItalic.woff2 │ │ ├── KaTeX_SansSerif-Bold.woff2 │ │ ├── KaTeX_SansSerif-Italic.ttf │ │ ├── KaTeX_SansSerif-Italic.woff │ │ ├── KaTeX_SansSerif-Regular.ttf │ │ ├── KaTeX_Script-Regular.woff2 │ │ ├── KaTeX_Caligraphic-Bold.woff2 │ │ ├── KaTeX_Caligraphic-Regular.ttf │ │ ├── KaTeX_Caligraphic-Regular.woff │ │ ├── KaTeX_SansSerif-Italic.woff2 │ │ ├── KaTeX_SansSerif-Regular.woff │ │ ├── KaTeX_SansSerif-Regular.woff2 │ │ ├── KaTeX_Typewriter-Regular.ttf │ │ ├── KaTeX_Typewriter-Regular.woff │ │ ├── KaTeX_Typewriter-Regular.woff2 │ │ └── KaTeX_Caligraphic-Regular.woff2 │ ├── contrib │ │ ├── mathtex-script-type.mjs │ │ ├── mathtex-script-type.min.js │ │ ├── copy-tex.min.js │ │ ├── auto-render.min.js │ │ ├── copy-tex.mjs │ │ ├── mathtex-script-type.js │ │ ├── copy-tex.js │ │ ├── auto-render.mjs │ │ ├── render-a11y-string.min.js │ │ ├── auto-render.js │ │ ├── render-a11y-string.mjs │ │ ├── render-a11y-string.js │ │ └── mhchem.min.js │ ├── README.md │ └── katex.min.css ├── css │ ├── index.sass │ ├── minimal.sass │ ├── sidebar.sass │ └── frame.sass ├── js │ └── toggle-color.js └── fontawesome │ ├── LICENSE.txt │ └── README.md ├── _layouts ├── page.html ├── default.html └── post.html ├── Gemfile ├── 404.html ├── _includes ├── embed.html ├── meta.html ├── menu.html ├── sidebar.html └── head.html ├── archive.html ├── _sass ├── utils.sass ├── layout.sass ├── classes.sass ├── rouge_github.sass ├── rouge_molokai.sass └── basic.sass ├── index.html ├── _posts ├── 2017-03-01-welcome-to-jekyll.md ├── 2017-02-01-markdown-examples.md └── 2017-01-01-advanced-examples.md ├── UNLICENSE.txt ├── _config.yml └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .bundle 3 | .jekyll-cache 4 | .sass-cache 5 | Gemfile.lock 6 | _site 7 | *.gem 8 | -------------------------------------------------------------------------------- /assets/PT-Sans/bold-latin.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/PT-Sans/bold-latin.woff2 -------------------------------------------------------------------------------- /assets/PT-Sans/bold-cyrillic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/PT-Sans/bold-cyrillic.woff2 -------------------------------------------------------------------------------- /assets/PT-Sans/regular-latin.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/PT-Sans/regular-latin.woff2 -------------------------------------------------------------------------------- /assets/PT-Sans/bold-latin-ext.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/PT-Sans/bold-latin-ext.woff2 -------------------------------------------------------------------------------- /assets/PT-Sans/bold-cyrillic-ext.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/PT-Sans/bold-cyrillic-ext.woff2 -------------------------------------------------------------------------------- /assets/PT-Sans/regular-cyrillic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/PT-Sans/regular-cyrillic.woff2 -------------------------------------------------------------------------------- /assets/PT-Sans/regular-latin-ext.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/PT-Sans/regular-latin-ext.woff2 -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Main-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Main-Bold.ttf -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Main-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Main-Bold.woff -------------------------------------------------------------------------------- /_layouts/page.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 |
5 | {% include meta.html post=page %} 6 | {{ content }} 7 |
8 | -------------------------------------------------------------------------------- /assets/PT-Sans/regular-cyrillic-ext.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/PT-Sans/regular-cyrillic-ext.woff2 -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_AMS-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_AMS-Regular.ttf -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_AMS-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_AMS-Regular.woff -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Fraktur-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Fraktur-Bold.ttf -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Main-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Main-Bold.woff2 -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Main-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Main-Italic.ttf -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Main-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Main-Italic.woff -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Main-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Main-Regular.ttf -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Math-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Math-Italic.ttf -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Math-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Math-Italic.woff -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_AMS-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_AMS-Regular.woff2 -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Fraktur-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Fraktur-Bold.woff -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Fraktur-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Fraktur-Bold.woff2 -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Fraktur-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Fraktur-Regular.ttf -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Main-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Main-BoldItalic.ttf -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Main-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Main-Italic.woff2 -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Main-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Main-Regular.woff -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Main-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Main-Regular.woff2 -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Math-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Math-BoldItalic.ttf -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Math-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Math-Italic.woff2 -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_SansSerif-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_SansSerif-Bold.ttf -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_SansSerif-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_SansSerif-Bold.woff -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Script-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Script-Regular.ttf -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Script-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Script-Regular.woff -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Size1-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Size1-Regular.ttf -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Size1-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Size1-Regular.woff -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Size1-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Size1-Regular.woff2 -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Size2-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Size2-Regular.ttf -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Size2-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Size2-Regular.woff -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Size2-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Size2-Regular.woff2 -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Size3-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Size3-Regular.ttf -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Size3-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Size3-Regular.woff -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Size3-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Size3-Regular.woff2 -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Size4-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Size4-Regular.ttf -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Size4-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Size4-Regular.woff -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Size4-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Size4-Regular.woff2 -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Caligraphic-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Caligraphic-Bold.ttf -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Caligraphic-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Caligraphic-Bold.woff -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Fraktur-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Fraktur-Regular.woff -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Fraktur-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Fraktur-Regular.woff2 -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Main-BoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Main-BoldItalic.woff -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Main-BoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Main-BoldItalic.woff2 -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Math-BoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Math-BoldItalic.woff -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Math-BoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Math-BoldItalic.woff2 -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_SansSerif-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_SansSerif-Bold.woff2 -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_SansSerif-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_SansSerif-Italic.ttf -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_SansSerif-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_SansSerif-Italic.woff -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_SansSerif-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_SansSerif-Regular.ttf -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Script-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Script-Regular.woff2 -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Caligraphic-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Caligraphic-Bold.woff2 -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Caligraphic-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Caligraphic-Regular.ttf -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Caligraphic-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Caligraphic-Regular.woff -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_SansSerif-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_SansSerif-Italic.woff2 -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_SansSerif-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_SansSerif-Regular.woff -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_SansSerif-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_SansSerif-Regular.woff2 -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Typewriter-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Typewriter-Regular.ttf -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Typewriter-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Typewriter-Regular.woff -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Typewriter-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Typewriter-Regular.woff2 -------------------------------------------------------------------------------- /assets/katex/fonts/KaTeX_Caligraphic-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklasbuschmann/contrast/HEAD/assets/katex/fonts/KaTeX_Caligraphic-Regular.woff2 -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem "jekyll", "~> 4.4.1" 4 | gem "webrick", "~> 1.9.1" 5 | 6 | group :jekyll_plugins do 7 | gem "jekyll-feed", "~> 0.17" 8 | end 9 | -------------------------------------------------------------------------------- /404.html: -------------------------------------------------------------------------------- 1 | --- 2 | permalink: /404.html 3 | title: "404: Page not found" 4 | layout: default 5 | sitemap: false 6 | --- 7 | 8 |
9 |

Error: Page not found.

10 |
11 | -------------------------------------------------------------------------------- /_includes/embed.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | -------------------------------------------------------------------------------- /assets/css/index.sass: -------------------------------------------------------------------------------- 1 | --- 2 | --- 3 | 4 | @import utils, basic, layout, classes, rouge_github 5 | 6 | body > * 7 | padding: 1.75em calc(42% - 16rem) 8 | padding: clamp(1.5em, 4vw, 1.75em) max(1.5em, calc(42% - 16rem)) 9 | box-shadow: 0 1px gray(12), 0 1em 2em -1em rgba(light(16), .05) 10 | -------------------------------------------------------------------------------- /assets/css/minimal.sass: -------------------------------------------------------------------------------- 1 | --- 2 | --- 3 | 4 | @import utils, basic, layout, rouge_github 5 | 6 | body 7 | padding: 1em calc(40% - 16em) 8 | > * 9 | margin: 1em 1.5em 10 | 11 | header a:hover, footer a:hover, nav a:hover 12 | color: $highlight 13 | text-decoration-color: transparent 14 | -------------------------------------------------------------------------------- /_includes/meta.html: -------------------------------------------------------------------------------- 1 |
2 |

{{ include.post.title }}

3 | {%- assign date_format = site.date_format | default: "%B %d, %Y" -%} 4 | {% if include.post.date %}{% endif %} 5 |
6 | -------------------------------------------------------------------------------- /archive.html: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Archive" 3 | layout: default 4 | --- 5 | 6 |
7 |

{{ include.title | default: page.title }}

8 | 13 |
14 | -------------------------------------------------------------------------------- /_sass/utils.sass: -------------------------------------------------------------------------------- 1 | $font-size: calc(0.8rem + 0.2vw) !default 2 | $font-family: "PT Sans", system-ui, sans-serif !default 3 | $line-height: 1.6 !default 4 | $link: light-dark(#46f, #38f) !default 5 | $highlight: #f08 !default 6 | 7 | @function gray ($percent) 8 | @return rgba(mix(light(60), gray), $percent / 100) 9 | 10 | @function light ($a: 100, $b: false) 11 | @if $a and $b 12 | @return light-dark(light($a), light($b)) 13 | @return hsl(230deg, 18%, $a + 0%) 14 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: "Home" 4 | --- 5 | 6 | {% if site.show_excerpts %} 7 | {% for post in site.posts %} 8 |
9 | {% include meta.html post=post %} 10 | {{ post.excerpt }} 11 | 12 |
13 | {% endfor %} 14 | {% else %} 15 | {% capture source %}{% include_relative archive.html title="Posts" %}{% endcapture %} 16 | {{ source | split: "---" | last }} 17 | {% endif %} 18 | -------------------------------------------------------------------------------- /assets/js/toggle-color.js: -------------------------------------------------------------------------------- 1 | function toggleColor() { 2 | var meta = document.querySelector('meta[name=color-scheme]'); 3 | var dark = meta.getAttribute('content') == 'light dark' ? matchMedia('(prefers-color-scheme: light)').matches : meta.getAttribute('content') == 'light'; 4 | meta.setAttribute('content', dark ? 'dark' : 'light'); 5 | } 6 | 7 | function toggle() { 8 | if (localStorage.getItem('toggle')) 9 | localStorage.removeItem('toggle'); 10 | else 11 | localStorage.setItem('toggle', 1); 12 | toggleColor(); 13 | } 14 | 15 | if (localStorage.getItem('toggle')) 16 | toggleColor(); -------------------------------------------------------------------------------- /_includes/menu.html: -------------------------------------------------------------------------------- 1 | {%- if include.menu -%} 2 | 16 | {%- endif -%} 17 | -------------------------------------------------------------------------------- /_layouts/default.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {% include head.html %} 5 | 6 |
7 | {% unless site.show_minimal and site.navigation and site.external %} 8 |

{{ site.title | escape }}

9 | {% endunless %} 10 | {% include menu.html menu=site.navigation %} 11 | {% include menu.html menu=site.external %} 12 |
13 | 14 | {{ content }} 15 | 16 | {%- if site.footer -%} 17 | 21 | {%- endif -%} 22 | 23 | 24 | -------------------------------------------------------------------------------- /_sass/layout.sass: -------------------------------------------------------------------------------- 1 | body 2 | display: flex 3 | flex-direction: column 4 | min-height: 100vh 5 | margin: 0 6 | box-sizing: border-box 7 | -webkit-text-size-adjust: 100% 8 | 9 | body > header, body > footer 10 | display: flex 11 | flex-wrap: wrap 12 | justify-content: space-between 13 | align-items: center 14 | 15 | header a, footer a 16 | display: inline-block 17 | 18 | footer a 19 | margin: .75em 0 20 | 21 | nav 22 | margin: .5em -1.3em 23 | a 24 | margin: 0 1.3em 25 | svg 26 | font-size: 1.1em 27 | vertical-align: sub 28 | 29 | main nav 30 | font-size: 1.1em 31 | margin: 1.4em 0 32 | div 33 | margin: .5em 0 34 | 35 | header h1 36 | font-size: 1.75em 37 | margin: 0 38 | body > & 39 | font-size: 1.35em 40 | 41 | article, main 42 | flex-grow: 1 43 | -------------------------------------------------------------------------------- /assets/katex/contrib/mathtex-script-type.mjs: -------------------------------------------------------------------------------- 1 | import katex from '../katex.mjs'; 2 | 3 | var scripts = document.body.getElementsByTagName("script"); 4 | scripts = Array.prototype.slice.call(scripts); 5 | scripts.forEach(function (script) { 6 | if (!script.type || !script.type.match(/math\/tex/i)) { 7 | return -1; 8 | } 9 | 10 | var display = script.type.match(/mode\s*=\s*display(;|\s|\n|$)/) != null; 11 | var katexElement = document.createElement(display ? "div" : "span"); 12 | katexElement.setAttribute("class", display ? "equation" : "inline-equation"); 13 | 14 | try { 15 | katex.render(script.text, katexElement, { 16 | displayMode: display 17 | }); 18 | } catch (err) { 19 | //console.error(err); linter doesn't like this 20 | katexElement.textContent = script.text; 21 | } 22 | 23 | script.parentNode.replaceChild(katexElement, script); 24 | }); 25 | -------------------------------------------------------------------------------- /_layouts/post.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 |
6 | {% include meta.html post=page %} 7 | {{ content }} 8 | {% if site.comments.isso_domain or site.comments.disqus_shortname %} 9 |
10 | {% if site.comments.isso_domain %}
{% endif %} 11 | {% if site.comments.disqus_shortname %}
{% endif %} 12 | 13 | {% endif %} 14 |
15 | 16 | {% unless site.show_minimal or site.footer %} 17 | {% if page.next.url or page.previous.url %} 18 | 22 | {% endif %} 23 | {% endunless %} 24 | -------------------------------------------------------------------------------- /_includes/sidebar.html: -------------------------------------------------------------------------------- 1 | 2 | 20 | -------------------------------------------------------------------------------- /_sass/classes.sass: -------------------------------------------------------------------------------- 1 | .nowrap 2 | flex-wrap: nowrap 3 | 4 | .smooth 5 | -webkit-font-smoothing: antialiased 6 | 7 | .full 8 | font-size: 1.5em 9 | width: 100% 10 | margin: .1em 0 .7em 11 | 12 | .hover nav:has(svg) a:hover 13 | color: gray(100) 14 | box-shadow: none 15 | 16 | .button a, .dark a 17 | font-weight: inherit 18 | border-radius: 5px 19 | 20 | .button a 21 | background: #46f 22 | color: #fff 23 | padding: .25em 1em 24 | &:hover 25 | background: light(25) 26 | text-decoration-color: gray(0) 27 | 28 | .dark a 29 | background: light-dark(gray(22), gray(0)) 30 | margin: 0 31 | padding: .4em .8em 32 | &:hover 33 | background: light(100) 34 | color: light(0) 35 | box-shadow: none 36 | 37 | .katex-display 38 | overflow: auto hidden 39 | 40 | .rouge-table, .gist 41 | pre, tr, td 42 | background: inherit!important 43 | font-size: inherit 44 | color: inherit 45 | border: none 46 | margin: 0 1.5em 0 0 47 | padding: 0 48 | -------------------------------------------------------------------------------- /assets/css/sidebar.sass: -------------------------------------------------------------------------------- 1 | --- 2 | --- 3 | 4 | @import utils 5 | 6 | body 7 | font-size: calc(0.8rem + 0.3vw) 8 | padding: 0 0 0 18em 9 | background: light(100, 17) 10 | 11 | body > header, body > footer 12 | display: none 13 | 14 | body > * 15 | margin: 0 16 | padding: 2em 6em 17 | max-width: 50em 18 | box-shadow: none 19 | 20 | aside 21 | display: flex!important 22 | flex-direction: column 23 | position: fixed 24 | width: 18em 25 | padding: 2em 0 26 | top: 0 27 | bottom: 0 28 | left: 0 29 | background: light(14) 30 | color: light(100) 31 | border-right: 1px solid light(22) 32 | 33 | aside nav 34 | margin: 0 35 | flex-grow: 1 36 | a 37 | display: block 38 | font-weight: inherit 39 | margin: 0 40 | padding: .6em 2em 41 | border-radius: 0 42 | word-wrap: break-word 43 | &:hover, &.selected 44 | background: light(20) 45 | color: inherit 46 | svg 47 | margin: 0 1em 1px 0 48 | 49 | aside footer 50 | padding: 1em 2em 51 | -------------------------------------------------------------------------------- /assets/css/frame.sass: -------------------------------------------------------------------------------- 1 | --- 2 | --- 3 | 4 | @import utils, basic, layout, classes, rouge_github 5 | 6 | body 7 | background: light(93) 8 | background: light(93, 16) 9 | padding: 0 calc(38% - 22rem) 10 | 11 | body > * 12 | background: light(100) 13 | background: light(100, 17) 14 | color: light(0, 100) 15 | padding: 1.75em calc(22% - 6rem) 16 | padding: clamp(1.5em, 4vw, 1.75em) max(1.5em, 22% - 6rem) 17 | box-shadow: 0 -1px gray(10) inset, 0 0 1em light-dark(gray(10), transparent), 0 0 0 1px light-dark(transparent, light(26)) 18 | 19 | body > header, body > footer 20 | background: light(20) 21 | background: light(20, 17) 22 | color: light(100) 23 | 24 | {% if site.show_frame contains "." %} 25 | 26 | @media (min-width: 60em) 27 | body 28 | background: 0 0/cover url({{ site.show_frame | relative_url }}) 29 | background-attachment: fixed 30 | color-scheme: only light 31 | padding: 1em calc(38% - 22rem) 32 | > :first-child 33 | border-radius: 4px 4px 0 0 34 | > :last-child 35 | border-radius: 0 0 4px 4px 36 | 37 | {% endif %} 38 | -------------------------------------------------------------------------------- /_sass/rouge_github.sass: -------------------------------------------------------------------------------- 1 | .highlight 2 | .w 3 | color: #c9d1d9 4 | background: #161b22 5 | 6 | .k, .kd, .kn, .kp, .kr, .kt, .kv 7 | color: #ff7b72 8 | 9 | .gr 10 | color: #f0f6fc 11 | 12 | .gd 13 | color: #ffdcd7 14 | background: #67060c 15 | 16 | .nb, .nc, .no, .nn 17 | color: #ffa657 18 | 19 | .sr, .na, .nt 20 | color: #7ee787 21 | 22 | .gi 23 | color: #aff5b4 24 | background: #033a16 25 | 26 | .kc, .l, .ld, .m, .mb, .mf, .mh, .mi, .il, .mo, .mx, .sb, .bp, .ne, .nl, .py, .nv, .vc, .vg, .vi, .vm, .o, .ow 27 | color: #79c0ff 28 | 29 | .gh, .gu 30 | color: #1f6feb 31 | font-weight: bold 32 | 33 | .s, .sa, .sc, .dl, .sd, .s2, .se, .sh, .sx, .s1, .ss 34 | color: #a5d6ff 35 | 36 | .nd, .nf, .fm 37 | color: #d2a8ff 38 | 39 | .err 40 | color: #f0f6fc 41 | background-color: #8e1519 42 | 43 | .c, .ch, .cd, .cm, .cp, .cpf, .c1, .cs, .gl, .gt 44 | color: #8b949e 45 | 46 | .ni, .si 47 | color: #c9d1d9 48 | 49 | .ge 50 | color: #c9d1d9 51 | font-style: italic 52 | 53 | .gs 54 | color: #c9d1d9 55 | font-weight: bold 56 | -------------------------------------------------------------------------------- /_posts/2017-03-01-welcome-to-jekyll.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Welcome to Jekyll" 3 | layout: post 4 | --- 5 | 6 | You’ll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated. 7 | 8 | 9 | To add new posts, simply add a file in the `_posts` directory that follows the convention `YYYY-MM-DD-name-of-post.ext` and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works. 10 | 11 | Jekyll also offers powerful support for code snippets: 12 | 13 | {% highlight ruby %} 14 | def print_hi(name) 15 | puts "Hi, #{name}" 16 | end 17 | print_hi('Tom') 18 | #=> prints 'Hi, Tom' to STDOUT. 19 | {% endhighlight %} 20 | 21 | Check out the [Jekyll docs][jekyll-docs] for more info on how to get the most out of Jekyll. File all bugs/feature requests at [Jekyll’s GitHub repo][jekyll-gh]. If you have questions, you can ask them on [Jekyll Talk][jekyll-talk]. 22 | 23 | [jekyll-docs]: http://jekyllrb.com/docs/home 24 | [jekyll-gh]: https://github.com/jekyll/jekyll 25 | [jekyll-talk]: https://talk.jekyllrb.com/ 26 | -------------------------------------------------------------------------------- /assets/katex/contrib/mathtex-script-type.min.js: -------------------------------------------------------------------------------- 1 | !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("katex"));else if("function"==typeof define&&define.amd)define(["katex"],t);else{var n="object"==typeof exports?t(require("katex")):t(e.katex);for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}("undefined"!=typeof self?self:this,(function(e){return function(){"use strict";var t={757:function(t){t.exports=e}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var o={},i=r(757),a=r.n(i);let u=document.body.getElementsByTagName("script");return u=Array.prototype.slice.call(u),u.forEach((function(e){if(!e.type||!e.type.match(/math\/tex/i))return-1;const t=null!=e.type.match(/mode\s*=\s*display(;|\s|\n|$)/),n=document.createElement(t?"div":"span");n.setAttribute("class",t?"equation":"inline-equation");try{a().render(e.text,n,{displayMode:t})}catch(t){n.textContent=e.text}e.parentNode.replaceChild(n,e)})),o=o.default}()})); -------------------------------------------------------------------------------- /UNLICENSE.txt: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | title: "Blog Title" 2 | author: "Blog Author" 3 | description: "My blog" 4 | permalink: /:title/ 5 | lang: "en" 6 | excerpt_separator: "\n\n\n" 7 | date_format: "%B %d, %Y" 8 | 9 | # Layout 10 | 11 | show_excerpts: true # show article excerpts instead of archive list on the home page 12 | show_frame: true # display a grey frame on large screens 13 | show_sidebar: false # show a sidebar instead of the usual header 14 | show_minimal: false # remove all clutter 15 | 16 | #show_frame: "/assets/images/background.svg" 17 | 18 | # Menu # for available icons see https://fontawesome.com/v5/icons/ 19 | 20 | navigation: # accepts {file, title, url, icon, sidebaricon} 21 | - {file: "archive.html", sidebaricon: home} 22 | - {file: "README.md", sidebaricon: address-card} 23 | 24 | external: # accepts {file, title, url, icon, sidebaricon} 25 | - {title: Mail, icon: envelope, url: "mailto:author@example.com"} 26 | - {title: Github, icon: github, url: "https://github.com/niklasbuschmann/contrast"} 27 | - {title: Subscribe, icon: rss, url: "/feed.xml"} 28 | 29 | comments: 30 | # disqus_shortname: "" # see https://disqus.com 31 | # isso_domain: "" # see https://isso-comments.de 32 | 33 | plugins: 34 | - jekyll-feed 35 | -------------------------------------------------------------------------------- /_sass/rouge_molokai.sass: -------------------------------------------------------------------------------- 1 | .highlight 2 | .c, .ch, .cd, .cpf, .cm, .c1 3 | color: #5e5d83 4 | font-style: italic 5 | 6 | .cp 7 | color: #465457 8 | font-weight: bold 9 | 10 | .cs 11 | color: #465457 12 | font-weight: bold 13 | font-style: italic 14 | 15 | .err 16 | color: #f8f8f2 17 | background: #403d3d 18 | 19 | .gi 20 | color: #a6e22e 21 | 22 | .gd 23 | color: #f92672 24 | 25 | .ge 26 | color: #1b1d1e 27 | font-style: italic 28 | 29 | .gr, .gt 30 | color: #f92672 31 | 32 | .gh, .go 33 | color: #403d3d 34 | 35 | .gp 36 | color: #66d9ef 37 | 38 | .gs 39 | font-weight: bold 40 | 41 | .gu 42 | color: #465457 43 | 44 | .k, .kv, .kc, .kd, .kp, .kr, .kt 45 | color: #66d9ef 46 | 47 | .kn, .ow, .o 48 | color: #f92672 49 | font-weight: bold 50 | 51 | .mf, .mh, .il, .mi, .mo, .m, .mb, .mx, .se 52 | color: #af87ff 53 | 54 | .sb, .sc, .sd, .s2, .sh, .si, .sx, .sr, .s1, .ss, .s, .sa, .dl 55 | color: #d7d787 56 | 57 | .na 58 | color: #a6e22e 59 | 60 | .nc, .nd, .ne, .nf, .fm 61 | color: #a6e22e 62 | font-weight: bold 63 | 64 | .no 65 | color: #66d9ef 66 | 67 | .bp, .nb, .ni, .nn, .vc, .vg, .vi, .nv, .vm, .w 68 | color: #f8f8f2 69 | 70 | .nl 71 | color: #f8f8f2 72 | font-weight: bold 73 | 74 | .nt 75 | color: #f92672 76 | -------------------------------------------------------------------------------- /assets/katex/contrib/copy-tex.min.js: -------------------------------------------------------------------------------- 1 | !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}("undefined"!=typeof self?self:this,(function(){return function(){"use strict";var e={};const t={inline:["$","$"],display:["$$","$$"]};var n=function(e,n){void 0===n&&(n=t);const o=e.querySelectorAll(".katex-mathml + .katex-html");for(let e=0;ee instanceof Text?e.textContent:e.outerHTML)).join("");r.setData("text/html",c),r.setData("text/plain",n(s).textContent),e.preventDefault()})),e=e.default}()})); -------------------------------------------------------------------------------- /_sass/basic.sass: -------------------------------------------------------------------------------- 1 | body 2 | font: 16px / #{$line-height} $font-family 3 | font-size: $font-size 4 | background: light(100, 16) 5 | color: light(6, 100) 6 | 7 | p 8 | text-align: justify 9 | 10 | a 11 | color: $link 12 | transition: .25s 13 | box-shadow: 0 2px transparent 14 | text-decoration-color: transparent 15 | header &, footer &, nav & 16 | font-weight: bold 17 | header &, footer &, nav &:not(:hover) 18 | color: inherit 19 | article &:hover 20 | text-decoration-color: inherit 21 | body > header &:hover, body > footer &:hover 22 | box-shadow: 0 2px 23 | 24 | hr 25 | border: 1px solid gray(100) 26 | margin: 2em 0 27 | 28 | blockquote 29 | background: gray(10) 30 | color: light-dark(#555, #eee) 31 | border-left: 3px solid gray(60) 32 | padding: 1px 1.5em 33 | 34 | blockquote, figure 35 | margin: 1.25em 0 36 | 37 | img 38 | margin: .5em 0 39 | border-radius: 4px 40 | max-width: 100% 41 | 42 | li 43 | margin: .3em 0 44 | 45 | table 46 | display: inline-block 47 | max-width: 100% 48 | overflow-y: auto 49 | border-collapse: collapse 50 | border-radius: 2px 51 | 52 | th, td 53 | padding: .5em 1em 54 | border: 1px solid gray(24) 55 | 56 | thead, tr:hover 57 | background: gray(12) 58 | 59 | pre 60 | font-size: .8em 61 | background: light(22) 62 | color: light(100) 63 | border-radius: 5px 64 | margin: 1.5em 0 65 | padding: .8em 1.2em 66 | overflow-x: auto 67 | 68 | code:not(pre code) 69 | font-size: .9em 70 | background: gray(22) 71 | border-radius: 3px 72 | margin: 0 .1em 73 | padding: .2em .4em 74 | opacity: .75 75 | 76 | header time, nav time 77 | color: gray(100) 78 | -------------------------------------------------------------------------------- /assets/fontawesome/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Font Awesome Free License 2 | ------------------------- 3 | 4 | Font Awesome Free is free, open source, and GPL friendly. You can use it for 5 | commercial projects, open source projects, or really almost whatever you want. 6 | Full Font Awesome Free license: https://fontawesome.com/license/free. 7 | 8 | # Icons: CC BY 4.0 License (https://creativecommons.org/licenses/by/4.0/) 9 | In the Font Awesome Free download, the CC BY 4.0 license applies to all icons 10 | packaged as SVG and JS file types. 11 | 12 | # Fonts: SIL OFL 1.1 License (https://scripts.sil.org/OFL) 13 | In the Font Awesome Free download, the SIL OFL license applies to all icons 14 | packaged as web and desktop font files. 15 | 16 | # Code: MIT License (https://opensource.org/licenses/MIT) 17 | In the Font Awesome Free download, the MIT license applies to all non-font and 18 | non-icon files. 19 | 20 | # Attribution 21 | Attribution is required by MIT, SIL OFL, and CC BY licenses. Downloaded Font 22 | Awesome Free files already contain embedded comments with sufficient 23 | attribution, so you shouldn't need to do anything additional when using these 24 | files normally. 25 | 26 | We've kept attribution comments terse, so we ask that you do not actively work 27 | to remove them from files, especially code. They're a great way for folks to 28 | learn about Font Awesome. 29 | 30 | # Brand Icons 31 | All brand icons are trademarks of their respective owners. The use of these 32 | trademarks does not indicate endorsement of the trademark holder by Font 33 | Awesome, nor vice versa. **Please do not use brand logos for any purpose except 34 | to represent the company, product, or service to which they refer.** 35 | -------------------------------------------------------------------------------- /_includes/head.html: -------------------------------------------------------------------------------- 1 | {% if page.title %}{{ page.title | escape }} | {% endif %}{{ site.title | escape }} 2 | 3 | 4 | 5 | 6 | 7 | 8 | {%- if site.show_minimal -%} 9 | 10 | {%- elsif site.show_frame -%} 11 | 12 | {%- else -%} 13 | 14 | {%- endif -%} 15 | 16 | {%- if site.plugins contains "jekyll-feed" -%} 17 | 18 | {%- endif -%} 19 | {%- if page.mathjax or site.mathjax -%} 20 | 21 | {% unless site.plugins contains "jektex" %} 22 | 23 | 24 | {%- endunless -%} 25 | {%- endif -%} 26 | {%- if site.comments.disqus_shortname and page.layout == "post" -%} 27 | 28 | {%- endif -%} 29 | {%- if site.comments.isso_domain and page.layout == "post" -%} 30 | 31 | {%- endif -%} 32 | {%- if site.show_sidebar %}{% include sidebar.html %}{% endif %} -------------------------------------------------------------------------------- /assets/PT-Sans/License.txt: -------------------------------------------------------------------------------- 1 | Copyright © 2009 ParaType Ltd. 2 | with Reserved Names "PT Sans" and "ParaType". 3 | 4 | FONT LICENSE 5 | 6 | PERMISSION & CONDITIONS 7 | Permission is hereby granted, free of charge, to any person obtaining a copy of the font software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the font software, subject to the following conditions: 8 | 9 | 1) Neither the font software nor any of its individual components, in original or modified versions, may be sold by itself. 10 | 11 | 2) Original or modified versions of the font software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user. 12 | 13 | 3) No modified version of the font software may use the Reserved Name(s) or combinations of Reserved Names with other words unless explicit written permission is granted by the ParaType. This restriction only applies to the primary font name as presented to the users. 14 | 15 | 4) The name of ParaType or the author(s) of the font software shall not be used to promote, endorse or advertise any modified version, except to acknowledge the contribution(s) of ParaType and the author(s) or with explicit written permission of ParaType. 16 | 17 | 5) The font software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software. 18 | 19 | TERMINATION & TERRITORY 20 | This license has no limits on time and territory, but it becomes null and void if any of the above conditions are not met. 21 | 22 | DISCLAIMER 23 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL PARATYPE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. 24 | 25 | ParaType Ltd 26 | http://www.paratype.ru -------------------------------------------------------------------------------- /_posts/2017-02-01-markdown-examples.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Markdown examples" 3 | layout: post 4 | --- 5 | 6 | ![Coffee](https://user-images.githubusercontent.com/4943215/74586455-c8048300-4fe7-11ea-84ba-aa49f3abb014.jpeg) 7 | 8 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 9 | 10 | Curabitur pretium tincidunt lacus. Nulla gravida orci a odio. Nullam varius, turpis et commodo pharetra, est eros bibendum elit, nec luctus magna felis sollicitudin mauris. Integer in mauris eu nibh euismod gravida. Duis ac tellus et risus vulputate vehicula. Donec lobortis risus a elit. 11 | 12 | 13 | ## Heading Two (h2) 14 | 15 | ### Heading Three (h3) 16 | 17 | #### Heading Four (h4) 18 | 19 | ##### Heading Five (h5) 20 | 21 | ###### Heading Six (h6) 22 | 23 | 24 | ## Blockquotes 25 | 26 | ### Single line 27 | 28 | > My mom always said life was like a box of chocolates. You never know what you're gonna get. 29 | 30 | ### Multiline 31 | 32 | > What do you get when you cross an insomniac, an unwilling agnostic and a dyslexic? 33 | > 34 | > You get someone who stays up all night torturing himself mentally over the question of whether or not there's a dog. 35 | > 36 | > – _Hal Incandenza_ 37 | 38 | ## Horizontal Rule 39 | 40 | --- 41 | 42 | ## Table 43 | 44 | | Title 1 | Title 2 | Title 3 | Title 4 | 45 | |------------------|------------------|-----------------|-----------------| 46 | | First entry | Second entry | Third entry | Fourth entry | 47 | | Fifth entry | Sixth entry | Seventh entry | Eight entry | 48 | | Ninth entry | Tenth entry | Eleventh entry | Twelfth entry | 49 | | Thirteenth entry | Fourteenth entry | Fifteenth entry | Sixteenth entry | 50 | 51 | ## Code 52 | 53 | Source code can be included by fencing the code with three backticks. Syntax highlighting works automatically when specifying the language after the backticks. 54 | 55 | ```` 56 | ```javascript 57 | function foo () { 58 | return "bar"; 59 | } 60 | ``` 61 | ```` 62 | 63 | This would be rendered as: 64 | 65 | ```javascript 66 | function foo () { 67 | return "bar"; 68 | } 69 | ``` 70 | 71 | ## Lists 72 | 73 | ### Unordered 74 | 75 | * First item 76 | * Second item 77 | * Third item 78 | * First nested item 79 | * Second nested item 80 | 81 | ### Ordered 82 | 83 | 1. First item 84 | 2. Second item 85 | 3. Third item 86 | 1. First nested item 87 | 2. Second nested item 88 | -------------------------------------------------------------------------------- /_posts/2017-01-01-advanced-examples.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Advanced examples" 3 | mathjax: true 4 | layout: post 5 | categories: media 6 | --- 7 | 8 | ![Swiss Alps](https://user-images.githubusercontent.com/4943215/55412536-edbba180-5567-11e9-9c70-6d33bca3f8ed.jpg) 9 | 10 | 11 | ## MathJax 12 | 13 | You can enable MathJax by setting `mathjax: true` on a page or globally in the `_config.yml`. Some examples: 14 | 15 | [Euler's formula](https://en.wikipedia.org/wiki/Euler%27s_formula) relates the complex exponential function to the trigonometric functions. 16 | 17 | $$ e^{i\theta}=\cos(\theta)+i\sin(\theta) $$ 18 | 19 | The [Euler-Lagrange](https://en.wikipedia.org/wiki/Lagrangian_mechanics) differential equation is the fundamental equation of calculus of variations. 20 | 21 | $$ \frac{\mathrm{d}}{\mathrm{d}t} \left ( \frac{\partial L}{\partial \dot{q}} \right ) = \frac{\partial L}{\partial q} $$ 22 | 23 | The [Schrödinger equation](https://en.wikipedia.org/wiki/Schr%C3%B6dinger_equation) describes how the quantum state of a quantum system changes with time. 24 | 25 | $$ i\hbar\frac{\partial}{\partial t} \Psi(\mathbf{r},t) = \left [ \frac{-\hbar^2}{2\mu}\nabla^2 + V(\mathbf{r},t)\right ] \Psi(\mathbf{r},t) $$ 26 | 27 | ## Code 28 | 29 | Embed code by putting `{{ "{% highlight language " }}%}` `{{ "{% endhighlight " }}%}` blocks around it. Adding the parameter `linenos` will show source lines besides the code. 30 | 31 | {% highlight c linenos %} 32 | 33 | static void asyncEnabled(Dict* args, void* vAdmin, String* txid, struct Allocator* requestAlloc) 34 | { 35 | struct Admin* admin = Identity_check((struct Admin*) vAdmin); 36 | int64_t enabled = admin->asyncEnabled; 37 | Dict d = Dict_CONST(String_CONST("asyncEnabled"), Int_OBJ(enabled), NULL); 38 | Admin_sendMessage(&d, txid, admin); 39 | } 40 | 41 | {% endhighlight %} 42 | 43 | ## Gists 44 | 45 | You can embed gists the following way: 46 | 47 | ```html 48 | 49 | ``` 50 | 51 | 52 | 53 | ## Images 54 | 55 | Upload an image to the *assets* folder and embed it with `![title](/assets/name.jpg))`. Keep in mind that the path needs to be adjusted if Jekyll is run inside a subfolder. 56 | 57 | ![Flower](https://user-images.githubusercontent.com/4943215/55412447-bcdb6c80-5567-11e9-8d12-b1e35fd5e50c.jpg) 58 | 59 | [Flower](https://unsplash.com/photos/iGrsa9rL11o) by Tj Holowaychuk 60 | 61 | ## Embedded content 62 | 63 | You can also embed a lot of stuff, for example from YouTube, using the `embed.html` include. 64 | 65 | {% include embed.html url="https://www.youtube.com/embed/_C0A5zX-iqM" %} 66 | -------------------------------------------------------------------------------- /assets/PT-Sans/index.sass: -------------------------------------------------------------------------------- 1 | --- 2 | --- 3 | 4 | @font-face 5 | font-family: 'PT Sans' 6 | font-style: normal 7 | font-weight: normal 8 | src: local('PT Sans'), local('PTSans-Regular'), url('regular-cyrillic-ext.woff2') format('woff2') 9 | unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F 10 | 11 | @font-face 12 | font-family: 'PT Sans' 13 | font-style: normal 14 | font-weight: normal 15 | src: local('PT Sans'), local('PTSans-Regular'), url('regular-cyrillic.woff2') format('woff2') 16 | unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116 17 | 18 | @font-face 19 | font-family: 'PT Sans' 20 | font-style: normal 21 | font-weight: normal 22 | src: local('PT Sans'), local('PTSans-Regular'), url('regular-latin-ext.woff2') format('woff2') 23 | unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF 24 | 25 | @font-face 26 | font-family: 'PT Sans' 27 | font-style: normal 28 | font-weight: normal 29 | src: local('PT Sans'), local('PTSans-Regular'), url('regular-latin.woff2') format('woff2') 30 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD 31 | 32 | @font-face 33 | font-family: 'PT Sans' 34 | font-style: normal 35 | font-weight: bold 36 | src: local('PT Sans Bold'), local('PTSans-Bold'), url('bold-cyrillic-ext.woff2') format('woff2') 37 | unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F 38 | 39 | @font-face 40 | font-family: 'PT Sans' 41 | font-style: normal 42 | font-weight: bold 43 | src: local('PT Sans Bold'), local('PTSans-Bold'), url('bold-cyrillic.woff2') format('woff2') 44 | unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116 45 | 46 | @font-face 47 | font-family: 'PT Sans' 48 | font-style: normal 49 | font-weight: bold 50 | src: local('PT Sans Bold'), local('PTSans-Bold'), url('bold-latin-ext.woff2') format('woff2') 51 | unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF 52 | 53 | @font-face 54 | font-family: 'PT Sans' 55 | font-style: normal 56 | font-weight: bold 57 | src: local('PT Sans Bold'), local('PTSans-Bold'), url('bold-latin.woff2') format('woff2') 58 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD 59 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "About" 3 | permalink: "/about/" 4 | layout: page 5 | --- 6 | 7 | ## Github Pages 8 | 9 | Just fork this [repository](https://github.com/niklasbuschmann/contrast) to `your_username.github.io` and adjust the `_config.yml` to use with [Github Pages](https://pages.github.com/) and your page is done. 10 | 11 | ## Features 12 | 13 | - dark mode 14 | - [KaTeX](https://katex.org) included 15 | - no external ressources 16 | - optional sidebar 17 | - archive page 18 | - syntax highlighting 19 | - supports comments via [disqus](https://disqus.com/) or [isso](http://posativ.org/isso/) 20 | 21 | ## Installation 22 | 23 | To run locally [install Ruby](https://www.ruby-lang.org/en/documentation/installation/) and then run: 24 | 25 | ``` 26 | git clone https://github.com/niklasbuschmann/contrast.git 27 | cd contrast 28 | gem install bundler jekyll jekyll-feed 29 | bundle exec jekyll serve 30 | ``` 31 | 32 | ## Config 33 | 34 | Your `_config.yml` could for example look like this: 35 | 36 | ```yaml 37 | title: "Blog Title" 38 | author: "Blog Author" 39 | description: "My blog" 40 | permalink: /:title/ 41 | lang: "en" 42 | excerpt_separator: "\n\n\n" 43 | date_format: "%B %d, %Y" 44 | 45 | # Layout 46 | 47 | show_excerpts: true # show article excerpts instead of archive list on the home page 48 | show_frame: true # display a grey frame on large screens 49 | show_sidebar: false # show a sidebar instead of the usual header 50 | show_minimal: false # remove all clutter 51 | 52 | # Menu # for available icons see https://fontawesome.com/v5/icons/ 53 | 54 | navigation: # accepts {file, title, url, icon, sidebaricon} 55 | - {file: "archive.html", sidebaricon: home} 56 | - {file: "README.md", sidebaricon: address-card} 57 | 58 | external: # accepts {file, title, url, icon, sidebaricon} 59 | - {title: Mail, icon: envelope, url: "mailto:author@example.com"} 60 | - {title: Github, icon: github, url: "https://github.com/"} 61 | - {title: Subscribe, icon: rss, url: "/feed.xml"} 62 | 63 | comments: 64 | # disqus_shortname: "" # see https://disqus.com 65 | # isso_domain: "" # see https://isso-comments.de 66 | 67 | plugins: 68 | - jekyll-feed 69 | ``` 70 | 71 | ## Math 72 | 73 | Contrast comes preinstalled with a leightweight alternative to MathJax called [KaTeX](https://katex.org/). To display equations in a post simply set `mathjax: true` in the article's front matter. [Jektex](https://github.com/yagarea/jektex) can be used to pre-render math on the server side. 74 | 75 | ## License 76 | 77 | [public domain](http://unlicense.org/) 78 | 79 | ## Screenshots 80 | 81 | ![screenshot](https://github.com/user-attachments/assets/8f0ef4bc-f079-495e-8c31-5867b8ccd25c) 82 | 83 | ![screenshot](https://github.com/user-attachments/assets/e5e6d189-3251-41f4-baba-ff42be65f666) 84 | 85 | ![screenshot](https://github.com/user-attachments/assets/d31879ae-7113-42be-b580-1e96a2aedd29) 86 | 87 | ![screenshot](https://github.com/user-attachments/assets/d524ce47-8d8c-473e-afc6-79b34fae63e8) 88 | -------------------------------------------------------------------------------- /assets/katex/contrib/auto-render.min.js: -------------------------------------------------------------------------------- 1 | !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("katex")):"function"==typeof define&&define.amd?define(["katex"],t):"object"==typeof exports?exports.renderMathInElement=t(require("katex")):e.renderMathInElement=t(e.katex)}("undefined"!=typeof self?self:this,(function(e){return function(){"use strict";var t={757:function(t){t.exports=e}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var o={};r.d(o,{default:function(){return p}});var i=r(757),a=r.n(i);const l=function(e,t,n){let r=n,o=0;const i=e.length;for(;re.left.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"))).join("|")+")");for(;n=e.search(o),-1!==n;){n>0&&(r.push({type:"text",data:e.slice(0,n)}),e=e.slice(n));const o=t.findIndex((t=>e.startsWith(t.left)));if(n=l(t[o].right,e,t[o].left.length),-1===n)break;const i=e.slice(0,n+t[o].right.length),a=s.test(i)?i:e.slice(t[o].left.length,n);r.push({type:"math",data:a,rawData:i,display:t[o].display}),e=e.slice(n+t[o].right.length)}return""!==e&&r.push({type:"text",data:e}),r};const c=function(e,t){const n=d(e,t.delimiters);if(1===n.length&&"text"===n[0].type)return null;const r=document.createDocumentFragment();for(let e=0;e-1===e.indexOf(" "+t+" ")))&&f(r,t)}}};var p=function(e,t){if(!e)throw new Error("No element provided to render");const n={};for(const e in t)t.hasOwnProperty(e)&&(n[e]=t[e]);n.delimiters=n.delimiters||[{left:"$$",right:"$$",display:!0},{left:"\\(",right:"\\)",display:!1},{left:"\\begin{equation}",right:"\\end{equation}",display:!0},{left:"\\begin{align}",right:"\\end{align}",display:!0},{left:"\\begin{alignat}",right:"\\end{alignat}",display:!0},{left:"\\begin{gather}",right:"\\end{gather}",display:!0},{left:"\\begin{CD}",right:"\\end{CD}",display:!0},{left:"\\[",right:"\\]",display:!0}],n.ignoredTags=n.ignoredTags||["script","noscript","style","textarea","pre","code","option"],n.ignoredClasses=n.ignoredClasses||[],n.errorCallback=n.errorCallback||console.error,n.macros=n.macros||{},f(e,n)};return o=o.default}()})); -------------------------------------------------------------------------------- /assets/katex/contrib/copy-tex.mjs: -------------------------------------------------------------------------------- 1 | // Set these to how you want inline and display math to be delimited. 2 | var defaultCopyDelimiters = { 3 | inline: ['$', '$'], 4 | // alternative: ['\(', '\)'] 5 | display: ['$$', '$$'] // alternative: ['\[', '\]'] 6 | 7 | }; // Replace .katex elements with their TeX source ( element). 8 | // Modifies fragment in-place. Useful for writing your own 'copy' handler, 9 | // as in copy-tex.js. 10 | 11 | function katexReplaceWithTex(fragment, copyDelimiters) { 12 | if (copyDelimiters === void 0) { 13 | copyDelimiters = defaultCopyDelimiters; 14 | } 15 | 16 | // Remove .katex-html blocks that are preceded by .katex-mathml blocks 17 | // (which will get replaced below). 18 | var katexHtml = fragment.querySelectorAll('.katex-mathml + .katex-html'); 19 | 20 | for (var i = 0; i < katexHtml.length; i++) { 21 | var element = katexHtml[i]; 22 | 23 | if (element.remove) { 24 | element.remove(); 25 | } else if (element.parentNode) { 26 | element.parentNode.removeChild(element); 27 | } 28 | } // Replace .katex-mathml elements with their annotation (TeX source) 29 | // descendant, with inline delimiters. 30 | 31 | 32 | var katexMathml = fragment.querySelectorAll('.katex-mathml'); 33 | 34 | for (var _i = 0; _i < katexMathml.length; _i++) { 35 | var _element = katexMathml[_i]; 36 | 37 | var texSource = _element.querySelector('annotation'); 38 | 39 | if (texSource) { 40 | if (_element.replaceWith) { 41 | _element.replaceWith(texSource); 42 | } else if (_element.parentNode) { 43 | _element.parentNode.replaceChild(texSource, _element); 44 | } 45 | 46 | texSource.innerHTML = copyDelimiters.inline[0] + texSource.innerHTML + copyDelimiters.inline[1]; 47 | } 48 | } // Switch display math to display delimiters. 49 | 50 | 51 | var displays = fragment.querySelectorAll('.katex-display annotation'); 52 | 53 | for (var _i2 = 0; _i2 < displays.length; _i2++) { 54 | var _element2 = displays[_i2]; 55 | _element2.innerHTML = copyDelimiters.display[0] + _element2.innerHTML.substr(copyDelimiters.inline[0].length, _element2.innerHTML.length - copyDelimiters.inline[0].length - copyDelimiters.inline[1].length) + copyDelimiters.display[1]; 56 | } 57 | 58 | return fragment; 59 | } 60 | 61 | function closestKatex(node) { 62 | // If node is a Text Node, for example, go up to containing Element, 63 | // where we can apply the `closest` method. 64 | var element = node instanceof Element ? node : node.parentElement; 65 | return element && element.closest('.katex'); 66 | } // Global copy handler to modify behavior on/within .katex elements. 67 | 68 | 69 | document.addEventListener('copy', function (event) { 70 | var selection = window.getSelection(); 71 | 72 | if (selection.isCollapsed || !event.clipboardData) { 73 | return; // default action OK if selection is empty or unchangeable 74 | } 75 | 76 | var clipboardData = event.clipboardData; 77 | var range = selection.getRangeAt(0); // When start point is within a formula, expand to entire formula. 78 | 79 | var startKatex = closestKatex(range.startContainer); 80 | 81 | if (startKatex) { 82 | range.setStartBefore(startKatex); 83 | } // Similarly, when end point is within a formula, expand to entire formula. 84 | 85 | 86 | var endKatex = closestKatex(range.endContainer); 87 | 88 | if (endKatex) { 89 | range.setEndAfter(endKatex); 90 | } 91 | 92 | var fragment = range.cloneContents(); 93 | 94 | if (!fragment.querySelector('.katex-mathml')) { 95 | return; // default action OK if no .katex-mathml elements 96 | } 97 | 98 | var htmlContents = Array.prototype.map.call(fragment.childNodes, el => el instanceof Text ? el.textContent : el.outerHTML).join(''); // Preserve usual HTML copy/paste behavior. 99 | 100 | clipboardData.setData('text/html', htmlContents); // Rewrite plain-text version. 101 | 102 | clipboardData.setData('text/plain', katexReplaceWithTex(fragment).textContent); // Prevent normal copy handling. 103 | 104 | event.preventDefault(); 105 | }); 106 | -------------------------------------------------------------------------------- /assets/katex/contrib/mathtex-script-type.js: -------------------------------------------------------------------------------- 1 | (function webpackUniversalModuleDefinition(root, factory) { 2 | if(typeof exports === 'object' && typeof module === 'object') 3 | module.exports = factory(require("katex")); 4 | else if(typeof define === 'function' && define.amd) 5 | define(["katex"], factory); 6 | else { 7 | var a = typeof exports === 'object' ? factory(require("katex")) : factory(root["katex"]); 8 | for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; 9 | } 10 | })((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__757__) { 11 | return /******/ (function() { // webpackBootstrap 12 | /******/ "use strict"; 13 | /******/ var __webpack_modules__ = ({ 14 | 15 | /***/ 757: 16 | /***/ (function(module) { 17 | 18 | module.exports = __WEBPACK_EXTERNAL_MODULE__757__; 19 | 20 | /***/ }) 21 | 22 | /******/ }); 23 | /************************************************************************/ 24 | /******/ // The module cache 25 | /******/ var __webpack_module_cache__ = {}; 26 | /******/ 27 | /******/ // The require function 28 | /******/ function __webpack_require__(moduleId) { 29 | /******/ // Check if module is in cache 30 | /******/ var cachedModule = __webpack_module_cache__[moduleId]; 31 | /******/ if (cachedModule !== undefined) { 32 | /******/ return cachedModule.exports; 33 | /******/ } 34 | /******/ // Create a new module (and put it into the cache) 35 | /******/ var module = __webpack_module_cache__[moduleId] = { 36 | /******/ // no module.id needed 37 | /******/ // no module.loaded needed 38 | /******/ exports: {} 39 | /******/ }; 40 | /******/ 41 | /******/ // Execute the module function 42 | /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 43 | /******/ 44 | /******/ // Return the exports of the module 45 | /******/ return module.exports; 46 | /******/ } 47 | /******/ 48 | /************************************************************************/ 49 | /******/ /* webpack/runtime/compat get default export */ 50 | /******/ !function() { 51 | /******/ // getDefaultExport function for compatibility with non-harmony modules 52 | /******/ __webpack_require__.n = function(module) { 53 | /******/ var getter = module && module.__esModule ? 54 | /******/ function() { return module['default']; } : 55 | /******/ function() { return module; }; 56 | /******/ __webpack_require__.d(getter, { a: getter }); 57 | /******/ return getter; 58 | /******/ }; 59 | /******/ }(); 60 | /******/ 61 | /******/ /* webpack/runtime/define property getters */ 62 | /******/ !function() { 63 | /******/ // define getter functions for harmony exports 64 | /******/ __webpack_require__.d = function(exports, definition) { 65 | /******/ for(var key in definition) { 66 | /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 67 | /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 68 | /******/ } 69 | /******/ } 70 | /******/ }; 71 | /******/ }(); 72 | /******/ 73 | /******/ /* webpack/runtime/hasOwnProperty shorthand */ 74 | /******/ !function() { 75 | /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } 76 | /******/ }(); 77 | /******/ 78 | /************************************************************************/ 79 | var __webpack_exports__ = {}; 80 | /* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(757); 81 | /* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(katex__WEBPACK_IMPORTED_MODULE_0__); 82 | 83 | let scripts = document.body.getElementsByTagName("script"); 84 | scripts = Array.prototype.slice.call(scripts); 85 | scripts.forEach(function (script) { 86 | if (!script.type || !script.type.match(/math\/tex/i)) { 87 | return -1; 88 | } 89 | 90 | const display = script.type.match(/mode\s*=\s*display(;|\s|\n|$)/) != null; 91 | const katexElement = document.createElement(display ? "div" : "span"); 92 | katexElement.setAttribute("class", display ? "equation" : "inline-equation"); 93 | 94 | try { 95 | katex__WEBPACK_IMPORTED_MODULE_0___default().render(script.text, katexElement, { 96 | displayMode: display 97 | }); 98 | } catch (err) { 99 | //console.error(err); linter doesn't like this 100 | katexElement.textContent = script.text; 101 | } 102 | 103 | script.parentNode.replaceChild(katexElement, script); 104 | }); 105 | __webpack_exports__ = __webpack_exports__["default"]; 106 | /******/ return __webpack_exports__; 107 | /******/ })() 108 | ; 109 | }); -------------------------------------------------------------------------------- /assets/katex/contrib/copy-tex.js: -------------------------------------------------------------------------------- 1 | (function webpackUniversalModuleDefinition(root, factory) { 2 | if(typeof exports === 'object' && typeof module === 'object') 3 | module.exports = factory(); 4 | else if(typeof define === 'function' && define.amd) 5 | define([], factory); 6 | else { 7 | var a = factory(); 8 | for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; 9 | } 10 | })((typeof self !== 'undefined' ? self : this), function() { 11 | return /******/ (function() { // webpackBootstrap 12 | /******/ "use strict"; 13 | var __webpack_exports__ = {}; 14 | 15 | ;// CONCATENATED MODULE: ./contrib/copy-tex/katex2tex.js 16 | // Set these to how you want inline and display math to be delimited. 17 | const defaultCopyDelimiters = { 18 | inline: ['$', '$'], 19 | // alternative: ['\(', '\)'] 20 | display: ['$$', '$$'] // alternative: ['\[', '\]'] 21 | 22 | }; // Replace .katex elements with their TeX source ( element). 23 | // Modifies fragment in-place. Useful for writing your own 'copy' handler, 24 | // as in copy-tex.js. 25 | 26 | function katexReplaceWithTex(fragment, copyDelimiters) { 27 | if (copyDelimiters === void 0) { 28 | copyDelimiters = defaultCopyDelimiters; 29 | } 30 | 31 | // Remove .katex-html blocks that are preceded by .katex-mathml blocks 32 | // (which will get replaced below). 33 | const katexHtml = fragment.querySelectorAll('.katex-mathml + .katex-html'); 34 | 35 | for (let i = 0; i < katexHtml.length; i++) { 36 | const element = katexHtml[i]; 37 | 38 | if (element.remove) { 39 | element.remove(); 40 | } else if (element.parentNode) { 41 | element.parentNode.removeChild(element); 42 | } 43 | } // Replace .katex-mathml elements with their annotation (TeX source) 44 | // descendant, with inline delimiters. 45 | 46 | 47 | const katexMathml = fragment.querySelectorAll('.katex-mathml'); 48 | 49 | for (let i = 0; i < katexMathml.length; i++) { 50 | const element = katexMathml[i]; 51 | const texSource = element.querySelector('annotation'); 52 | 53 | if (texSource) { 54 | if (element.replaceWith) { 55 | element.replaceWith(texSource); 56 | } else if (element.parentNode) { 57 | element.parentNode.replaceChild(texSource, element); 58 | } 59 | 60 | texSource.innerHTML = copyDelimiters.inline[0] + texSource.innerHTML + copyDelimiters.inline[1]; 61 | } 62 | } // Switch display math to display delimiters. 63 | 64 | 65 | const displays = fragment.querySelectorAll('.katex-display annotation'); 66 | 67 | for (let i = 0; i < displays.length; i++) { 68 | const element = displays[i]; 69 | element.innerHTML = copyDelimiters.display[0] + element.innerHTML.substr(copyDelimiters.inline[0].length, element.innerHTML.length - copyDelimiters.inline[0].length - copyDelimiters.inline[1].length) + copyDelimiters.display[1]; 70 | } 71 | 72 | return fragment; 73 | } 74 | /* harmony default export */ var katex2tex = (katexReplaceWithTex); 75 | ;// CONCATENATED MODULE: ./contrib/copy-tex/copy-tex.js 76 | // Return
element containing node, or null if not found. 77 | 78 | function closestKatex(node) { 79 | // If node is a Text Node, for example, go up to containing Element, 80 | // where we can apply the `closest` method. 81 | const element = node instanceof Element ? node : node.parentElement; 82 | return element && element.closest('.katex'); 83 | } // Global copy handler to modify behavior on/within .katex elements. 84 | 85 | 86 | document.addEventListener('copy', function (event) { 87 | const selection = window.getSelection(); 88 | 89 | if (selection.isCollapsed || !event.clipboardData) { 90 | return; // default action OK if selection is empty or unchangeable 91 | } 92 | 93 | const clipboardData = event.clipboardData; 94 | const range = selection.getRangeAt(0); // When start point is within a formula, expand to entire formula. 95 | 96 | const startKatex = closestKatex(range.startContainer); 97 | 98 | if (startKatex) { 99 | range.setStartBefore(startKatex); 100 | } // Similarly, when end point is within a formula, expand to entire formula. 101 | 102 | 103 | const endKatex = closestKatex(range.endContainer); 104 | 105 | if (endKatex) { 106 | range.setEndAfter(endKatex); 107 | } 108 | 109 | const fragment = range.cloneContents(); 110 | 111 | if (!fragment.querySelector('.katex-mathml')) { 112 | return; // default action OK if no .katex-mathml elements 113 | } 114 | 115 | const htmlContents = Array.prototype.map.call(fragment.childNodes, el => el instanceof Text ? el.textContent : el.outerHTML).join(''); // Preserve usual HTML copy/paste behavior. 116 | 117 | clipboardData.setData('text/html', htmlContents); // Rewrite plain-text version. 118 | 119 | clipboardData.setData('text/plain', katex2tex(fragment).textContent); // Prevent normal copy handling. 120 | 121 | event.preventDefault(); 122 | }); 123 | __webpack_exports__ = __webpack_exports__["default"]; 124 | /******/ return __webpack_exports__; 125 | /******/ })() 126 | ; 127 | }); -------------------------------------------------------------------------------- /assets/fontawesome/README.md: -------------------------------------------------------------------------------- 1 |

Font Awesome Free

2 | 3 | > Version 5 – the iconic SVG, font, and CSS framework 4 | 5 | The internet's most popular icon toolkit has been redesigned and built from 6 | scratch. On top of this, features like icon font ligatures, an SVG framework, 7 | official NPM packages for popular frontend libraries like React, and access to 8 | a new CDN. 9 | 10 | Not familiar with Font Awesome 5? [Learn 11 | more](https://www.kickstarter.com/projects/232193852/font-awesome-5) about our 12 | successful Kickstarter and plan. You can also **[order Font Awesome 13 | Pro](https://fontawesome.com/pro)** which includes tons more icons directly 14 | from [fontawesome.com](https://fontawesome.com). 15 | 16 | ## Documentation 17 | 18 | Learn how to get started with Font Awesome and then dive deeper into other and advanced topics: 19 | 20 | ### Using Font Awesome on the Web 21 | 22 | * [With SVG with JavaScript](https://fontawesome.com/how-to-use/on-the-web/setup/getting-started?using=svg-with-js) 23 | * [With web fonts with CSS](https://fontawesome.com/how-to-use/on-the-web/setup/getting-started?using=web-fonts-with-css) 24 | * [Upgrading from version 4](https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4) 25 | * [Installing Font Awesome with a package manager](https://fontawesome.com/how-to-use/on-the-web/setup/using-package-managers) 26 | * [Downloading + hosting Font Awesome yourself](https://fontawesome.com/how-to-use/on-the-web/setup/hosting-font-awesome-yourself) 27 | * [Performance and security](https://fontawesome.com/how-to-use/performance-and-security) 28 | * [Accessibility](https://fontawesome.com/how-to-use/on-the-web/other-topics/accessibility) 29 | * [Troubleshooting](https://fontawesome.com/how-to-use/on-the-web/other-topics/troubleshooting) 30 | 31 | #### Advanced Options & Techniques 32 | 33 | * [Using CSS pseudo-elements](https://fontawesome.com/how-to-use/on-the-web/advanced/css-pseudo-elements) 34 | * [SVG sprites](https://fontawesome.com/how-to-use/svg-sprites) 35 | * [The Font Awesome API](https://fontawesome.com/how-to-use/font-awesome-api) 36 | * [SVG symbols](https://fontawesome.com/how-to-use/on-the-web/advanced/svg-symbols) 37 | * [SVG JavaScript Core](https://fontawesome.com/how-to-use/on-the-web/advanced/svg-javascript-core) 38 | * [Server side rendering](https://fontawesome.com/how-to-use/server-side-rendering) 39 | 40 | ### Using Font Awesome on the Desktop 41 | 42 | * [Getting started](https://fontawesome.com/how-to-use/on-the-desktop/setup/getting-started) 43 | * [Upgrading from version 4](https://fontawesome.com/how-to-use/on-the-desktop/setup/upgrading-from-version-4) 44 | * [Using ligatures](https://fontawesome.com/how-to-use/on-the-desktop/referencing-icons/using-ligatures) 45 | * [Using glyphs](https://fontawesome.com/how-to-use/on-the-desktop/referencing-icons/using-glyphs) 46 | * [Troubleshooting](https://fontawesome.com/how-to-use/on-the-desktop/other-topics/troubleshooting) 47 | 48 | ### Where did Font Awesome 4 (or 3) go? 49 | 50 | Now that Font Awesome 5 has been released we are marking version 4 as 51 | end-of-life. We don't plan on releasing any further versions of the 4.x or 3.x. 52 | 53 | Documentation is still available but it's moved to 54 | [https://fontawesome.com/v4.7.0](https://fontawesome.com/v4.7.0) and 55 | [https://fontawesome.com/v3.2.1](https://fontawesome.com/v3.2.1). 56 | 57 | The Git repository for 58 | [v4.7.0](https://github.com/FortAwesome/Font-Awesome/releases/tag/v4.7.0) and 59 | [v3.2.1](https://github.com/FortAwesome/Font-Awesome/releases/tag/v3.2.1) can 60 | be found in our GitHub releases. 61 | 62 | ## Change log 63 | 64 | We'll keep track of each release in the [CHANGELOG.md](./CHANGELOG.md) 65 | 66 | Looking for older versions of Font Awesome? Check the [releases](https://github.com/FortAwesome/Font-Awesome/releases). 67 | 68 | ## Upgrading 69 | 70 | From time-to-time we'll have special upgrading instructions from one version to the next. 71 | 72 | Check out the [UPGRADING.md](./UPGRADING.md) guide when you upgrade your dependencies. 73 | 74 | ## Code of conduct 75 | 76 | We will behave ourselves if you behave yourselves. For more details see our 77 | [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md). 78 | 79 | ## Contributing 80 | 81 | Please read through our [contributing guidelines](./CONTRIBUTING.md). Included 82 | are directions for opening issues. 83 | 84 | ## Versioning 85 | 86 | Font Awesome will be maintained under the Semantic Versioning guidelines as much as possible. Releases will be numbered 87 | with the following format: 88 | 89 | `..` 90 | 91 | For more information on SemVer, please visit http://semver.org. 92 | 93 | **The major version "5" is part of an umbrella release. It includes many different types of files and technologies. Therefore 94 | we deviate from normal SemVer in the following ways:** 95 | 96 | * Any release may update the design, look-and-feel, or branding of an existing 97 | icon 98 | * We will never intentionally release a `patch` version update that breaks 99 | backward compatibility 100 | * A `minor` release **may include backward-incompatible changes** but we will 101 | write clear upgrading instructions in UPGRADING.md 102 | * A `minor` or `patch` release will never remove icons 103 | * Bug fixes will be addressed as `patch` releases unless they include backward 104 | incompatibility then they will be `minor` releases 105 | 106 | ## License 107 | 108 | Font Awesome Free is free, open source, and GPL friendly. You can use it for 109 | commercial projects, open source projects, or really almost whatever you want. 110 | 111 | - Icons — CC BY 4.0 License 112 | - In the Font Awesome Free download, the CC BY 4.0 license applies to all icons packaged as .svg and .js files types. 113 | - Fonts — SIL OFL 1.1 License 114 | - In the Font Awesome Free download, the SIL OLF license applies to all icons packaged as web and desktop font files. 115 | - Code — MIT License 116 | - In the Font Awesome Free download, the MIT license applies to all non-font and non-icon files. 117 | 118 | Attribution is required by MIT, SIL OLF, and CC BY licenses. Downloaded Font 119 | Awesome Free files already contain embedded comments with sufficient 120 | attribution, so you shouldn't need to do anything additional when using these 121 | files normally. 122 | 123 | We've kept attribution comments terse, so we ask that you do not actively work 124 | to remove them from files, especially code. They're a great way for folks to 125 | learn about Font Awesome. 126 | 127 | ## Team 128 | * [Dave Gandy](https://github.com/davegandy) 129 | * [Travis Chase](https://github.com/supercodepoet) 130 | * [Rob Madole](https://github.com/robmadole) 131 | * [Brian Talbot](https://github.com/talbs) 132 | * [Jory Raphael](https://github.com/sensibleworld) 133 | * [Mike Wilkerson](https://github.com/mlwilkerson) 134 | * [Frances Botsford](https://github.com/frrrances) 135 | * [Trevor Chase](https://github.com/trevorchase) 136 | * [Jason Lundien](https://github.com/jasonlundien) 137 | * [Jason Otero](https://github.com/deathnfudge) 138 | * [Edward Emanuel](https://github.com/ej2) 139 | * [Kelsey Jackson](https://github.com/kelseythejackson) 140 | * [Geremia Taglialatela](https://github.com/tagliala) 141 | -------------------------------------------------------------------------------- /assets/katex/README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 | 4 | KaTeX 5 | 6 |

7 | 8 | [![npm](https://img.shields.io/npm/v/katex.svg)](https://www.npmjs.com/package/katex) 9 | [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) 10 | [![CI](https://github.com/KaTeX/KaTeX/workflows/CI/badge.svg?branch=main&event=push)](https://github.com/KaTeX/KaTeX/actions?query=workflow%3ACI) 11 | [![codecov](https://codecov.io/gh/KaTeX/KaTeX/branch/main/graph/badge.svg)](https://codecov.io/gh/KaTeX/KaTeX) 12 | [![Discussions](https://img.shields.io/badge/Discussions-join-brightgreen)](https://github.com/KaTeX/KaTeX/discussions) 13 | [![jsDelivr](https://data.jsdelivr.com/v1/package/npm/katex/badge?style=rounded)](https://www.jsdelivr.com/package/npm/katex) 14 | ![katex.min.js size](https://img.badgesize.io/https://unpkg.com/katex/dist/katex.min.js?compression=gzip) 15 | [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/KaTeX/KaTeX) 16 | [![Financial Contributors on Open Collective](https://opencollective.com/katex/all/badge.svg?label=financial+contributors)](https://opencollective.com/katex) 17 | 18 | KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering on the web. 19 | 20 | * **Fast:** KaTeX renders its math synchronously and doesn't need to reflow the page. See how it compares to a competitor in [this speed test](https://www.intmath.com/cg5/katex-mathjax-comparison.php). 21 | * **Print quality:** KaTeX's layout is based on Donald Knuth's TeX, the gold standard for math typesetting. 22 | * **Self contained:** KaTeX has no dependencies and can easily be bundled with your website resources. 23 | * **Server side rendering:** KaTeX produces the same output regardless of browser or environment, so you can pre-render expressions using Node.js and send them as plain HTML. 24 | 25 | KaTeX is compatible with all major browsers, including Chrome, Safari, Firefox, Opera, Edge, and IE 11. 26 | 27 | KaTeX supports much (but not all) of LaTeX and many LaTeX packages. See the [list of supported functions](https://katex.org/docs/supported.html). 28 | 29 | Try out KaTeX [on the demo page](https://katex.org/#demo)! 30 | 31 | ## Getting started 32 | 33 | ### Starter template 34 | 35 | ```html 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 48 | 49 | ... 50 | 51 | ``` 52 | 53 | You can also [download KaTeX](https://github.com/KaTeX/KaTeX/releases) and host it yourself. 54 | 55 | For details on how to configure auto-render extension, refer to [the documentation](https://katex.org/docs/autorender.html). 56 | 57 | ### API 58 | 59 | Call `katex.render` to render a TeX expression directly into a DOM element. 60 | For example: 61 | 62 | ```js 63 | katex.render("c = \\pm\\sqrt{a^2 + b^2}", element, { 64 | throwOnError: false 65 | }); 66 | ``` 67 | 68 | Call `katex.renderToString` to generate an HTML string of the rendered math, 69 | e.g., for server-side rendering. For example: 70 | 71 | ```js 72 | var html = katex.renderToString("c = \\pm\\sqrt{a^2 + b^2}", { 73 | throwOnError: false 74 | }); 75 | // '...' 76 | ``` 77 | 78 | Make sure to include the CSS and font files in both cases. 79 | If you are doing all rendering on the server, there is no need to include the 80 | JavaScript on the client. 81 | 82 | The examples above use the `throwOnError: false` option, which renders invalid 83 | inputs as the TeX source code in red (by default), with the error message as 84 | hover text. For other available options, see the 85 | [API documentation](https://katex.org/docs/api.html), 86 | [options documentation](https://katex.org/docs/options.html), and 87 | [handling errors documentation](https://katex.org/docs/error.html). 88 | 89 | ## Demo and Documentation 90 | 91 | Learn more about using KaTeX [on the website](https://katex.org)! 92 | 93 | ## Contributors 94 | 95 | ### Code Contributors 96 | 97 | This project exists thanks to all the people who contribute code. If you'd like to help, see [our guide to contributing code](CONTRIBUTING.md). 98 | Code contributors 99 | 100 | ### Financial Contributors 101 | 102 | Become a financial contributor and help us sustain our community. 103 | 104 | #### Individuals 105 | 106 | Contribute on Open Collective 107 | 108 | #### Organizations 109 | 110 | Support this project with your organization. Your logo will show up here with a link to your website. 111 | 112 | Organization 1 113 | Organization 2 114 | Organization 3 115 | Organization 4 116 | Organization 5 117 | Organization 6 118 | Organization 7 119 | Organization 8 120 | Organization 9 121 | Organization 10 122 | 123 | ## License 124 | 125 | KaTeX is licensed under the [MIT License](https://opensource.org/licenses/MIT). 126 | -------------------------------------------------------------------------------- /assets/katex/contrib/auto-render.mjs: -------------------------------------------------------------------------------- 1 | import katex from '../katex.mjs'; 2 | 3 | /* eslint no-constant-condition:0 */ 4 | var findEndOfMath = function findEndOfMath(delimiter, text, startIndex) { 5 | // Adapted from 6 | // https://github.com/Khan/perseus/blob/master/src/perseus-markdown.jsx 7 | var index = startIndex; 8 | var braceLevel = 0; 9 | var delimLength = delimiter.length; 10 | 11 | while (index < text.length) { 12 | var character = text[index]; 13 | 14 | if (braceLevel <= 0 && text.slice(index, index + delimLength) === delimiter) { 15 | return index; 16 | } else if (character === "\\") { 17 | index++; 18 | } else if (character === "{") { 19 | braceLevel++; 20 | } else if (character === "}") { 21 | braceLevel--; 22 | } 23 | 24 | index++; 25 | } 26 | 27 | return -1; 28 | }; 29 | 30 | var escapeRegex = function escapeRegex(string) { 31 | return string.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"); 32 | }; 33 | 34 | var amsRegex = /^\\begin{/; 35 | 36 | var splitAtDelimiters = function splitAtDelimiters(text, delimiters) { 37 | var index; 38 | var data = []; 39 | var regexLeft = new RegExp("(" + delimiters.map(x => escapeRegex(x.left)).join("|") + ")"); 40 | 41 | while (true) { 42 | index = text.search(regexLeft); 43 | 44 | if (index === -1) { 45 | break; 46 | } 47 | 48 | if (index > 0) { 49 | data.push({ 50 | type: "text", 51 | data: text.slice(0, index) 52 | }); 53 | text = text.slice(index); // now text starts with delimiter 54 | } // ... so this always succeeds: 55 | 56 | 57 | var i = delimiters.findIndex(delim => text.startsWith(delim.left)); 58 | index = findEndOfMath(delimiters[i].right, text, delimiters[i].left.length); 59 | 60 | if (index === -1) { 61 | break; 62 | } 63 | 64 | var rawData = text.slice(0, index + delimiters[i].right.length); 65 | var math = amsRegex.test(rawData) ? rawData : text.slice(delimiters[i].left.length, index); 66 | data.push({ 67 | type: "math", 68 | data: math, 69 | rawData, 70 | display: delimiters[i].display 71 | }); 72 | text = text.slice(index + delimiters[i].right.length); 73 | } 74 | 75 | if (text !== "") { 76 | data.push({ 77 | type: "text", 78 | data: text 79 | }); 80 | } 81 | 82 | return data; 83 | }; 84 | 85 | /* eslint no-console:0 */ 86 | /* Note: optionsCopy is mutated by this method. If it is ever exposed in the 87 | * API, we should copy it before mutating. 88 | */ 89 | 90 | var renderMathInText = function renderMathInText(text, optionsCopy) { 91 | var data = splitAtDelimiters(text, optionsCopy.delimiters); 92 | 93 | if (data.length === 1 && data[0].type === 'text') { 94 | // There is no formula in the text. 95 | // Let's return null which means there is no need to replace 96 | // the current text node with a new one. 97 | return null; 98 | } 99 | 100 | var fragment = document.createDocumentFragment(); 101 | 102 | for (var i = 0; i < data.length; i++) { 103 | if (data[i].type === "text") { 104 | fragment.appendChild(document.createTextNode(data[i].data)); 105 | } else { 106 | var span = document.createElement("span"); 107 | var math = data[i].data; // Override any display mode defined in the settings with that 108 | // defined by the text itself 109 | 110 | optionsCopy.displayMode = data[i].display; 111 | 112 | try { 113 | if (optionsCopy.preProcess) { 114 | math = optionsCopy.preProcess(math); 115 | } 116 | 117 | katex.render(math, span, optionsCopy); 118 | } catch (e) { 119 | if (!(e instanceof katex.ParseError)) { 120 | throw e; 121 | } 122 | 123 | optionsCopy.errorCallback("KaTeX auto-render: Failed to parse `" + data[i].data + "` with ", e); 124 | fragment.appendChild(document.createTextNode(data[i].rawData)); 125 | continue; 126 | } 127 | 128 | fragment.appendChild(span); 129 | } 130 | } 131 | 132 | return fragment; 133 | }; 134 | 135 | var renderElem = function renderElem(elem, optionsCopy) { 136 | for (var i = 0; i < elem.childNodes.length; i++) { 137 | var childNode = elem.childNodes[i]; 138 | 139 | if (childNode.nodeType === 3) { 140 | // Text node 141 | // Concatenate all sibling text nodes. 142 | // Webkit browsers split very large text nodes into smaller ones, 143 | // so the delimiters may be split across different nodes. 144 | var textContentConcat = childNode.textContent; 145 | var sibling = childNode.nextSibling; 146 | var nSiblings = 0; 147 | 148 | while (sibling && sibling.nodeType === Node.TEXT_NODE) { 149 | textContentConcat += sibling.textContent; 150 | sibling = sibling.nextSibling; 151 | nSiblings++; 152 | } 153 | 154 | var frag = renderMathInText(textContentConcat, optionsCopy); 155 | 156 | if (frag) { 157 | // Remove extra text nodes 158 | for (var j = 0; j < nSiblings; j++) { 159 | childNode.nextSibling.remove(); 160 | } 161 | 162 | i += frag.childNodes.length - 1; 163 | elem.replaceChild(frag, childNode); 164 | } else { 165 | // If the concatenated text does not contain math 166 | // the siblings will not either 167 | i += nSiblings; 168 | } 169 | } else if (childNode.nodeType === 1) { 170 | (function () { 171 | // Element node 172 | var className = ' ' + childNode.className + ' '; 173 | var shouldRender = optionsCopy.ignoredTags.indexOf(childNode.nodeName.toLowerCase()) === -1 && optionsCopy.ignoredClasses.every(x => className.indexOf(' ' + x + ' ') === -1); 174 | 175 | if (shouldRender) { 176 | renderElem(childNode, optionsCopy); 177 | } 178 | })(); 179 | } // Otherwise, it's something else, and ignore it. 180 | 181 | } 182 | }; 183 | 184 | var renderMathInElement = function renderMathInElement(elem, options) { 185 | if (!elem) { 186 | throw new Error("No element provided to render"); 187 | } 188 | 189 | var optionsCopy = {}; // Object.assign(optionsCopy, option) 190 | 191 | for (var option in options) { 192 | if (options.hasOwnProperty(option)) { 193 | optionsCopy[option] = options[option]; 194 | } 195 | } // default options 196 | 197 | 198 | optionsCopy.delimiters = optionsCopy.delimiters || [{ 199 | left: "$$", 200 | right: "$$", 201 | display: true 202 | }, { 203 | left: "\\(", 204 | right: "\\)", 205 | display: false 206 | }, // LaTeX uses $…$, but it ruins the display of normal `$` in text: 207 | // {left: "$", right: "$", display: false}, 208 | // $ must come after $$ 209 | // Render AMS environments even if outside $$…$$ delimiters. 210 | { 211 | left: "\\begin{equation}", 212 | right: "\\end{equation}", 213 | display: true 214 | }, { 215 | left: "\\begin{align}", 216 | right: "\\end{align}", 217 | display: true 218 | }, { 219 | left: "\\begin{alignat}", 220 | right: "\\end{alignat}", 221 | display: true 222 | }, { 223 | left: "\\begin{gather}", 224 | right: "\\end{gather}", 225 | display: true 226 | }, { 227 | left: "\\begin{CD}", 228 | right: "\\end{CD}", 229 | display: true 230 | }, { 231 | left: "\\[", 232 | right: "\\]", 233 | display: true 234 | }]; 235 | optionsCopy.ignoredTags = optionsCopy.ignoredTags || ["script", "noscript", "style", "textarea", "pre", "code", "option"]; 236 | optionsCopy.ignoredClasses = optionsCopy.ignoredClasses || []; 237 | optionsCopy.errorCallback = optionsCopy.errorCallback || console.error; // Enable sharing of global macros defined via `\gdef` between different 238 | // math elements within a single call to `renderMathInElement`. 239 | 240 | optionsCopy.macros = optionsCopy.macros || {}; 241 | renderElem(elem, optionsCopy); 242 | }; 243 | 244 | export { renderMathInElement as default }; 245 | -------------------------------------------------------------------------------- /assets/katex/contrib/render-a11y-string.min.js: -------------------------------------------------------------------------------- 1 | !function(e,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r(require("katex"));else if("function"==typeof define&&define.amd)define(["katex"],r);else{var t="object"==typeof exports?r(require("katex")):r(e.katex);for(var a in t)("object"==typeof exports?exports:e)[a]=t[a]}}("undefined"!=typeof self?self:this,(function(e){return function(){"use strict";var r={757:function(r){r.exports=e}},t={};function a(e){var o=t[e];if(void 0!==o)return o.exports;var n=t[e]={exports:{}};return r[e](n,n.exports,a),n.exports}a.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(r,{a:r}),r},a.d=function(e,r){for(var t in r)a.o(r,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},a.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)};var o={},n=a(757),s=a.n(n);const l={"(":"left parenthesis",")":"right parenthesis","[":"open bracket","]":"close bracket","\\{":"left brace","\\}":"right brace","\\lvert":"open vertical bar","\\rvert":"close vertical bar","|":"vertical bar","\\uparrow":"up arrow","\\Uparrow":"up arrow","\\downarrow":"down arrow","\\Downarrow":"down arrow","\\updownarrow":"up down arrow","\\leftarrow":"left arrow","\\Leftarrow":"left arrow","\\rightarrow":"right arrow","\\Rightarrow":"right arrow","\\langle":"open angle","\\rangle":"close angle","\\lfloor":"open floor","\\rfloor":"close floor","\\int":"integral","\\intop":"integral","\\lim":"limit","\\ln":"natural log","\\log":"log","\\sin":"sine","\\cos":"cosine","\\tan":"tangent","\\cot":"cotangent","\\sum":"sum","/":"slash",",":"comma",".":"point","-":"negative","+":"plus","~":"tilde",":":"colon","?":"question mark","'":"apostrophe","\\%":"percent"," ":"space","\\ ":"space","\\$":"dollar sign","\\angle":"angle","\\degree":"degree","\\circ":"circle","\\vec":"vector","\\triangle":"triangle","\\pi":"pi","\\prime":"prime","\\infty":"infinity","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\omega":"omega","\\theta":"theta","\\sigma":"sigma","\\lambda":"lambda","\\tau":"tau","\\Delta":"delta","\\delta":"delta","\\mu":"mu","\\rho":"rho","\\nabla":"del","\\ell":"ell","\\ldots":"dots","\\hat":"hat","\\acute":"acute"},i={prime:"prime",degree:"degrees",circle:"degrees",2:"squared",3:"cubed"},c={"|":"open vertical bar",".":""},p={"|":"close vertical bar",".":""},u={"+":"plus","-":"minus","\\pm":"plus minus","\\cdot":"dot","*":"times","/":"divided by","\\times":"times","\\div":"divided by","\\circ":"circle","\\bullet":"bullet"},d={"=":"equals","\\approx":"approximately equals","\u2260":"does not equal","\\geq":"is greater than or equal to","\\ge":"is greater than or equal to","\\leq":"is less than or equal to","\\le":"is less than or equal to",">":"is greater than","<":"is less than","\\leftarrow":"left arrow","\\Leftarrow":"left arrow","\\rightarrow":"right arrow","\\Rightarrow":"right arrow",":":"colon"},h={"\\underleftarrow":"left arrow","\\underrightarrow":"right arrow","\\underleftrightarrow":"left-right arrow","\\undergroup":"group","\\underlinesegment":"line segment","\\utilde":"tilde"},b=(e,r,t)=>{if(!e)return;let a;a="open"===r?e in c?c[e]:l[e]||e:"close"===r?e in p?p[e]:l[e]||e:"bin"===r?u[e]||e:"rel"===r?d[e]||e:l[e]||e,/^\d+$/.test(a)&&t.length>0&&/^\d+$/.test(t[t.length-1])?t[t.length-1]+=a:a&&t.push(a)},m=(e,r)=>{const t=[];e.push(t),r(t)},f=function(e,r,t){if(void 0===r&&(r=[]),e instanceof Array)for(let a=0;a{switch(e.type){case"accent":m(r,(r=>{f(e.base,r,t),r.push("with"),b(e.label,"normal",r),r.push("on top")}));break;case"accentUnder":m(r,(r=>{f(e.base,r,t),r.push("with"),b(h[e.label],"normal",r),r.push("underneath")}));break;case"accent-token":case"color-token":case"kern":case"leftright-right":case"size":case"infix":case"internal":break;case"atom":{const{text:t}=e;switch(e.family){case"bin":b(t,"bin",r);break;case"close":b(t,"close",r);break;case"inner":b(e.text,"inner",r);break;case"open":b(t,"open",r);break;case"punct":b(t,"punct",r);break;case"rel":b(t,"rel",r);break;default:throw e.family,new Error('"'+e.family+'" is not a valid atom type')}break}case"color":{const a=e.color.replace(/katex-/,"");m(r,(r=>{r.push("start color "+a),f(e.body,r,t),r.push("end color "+a)}));break}case"delimsizing":e.delim&&"."!==e.delim&&b(e.delim,"normal",r);break;case"genfrac":m(r,(r=>{const{leftDelim:a,rightDelim:o}=e;e.hasBarLine?(r.push("start fraction"),a&&b(a,"open",r),f(e.numer,r,t),r.push("divided by"),f(e.denom,r,t),o&&b(o,"close",r),r.push("end fraction")):(r.push("start binomial"),a&&b(a,"open",r),f(e.numer,r,t),r.push("over"),f(e.denom,r,t),o&&b(o,"close",r),r.push("end binomial"))}));break;case"hbox":case"lap":case"ordgroup":case"raisebox":case"sizing":case"styling":case"smash":case"vcenter":case"operatorname":case"font":case"html":f(e.body,r,t);break;case"leftright":m(r,(r=>{b(e.left,"open",r),f(e.body,r,t),b(e.right,"close",r)}));break;case"mathord":b(e.text,"normal",r);break;case"op":{const{body:a,name:o}=e;a?f(a,r,t):o&&b(o,"normal",r);break}case"op-token":case"textord":b(e.text,t,r);break;case"overline":m(r,(function(r){r.push("start overline"),f(e.body,r,t),r.push("end overline")}));break;case"pmb":r.push("bold");break;case"phantom":r.push("empty space");break;case"rule":r.push("rectangle");break;case"spacing":r.push("space");break;case"sqrt":m(r,(r=>{const{body:a,index:o}=e;if(o)return"3"===w(f(o,[],t)).join(",")?(r.push("cube root of"),f(a,r,t),void r.push("end cube root")):(r.push("root"),r.push("start index"),f(o,r,t),void r.push("end index"));r.push("square root of"),f(a,r,t),r.push("end square root")}));break;case"supsub":{const{base:a,sub:o,sup:n}=e;let s=!1;if(a&&(f(a,r,t),s="op"===a.type&&"\\log"===a.name),o){const e=s?"base":"subscript";m(r,(function(r){r.push("start "+e),f(o,r,t),r.push("end "+e)}))}n&&m(r,(function(e){const r=w(f(n,[],t)).join(",");r in i?e.push(i[r]):(e.push("start superscript"),f(n,e,t),e.push("end superscript"))}));break}case"text":if("\\textbf"===e.font){m(r,(function(r){r.push("start bold text"),f(e.body,r,t),r.push("end bold text")}));break}m(r,(function(r){r.push("start text"),f(e.body,r,t),r.push("end text")}));break;case"enclose":if(/cancel/.test(e.label)){m(r,(function(r){r.push("start cancel"),f(e.body,r,t),r.push("end cancel")}));break}if(/box/.test(e.label)){m(r,(function(r){r.push("start box"),f(e.body,r,t),r.push("end box")}));break}if(/sout/.test(e.label)){m(r,(function(r){r.push("start strikeout"),f(e.body,r,t),r.push("end strikeout")}));break}if(/phase/.test(e.label)){m(r,(function(r){r.push("start phase angle"),f(e.body,r,t),r.push("end phase angle")}));break}throw new Error("KaTeX-a11y: enclose node with "+e.label+" not supported yet");case"vphantom":throw new Error("KaTeX-a11y: vphantom not implemented yet");case"hphantom":throw new Error("KaTeX-a11y: hphantom not implemented yet");case"array":throw new Error("KaTeX-a11y: array not implemented yet");case"raw":throw new Error("KaTeX-a11y: raw not implemented yet");case"url":throw new Error("KaTeX-a11y: url not implemented yet");case"tag":throw new Error("KaTeX-a11y: tag not implemented yet");case"verb":b("start verbatim","normal",r),b(e.body,"normal",r),b("end verbatim","normal",r);break;case"environment":throw new Error("KaTeX-a11y: environment not implemented yet");case"horizBrace":b("start "+e.label.slice(1),"normal",r),f(e.base,r,t),b("end "+e.label.slice(1),"normal",r);break;case"includegraphics":throw new Error("KaTeX-a11y: includegraphics not implemented yet");case"href":throw new Error("KaTeX-a11y: href not implemented yet");case"cr":throw new Error("KaTeX-a11y: cr not implemented yet");case"underline":m(r,(function(r){r.push("start underline"),f(e.body,r,t),r.push("end underline")}));break;case"xArrow":throw new Error("KaTeX-a11y: xArrow not implemented yet");case"cdlabel":throw new Error("KaTeX-a11y: cdlabel not implemented yet");case"cdlabelparent":throw new Error("KaTeX-a11y: cdlabelparent not implemented yet");case"mclass":{const t=e.mclass.slice(1);f(e.body,r,t);break}case"mathchoice":f(e.text,r,t);break;case"htmlmathml":f(e.mathml,r,t);break;case"middle":b(e.delim,t,r);break;default:throw e.type,new Error("KaTeX a11y un-recognized type: "+e.type)}})(e,r,t);return r},w=function(e){let r=[];return e.forEach((function(e){e instanceof Array?r=r.concat(w(e)):r.push(e)})),r};return o.default=function(e,r){const t=s().__parse(e,r),a=f(t,[],"normal");return w(a).join(", ")},o=o.default}()})); -------------------------------------------------------------------------------- /assets/katex/contrib/auto-render.js: -------------------------------------------------------------------------------- 1 | (function webpackUniversalModuleDefinition(root, factory) { 2 | if(typeof exports === 'object' && typeof module === 'object') 3 | module.exports = factory(require("katex")); 4 | else if(typeof define === 'function' && define.amd) 5 | define(["katex"], factory); 6 | else if(typeof exports === 'object') 7 | exports["renderMathInElement"] = factory(require("katex")); 8 | else 9 | root["renderMathInElement"] = factory(root["katex"]); 10 | })((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__757__) { 11 | return /******/ (function() { // webpackBootstrap 12 | /******/ "use strict"; 13 | /******/ var __webpack_modules__ = ({ 14 | 15 | /***/ 757: 16 | /***/ (function(module) { 17 | 18 | module.exports = __WEBPACK_EXTERNAL_MODULE__757__; 19 | 20 | /***/ }) 21 | 22 | /******/ }); 23 | /************************************************************************/ 24 | /******/ // The module cache 25 | /******/ var __webpack_module_cache__ = {}; 26 | /******/ 27 | /******/ // The require function 28 | /******/ function __webpack_require__(moduleId) { 29 | /******/ // Check if module is in cache 30 | /******/ var cachedModule = __webpack_module_cache__[moduleId]; 31 | /******/ if (cachedModule !== undefined) { 32 | /******/ return cachedModule.exports; 33 | /******/ } 34 | /******/ // Create a new module (and put it into the cache) 35 | /******/ var module = __webpack_module_cache__[moduleId] = { 36 | /******/ // no module.id needed 37 | /******/ // no module.loaded needed 38 | /******/ exports: {} 39 | /******/ }; 40 | /******/ 41 | /******/ // Execute the module function 42 | /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 43 | /******/ 44 | /******/ // Return the exports of the module 45 | /******/ return module.exports; 46 | /******/ } 47 | /******/ 48 | /************************************************************************/ 49 | /******/ /* webpack/runtime/compat get default export */ 50 | /******/ !function() { 51 | /******/ // getDefaultExport function for compatibility with non-harmony modules 52 | /******/ __webpack_require__.n = function(module) { 53 | /******/ var getter = module && module.__esModule ? 54 | /******/ function() { return module['default']; } : 55 | /******/ function() { return module; }; 56 | /******/ __webpack_require__.d(getter, { a: getter }); 57 | /******/ return getter; 58 | /******/ }; 59 | /******/ }(); 60 | /******/ 61 | /******/ /* webpack/runtime/define property getters */ 62 | /******/ !function() { 63 | /******/ // define getter functions for harmony exports 64 | /******/ __webpack_require__.d = function(exports, definition) { 65 | /******/ for(var key in definition) { 66 | /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 67 | /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 68 | /******/ } 69 | /******/ } 70 | /******/ }; 71 | /******/ }(); 72 | /******/ 73 | /******/ /* webpack/runtime/hasOwnProperty shorthand */ 74 | /******/ !function() { 75 | /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } 76 | /******/ }(); 77 | /******/ 78 | /************************************************************************/ 79 | var __webpack_exports__ = {}; 80 | 81 | // EXPORTS 82 | __webpack_require__.d(__webpack_exports__, { 83 | "default": function() { return /* binding */ auto_render; } 84 | }); 85 | 86 | // EXTERNAL MODULE: external "katex" 87 | var external_katex_ = __webpack_require__(757); 88 | var external_katex_default = /*#__PURE__*/__webpack_require__.n(external_katex_); 89 | ;// CONCATENATED MODULE: ./contrib/auto-render/splitAtDelimiters.js 90 | /* eslint no-constant-condition:0 */ 91 | const findEndOfMath = function (delimiter, text, startIndex) { 92 | // Adapted from 93 | // https://github.com/Khan/perseus/blob/master/src/perseus-markdown.jsx 94 | let index = startIndex; 95 | let braceLevel = 0; 96 | const delimLength = delimiter.length; 97 | 98 | while (index < text.length) { 99 | const character = text[index]; 100 | 101 | if (braceLevel <= 0 && text.slice(index, index + delimLength) === delimiter) { 102 | return index; 103 | } else if (character === "\\") { 104 | index++; 105 | } else if (character === "{") { 106 | braceLevel++; 107 | } else if (character === "}") { 108 | braceLevel--; 109 | } 110 | 111 | index++; 112 | } 113 | 114 | return -1; 115 | }; 116 | 117 | const escapeRegex = function (string) { 118 | return string.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"); 119 | }; 120 | 121 | const amsRegex = /^\\begin{/; 122 | 123 | const splitAtDelimiters = function (text, delimiters) { 124 | let index; 125 | const data = []; 126 | const regexLeft = new RegExp("(" + delimiters.map(x => escapeRegex(x.left)).join("|") + ")"); 127 | 128 | while (true) { 129 | index = text.search(regexLeft); 130 | 131 | if (index === -1) { 132 | break; 133 | } 134 | 135 | if (index > 0) { 136 | data.push({ 137 | type: "text", 138 | data: text.slice(0, index) 139 | }); 140 | text = text.slice(index); // now text starts with delimiter 141 | } // ... so this always succeeds: 142 | 143 | 144 | const i = delimiters.findIndex(delim => text.startsWith(delim.left)); 145 | index = findEndOfMath(delimiters[i].right, text, delimiters[i].left.length); 146 | 147 | if (index === -1) { 148 | break; 149 | } 150 | 151 | const rawData = text.slice(0, index + delimiters[i].right.length); 152 | const math = amsRegex.test(rawData) ? rawData : text.slice(delimiters[i].left.length, index); 153 | data.push({ 154 | type: "math", 155 | data: math, 156 | rawData, 157 | display: delimiters[i].display 158 | }); 159 | text = text.slice(index + delimiters[i].right.length); 160 | } 161 | 162 | if (text !== "") { 163 | data.push({ 164 | type: "text", 165 | data: text 166 | }); 167 | } 168 | 169 | return data; 170 | }; 171 | 172 | /* harmony default export */ var auto_render_splitAtDelimiters = (splitAtDelimiters); 173 | ;// CONCATENATED MODULE: ./contrib/auto-render/auto-render.js 174 | /* eslint no-console:0 */ 175 | 176 | 177 | /* Note: optionsCopy is mutated by this method. If it is ever exposed in the 178 | * API, we should copy it before mutating. 179 | */ 180 | 181 | const renderMathInText = function (text, optionsCopy) { 182 | const data = auto_render_splitAtDelimiters(text, optionsCopy.delimiters); 183 | 184 | if (data.length === 1 && data[0].type === 'text') { 185 | // There is no formula in the text. 186 | // Let's return null which means there is no need to replace 187 | // the current text node with a new one. 188 | return null; 189 | } 190 | 191 | const fragment = document.createDocumentFragment(); 192 | 193 | for (let i = 0; i < data.length; i++) { 194 | if (data[i].type === "text") { 195 | fragment.appendChild(document.createTextNode(data[i].data)); 196 | } else { 197 | const span = document.createElement("span"); 198 | let math = data[i].data; // Override any display mode defined in the settings with that 199 | // defined by the text itself 200 | 201 | optionsCopy.displayMode = data[i].display; 202 | 203 | try { 204 | if (optionsCopy.preProcess) { 205 | math = optionsCopy.preProcess(math); 206 | } 207 | 208 | external_katex_default().render(math, span, optionsCopy); 209 | } catch (e) { 210 | if (!(e instanceof (external_katex_default()).ParseError)) { 211 | throw e; 212 | } 213 | 214 | optionsCopy.errorCallback("KaTeX auto-render: Failed to parse `" + data[i].data + "` with ", e); 215 | fragment.appendChild(document.createTextNode(data[i].rawData)); 216 | continue; 217 | } 218 | 219 | fragment.appendChild(span); 220 | } 221 | } 222 | 223 | return fragment; 224 | }; 225 | 226 | const renderElem = function (elem, optionsCopy) { 227 | for (let i = 0; i < elem.childNodes.length; i++) { 228 | const childNode = elem.childNodes[i]; 229 | 230 | if (childNode.nodeType === 3) { 231 | // Text node 232 | // Concatenate all sibling text nodes. 233 | // Webkit browsers split very large text nodes into smaller ones, 234 | // so the delimiters may be split across different nodes. 235 | let textContentConcat = childNode.textContent; 236 | let sibling = childNode.nextSibling; 237 | let nSiblings = 0; 238 | 239 | while (sibling && sibling.nodeType === Node.TEXT_NODE) { 240 | textContentConcat += sibling.textContent; 241 | sibling = sibling.nextSibling; 242 | nSiblings++; 243 | } 244 | 245 | const frag = renderMathInText(textContentConcat, optionsCopy); 246 | 247 | if (frag) { 248 | // Remove extra text nodes 249 | for (let j = 0; j < nSiblings; j++) { 250 | childNode.nextSibling.remove(); 251 | } 252 | 253 | i += frag.childNodes.length - 1; 254 | elem.replaceChild(frag, childNode); 255 | } else { 256 | // If the concatenated text does not contain math 257 | // the siblings will not either 258 | i += nSiblings; 259 | } 260 | } else if (childNode.nodeType === 1) { 261 | // Element node 262 | const className = ' ' + childNode.className + ' '; 263 | const shouldRender = optionsCopy.ignoredTags.indexOf(childNode.nodeName.toLowerCase()) === -1 && optionsCopy.ignoredClasses.every(x => className.indexOf(' ' + x + ' ') === -1); 264 | 265 | if (shouldRender) { 266 | renderElem(childNode, optionsCopy); 267 | } 268 | } // Otherwise, it's something else, and ignore it. 269 | 270 | } 271 | }; 272 | 273 | const renderMathInElement = function (elem, options) { 274 | if (!elem) { 275 | throw new Error("No element provided to render"); 276 | } 277 | 278 | const optionsCopy = {}; // Object.assign(optionsCopy, option) 279 | 280 | for (const option in options) { 281 | if (options.hasOwnProperty(option)) { 282 | optionsCopy[option] = options[option]; 283 | } 284 | } // default options 285 | 286 | 287 | optionsCopy.delimiters = optionsCopy.delimiters || [{ 288 | left: "$$", 289 | right: "$$", 290 | display: true 291 | }, { 292 | left: "\\(", 293 | right: "\\)", 294 | display: false 295 | }, // LaTeX uses $…$, but it ruins the display of normal `$` in text: 296 | // {left: "$", right: "$", display: false}, 297 | // $ must come after $$ 298 | // Render AMS environments even if outside $$…$$ delimiters. 299 | { 300 | left: "\\begin{equation}", 301 | right: "\\end{equation}", 302 | display: true 303 | }, { 304 | left: "\\begin{align}", 305 | right: "\\end{align}", 306 | display: true 307 | }, { 308 | left: "\\begin{alignat}", 309 | right: "\\end{alignat}", 310 | display: true 311 | }, { 312 | left: "\\begin{gather}", 313 | right: "\\end{gather}", 314 | display: true 315 | }, { 316 | left: "\\begin{CD}", 317 | right: "\\end{CD}", 318 | display: true 319 | }, { 320 | left: "\\[", 321 | right: "\\]", 322 | display: true 323 | }]; 324 | optionsCopy.ignoredTags = optionsCopy.ignoredTags || ["script", "noscript", "style", "textarea", "pre", "code", "option"]; 325 | optionsCopy.ignoredClasses = optionsCopy.ignoredClasses || []; 326 | optionsCopy.errorCallback = optionsCopy.errorCallback || console.error; // Enable sharing of global macros defined via `\gdef` between different 327 | // math elements within a single call to `renderMathInElement`. 328 | 329 | optionsCopy.macros = optionsCopy.macros || {}; 330 | renderElem(elem, optionsCopy); 331 | }; 332 | 333 | /* harmony default export */ var auto_render = (renderMathInElement); 334 | __webpack_exports__ = __webpack_exports__["default"]; 335 | /******/ return __webpack_exports__; 336 | /******/ })() 337 | ; 338 | }); -------------------------------------------------------------------------------- /assets/katex/katex.min.css: -------------------------------------------------------------------------------- 1 | @font-face{font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(fonts/KaTeX_AMS-Regular.woff2) format("woff2"),url(fonts/KaTeX_AMS-Regular.woff) format("woff"),url(fonts/KaTeX_AMS-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Caligraphic-Bold.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Bold.woff) format("woff"),url(fonts/KaTeX_Caligraphic-Bold.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Caligraphic-Regular.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Regular.woff) format("woff"),url(fonts/KaTeX_Caligraphic-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Fraktur-Bold.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Bold.woff) format("woff"),url(fonts/KaTeX_Fraktur-Bold.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Fraktur-Regular.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Regular.woff) format("woff"),url(fonts/KaTeX_Fraktur-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Main-Bold.woff2) format("woff2"),url(fonts/KaTeX_Main-Bold.woff) format("woff"),url(fonts/KaTeX_Main-Bold.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(fonts/KaTeX_Main-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Main-BoldItalic.woff) format("woff"),url(fonts/KaTeX_Main-BoldItalic.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(fonts/KaTeX_Main-Italic.woff2) format("woff2"),url(fonts/KaTeX_Main-Italic.woff) format("woff"),url(fonts/KaTeX_Main-Italic.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Main-Regular.woff2) format("woff2"),url(fonts/KaTeX_Main-Regular.woff) format("woff"),url(fonts/KaTeX_Main-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(fonts/KaTeX_Math-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Math-BoldItalic.woff) format("woff"),url(fonts/KaTeX_Math-BoldItalic.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(fonts/KaTeX_Math-Italic.woff2) format("woff2"),url(fonts/KaTeX_Math-Italic.woff) format("woff"),url(fonts/KaTeX_Math-Italic.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:normal;font-weight:700;src:url(fonts/KaTeX_SansSerif-Bold.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Bold.woff) format("woff"),url(fonts/KaTeX_SansSerif-Bold.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:italic;font-weight:400;src:url(fonts/KaTeX_SansSerif-Italic.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Italic.woff) format("woff"),url(fonts/KaTeX_SansSerif-Italic.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:normal;font-weight:400;src:url(fonts/KaTeX_SansSerif-Regular.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Regular.woff) format("woff"),url(fonts/KaTeX_SansSerif-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Script-Regular.woff2) format("woff2"),url(fonts/KaTeX_Script-Regular.woff) format("woff"),url(fonts/KaTeX_Script-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size1-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size1-Regular.woff) format("woff"),url(fonts/KaTeX_Size1-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size2-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size2-Regular.woff) format("woff"),url(fonts/KaTeX_Size2-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size3-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size3-Regular.woff) format("woff"),url(fonts/KaTeX_Size3-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size4-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size4-Regular.woff) format("woff"),url(fonts/KaTeX_Size4-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Typewriter-Regular.woff2) format("woff2"),url(fonts/KaTeX_Typewriter-Regular.woff) format("woff"),url(fonts/KaTeX_Typewriter-Regular.ttf) format("truetype")}.katex{font:normal 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;text-indent:0;text-rendering:auto}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.16.21"}.katex .katex-mathml{clip:rect(1px,1px,1px,1px);border:0;height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:-webkit-min-content;width:-moz-min-content;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .mathsfit,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{display:inline-flex;flex-direction:row}.katex .thinbox{max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.2777777778em;margin-right:-.5555555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.1666666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.6666666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.4566666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.1466666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.7142857143em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.8571428571em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.1428571429em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.2857142857em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.4285714286em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.7142857143em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.0571428571em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.4685714286em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.9628571429em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.5542857143em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.7777777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.8888888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.1111111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.3044444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.7644444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.5833333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.7283333333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.0733333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.4861111111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.4402777778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.7277777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.2893518519em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.4050925926em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.462962963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.5208333333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.2002314815em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.4398148148em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.2410800386em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.2892960463em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.337512054em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.3857280617em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.4339440694em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.4821600771em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.5785920926em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.6943105111em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.8331726133em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.1996142719em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.2009646302em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.2411575563em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.2813504823em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.3215434084em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.3617363344em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.4019292605em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.4823151125em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.578778135em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.6945337621em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.8336012862em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo} 2 | -------------------------------------------------------------------------------- /assets/katex/contrib/render-a11y-string.mjs: -------------------------------------------------------------------------------- 1 | import katex from '../katex.mjs'; 2 | 3 | /** 4 | * renderA11yString returns a readable string. 5 | * 6 | * In some cases the string will have the proper semantic math 7 | * meaning,: 8 | * renderA11yString("\\frac{1}{2}"") 9 | * -> "start fraction, 1, divided by, 2, end fraction" 10 | * 11 | * However, other cases do not: 12 | * renderA11yString("f(x) = x^2") 13 | * -> "f, left parenthesis, x, right parenthesis, equals, x, squared" 14 | * 15 | * The commas in the string aim to increase ease of understanding 16 | * when read by a screenreader. 17 | */ 18 | var stringMap = { 19 | "(": "left parenthesis", 20 | ")": "right parenthesis", 21 | "[": "open bracket", 22 | "]": "close bracket", 23 | "\\{": "left brace", 24 | "\\}": "right brace", 25 | "\\lvert": "open vertical bar", 26 | "\\rvert": "close vertical bar", 27 | "|": "vertical bar", 28 | "\\uparrow": "up arrow", 29 | "\\Uparrow": "up arrow", 30 | "\\downarrow": "down arrow", 31 | "\\Downarrow": "down arrow", 32 | "\\updownarrow": "up down arrow", 33 | "\\leftarrow": "left arrow", 34 | "\\Leftarrow": "left arrow", 35 | "\\rightarrow": "right arrow", 36 | "\\Rightarrow": "right arrow", 37 | "\\langle": "open angle", 38 | "\\rangle": "close angle", 39 | "\\lfloor": "open floor", 40 | "\\rfloor": "close floor", 41 | "\\int": "integral", 42 | "\\intop": "integral", 43 | "\\lim": "limit", 44 | "\\ln": "natural log", 45 | "\\log": "log", 46 | "\\sin": "sine", 47 | "\\cos": "cosine", 48 | "\\tan": "tangent", 49 | "\\cot": "cotangent", 50 | "\\sum": "sum", 51 | "/": "slash", 52 | ",": "comma", 53 | ".": "point", 54 | "-": "negative", 55 | "+": "plus", 56 | "~": "tilde", 57 | ":": "colon", 58 | "?": "question mark", 59 | "'": "apostrophe", 60 | "\\%": "percent", 61 | " ": "space", 62 | "\\ ": "space", 63 | "\\$": "dollar sign", 64 | "\\angle": "angle", 65 | "\\degree": "degree", 66 | "\\circ": "circle", 67 | "\\vec": "vector", 68 | "\\triangle": "triangle", 69 | "\\pi": "pi", 70 | "\\prime": "prime", 71 | "\\infty": "infinity", 72 | "\\alpha": "alpha", 73 | "\\beta": "beta", 74 | "\\gamma": "gamma", 75 | "\\omega": "omega", 76 | "\\theta": "theta", 77 | "\\sigma": "sigma", 78 | "\\lambda": "lambda", 79 | "\\tau": "tau", 80 | "\\Delta": "delta", 81 | "\\delta": "delta", 82 | "\\mu": "mu", 83 | "\\rho": "rho", 84 | "\\nabla": "del", 85 | "\\ell": "ell", 86 | "\\ldots": "dots", 87 | // TODO: add entries for all accents 88 | "\\hat": "hat", 89 | "\\acute": "acute" 90 | }; 91 | var powerMap = { 92 | "prime": "prime", 93 | "degree": "degrees", 94 | "circle": "degrees", 95 | "2": "squared", 96 | "3": "cubed" 97 | }; 98 | var openMap = { 99 | "|": "open vertical bar", 100 | ".": "" 101 | }; 102 | var closeMap = { 103 | "|": "close vertical bar", 104 | ".": "" 105 | }; 106 | var binMap = { 107 | "+": "plus", 108 | "-": "minus", 109 | "\\pm": "plus minus", 110 | "\\cdot": "dot", 111 | "*": "times", 112 | "/": "divided by", 113 | "\\times": "times", 114 | "\\div": "divided by", 115 | "\\circ": "circle", 116 | "\\bullet": "bullet" 117 | }; 118 | var relMap = { 119 | "=": "equals", 120 | "\\approx": "approximately equals", 121 | "≠": "does not equal", 122 | "\\geq": "is greater than or equal to", 123 | "\\ge": "is greater than or equal to", 124 | "\\leq": "is less than or equal to", 125 | "\\le": "is less than or equal to", 126 | ">": "is greater than", 127 | "<": "is less than", 128 | "\\leftarrow": "left arrow", 129 | "\\Leftarrow": "left arrow", 130 | "\\rightarrow": "right arrow", 131 | "\\Rightarrow": "right arrow", 132 | ":": "colon" 133 | }; 134 | var accentUnderMap = { 135 | "\\underleftarrow": "left arrow", 136 | "\\underrightarrow": "right arrow", 137 | "\\underleftrightarrow": "left-right arrow", 138 | "\\undergroup": "group", 139 | "\\underlinesegment": "line segment", 140 | "\\utilde": "tilde" 141 | }; 142 | 143 | var buildString = (str, type, a11yStrings) => { 144 | if (!str) { 145 | return; 146 | } 147 | 148 | var ret; 149 | 150 | if (type === "open") { 151 | ret = str in openMap ? openMap[str] : stringMap[str] || str; 152 | } else if (type === "close") { 153 | ret = str in closeMap ? closeMap[str] : stringMap[str] || str; 154 | } else if (type === "bin") { 155 | ret = binMap[str] || str; 156 | } else if (type === "rel") { 157 | ret = relMap[str] || str; 158 | } else { 159 | ret = stringMap[str] || str; 160 | } // If the text to add is a number and there is already a string 161 | // in the list and the last string is a number then we should 162 | // combine them into a single number 163 | 164 | 165 | if (/^\d+$/.test(ret) && a11yStrings.length > 0 && // TODO(kevinb): check that the last item in a11yStrings is a string 166 | // I think we might be able to drop the nested arrays, which would make 167 | // this easier to type 168 | // $FlowFixMe 169 | /^\d+$/.test(a11yStrings[a11yStrings.length - 1])) { 170 | a11yStrings[a11yStrings.length - 1] += ret; 171 | } else if (ret) { 172 | a11yStrings.push(ret); 173 | } 174 | }; 175 | 176 | var buildRegion = (a11yStrings, callback) => { 177 | var regionStrings = []; 178 | a11yStrings.push(regionStrings); 179 | callback(regionStrings); 180 | }; 181 | 182 | var handleObject = (tree, a11yStrings, atomType) => { 183 | // Everything else is assumed to be an object... 184 | switch (tree.type) { 185 | case "accent": 186 | { 187 | buildRegion(a11yStrings, a11yStrings => { 188 | buildA11yStrings(tree.base, a11yStrings, atomType); 189 | a11yStrings.push("with"); 190 | buildString(tree.label, "normal", a11yStrings); 191 | a11yStrings.push("on top"); 192 | }); 193 | break; 194 | } 195 | 196 | case "accentUnder": 197 | { 198 | buildRegion(a11yStrings, a11yStrings => { 199 | buildA11yStrings(tree.base, a11yStrings, atomType); 200 | a11yStrings.push("with"); 201 | buildString(accentUnderMap[tree.label], "normal", a11yStrings); 202 | a11yStrings.push("underneath"); 203 | }); 204 | break; 205 | } 206 | 207 | case "accent-token": 208 | { 209 | // Used internally by accent symbols. 210 | break; 211 | } 212 | 213 | case "atom": 214 | { 215 | var { 216 | text 217 | } = tree; 218 | 219 | switch (tree.family) { 220 | case "bin": 221 | { 222 | buildString(text, "bin", a11yStrings); 223 | break; 224 | } 225 | 226 | case "close": 227 | { 228 | buildString(text, "close", a11yStrings); 229 | break; 230 | } 231 | // TODO(kevinb): figure out what should be done for inner 232 | 233 | case "inner": 234 | { 235 | buildString(tree.text, "inner", a11yStrings); 236 | break; 237 | } 238 | 239 | case "open": 240 | { 241 | buildString(text, "open", a11yStrings); 242 | break; 243 | } 244 | 245 | case "punct": 246 | { 247 | buildString(text, "punct", a11yStrings); 248 | break; 249 | } 250 | 251 | case "rel": 252 | { 253 | buildString(text, "rel", a11yStrings); 254 | break; 255 | } 256 | 257 | default: 258 | { 259 | tree.family; 260 | throw new Error("\"" + tree.family + "\" is not a valid atom type"); 261 | } 262 | } 263 | 264 | break; 265 | } 266 | 267 | case "color": 268 | { 269 | var color = tree.color.replace(/katex-/, ""); 270 | buildRegion(a11yStrings, regionStrings => { 271 | regionStrings.push("start color " + color); 272 | buildA11yStrings(tree.body, regionStrings, atomType); 273 | regionStrings.push("end color " + color); 274 | }); 275 | break; 276 | } 277 | 278 | case "color-token": 279 | { 280 | // Used by \color, \colorbox, and \fcolorbox but not directly rendered. 281 | // It's a leaf node and has no children so just break. 282 | break; 283 | } 284 | 285 | case "delimsizing": 286 | { 287 | if (tree.delim && tree.delim !== ".") { 288 | buildString(tree.delim, "normal", a11yStrings); 289 | } 290 | 291 | break; 292 | } 293 | 294 | case "genfrac": 295 | { 296 | buildRegion(a11yStrings, regionStrings => { 297 | // genfrac can have unbalanced delimiters 298 | var { 299 | leftDelim, 300 | rightDelim 301 | } = tree; // NOTE: Not sure if this is a safe assumption 302 | // hasBarLine true -> fraction, false -> binomial 303 | 304 | if (tree.hasBarLine) { 305 | regionStrings.push("start fraction"); 306 | leftDelim && buildString(leftDelim, "open", regionStrings); 307 | buildA11yStrings(tree.numer, regionStrings, atomType); 308 | regionStrings.push("divided by"); 309 | buildA11yStrings(tree.denom, regionStrings, atomType); 310 | rightDelim && buildString(rightDelim, "close", regionStrings); 311 | regionStrings.push("end fraction"); 312 | } else { 313 | regionStrings.push("start binomial"); 314 | leftDelim && buildString(leftDelim, "open", regionStrings); 315 | buildA11yStrings(tree.numer, regionStrings, atomType); 316 | regionStrings.push("over"); 317 | buildA11yStrings(tree.denom, regionStrings, atomType); 318 | rightDelim && buildString(rightDelim, "close", regionStrings); 319 | regionStrings.push("end binomial"); 320 | } 321 | }); 322 | break; 323 | } 324 | 325 | case "hbox": 326 | { 327 | buildA11yStrings(tree.body, a11yStrings, atomType); 328 | break; 329 | } 330 | 331 | case "kern": 332 | { 333 | // No op: we don't attempt to present kerning information 334 | // to the screen reader. 335 | break; 336 | } 337 | 338 | case "leftright": 339 | { 340 | buildRegion(a11yStrings, regionStrings => { 341 | buildString(tree.left, "open", regionStrings); 342 | buildA11yStrings(tree.body, regionStrings, atomType); 343 | buildString(tree.right, "close", regionStrings); 344 | }); 345 | break; 346 | } 347 | 348 | case "leftright-right": 349 | { 350 | // TODO: double check that this is a no-op 351 | break; 352 | } 353 | 354 | case "lap": 355 | { 356 | buildA11yStrings(tree.body, a11yStrings, atomType); 357 | break; 358 | } 359 | 360 | case "mathord": 361 | { 362 | buildString(tree.text, "normal", a11yStrings); 363 | break; 364 | } 365 | 366 | case "op": 367 | { 368 | var { 369 | body, 370 | name 371 | } = tree; 372 | 373 | if (body) { 374 | buildA11yStrings(body, a11yStrings, atomType); 375 | } else if (name) { 376 | buildString(name, "normal", a11yStrings); 377 | } 378 | 379 | break; 380 | } 381 | 382 | case "op-token": 383 | { 384 | // Used internally by operator symbols. 385 | buildString(tree.text, atomType, a11yStrings); 386 | break; 387 | } 388 | 389 | case "ordgroup": 390 | { 391 | buildA11yStrings(tree.body, a11yStrings, atomType); 392 | break; 393 | } 394 | 395 | case "overline": 396 | { 397 | buildRegion(a11yStrings, function (a11yStrings) { 398 | a11yStrings.push("start overline"); 399 | buildA11yStrings(tree.body, a11yStrings, atomType); 400 | a11yStrings.push("end overline"); 401 | }); 402 | break; 403 | } 404 | 405 | case "pmb": 406 | { 407 | a11yStrings.push("bold"); 408 | break; 409 | } 410 | 411 | case "phantom": 412 | { 413 | a11yStrings.push("empty space"); 414 | break; 415 | } 416 | 417 | case "raisebox": 418 | { 419 | buildA11yStrings(tree.body, a11yStrings, atomType); 420 | break; 421 | } 422 | 423 | case "rule": 424 | { 425 | a11yStrings.push("rectangle"); 426 | break; 427 | } 428 | 429 | case "sizing": 430 | { 431 | buildA11yStrings(tree.body, a11yStrings, atomType); 432 | break; 433 | } 434 | 435 | case "spacing": 436 | { 437 | a11yStrings.push("space"); 438 | break; 439 | } 440 | 441 | case "styling": 442 | { 443 | // We ignore the styling and just pass through the contents 444 | buildA11yStrings(tree.body, a11yStrings, atomType); 445 | break; 446 | } 447 | 448 | case "sqrt": 449 | { 450 | buildRegion(a11yStrings, regionStrings => { 451 | var { 452 | body, 453 | index 454 | } = tree; 455 | 456 | if (index) { 457 | var indexString = flatten(buildA11yStrings(index, [], atomType)).join(","); 458 | 459 | if (indexString === "3") { 460 | regionStrings.push("cube root of"); 461 | buildA11yStrings(body, regionStrings, atomType); 462 | regionStrings.push("end cube root"); 463 | return; 464 | } 465 | 466 | regionStrings.push("root"); 467 | regionStrings.push("start index"); 468 | buildA11yStrings(index, regionStrings, atomType); 469 | regionStrings.push("end index"); 470 | return; 471 | } 472 | 473 | regionStrings.push("square root of"); 474 | buildA11yStrings(body, regionStrings, atomType); 475 | regionStrings.push("end square root"); 476 | }); 477 | break; 478 | } 479 | 480 | case "supsub": 481 | { 482 | var { 483 | base, 484 | sub, 485 | sup 486 | } = tree; 487 | var isLog = false; 488 | 489 | if (base) { 490 | buildA11yStrings(base, a11yStrings, atomType); 491 | isLog = base.type === "op" && base.name === "\\log"; 492 | } 493 | 494 | if (sub) { 495 | var regionName = isLog ? "base" : "subscript"; 496 | buildRegion(a11yStrings, function (regionStrings) { 497 | regionStrings.push("start " + regionName); 498 | buildA11yStrings(sub, regionStrings, atomType); 499 | regionStrings.push("end " + regionName); 500 | }); 501 | } 502 | 503 | if (sup) { 504 | buildRegion(a11yStrings, function (regionStrings) { 505 | var supString = flatten(buildA11yStrings(sup, [], atomType)).join(","); 506 | 507 | if (supString in powerMap) { 508 | regionStrings.push(powerMap[supString]); 509 | return; 510 | } 511 | 512 | regionStrings.push("start superscript"); 513 | buildA11yStrings(sup, regionStrings, atomType); 514 | regionStrings.push("end superscript"); 515 | }); 516 | } 517 | 518 | break; 519 | } 520 | 521 | case "text": 522 | { 523 | // TODO: handle other fonts 524 | if (tree.font === "\\textbf") { 525 | buildRegion(a11yStrings, function (regionStrings) { 526 | regionStrings.push("start bold text"); 527 | buildA11yStrings(tree.body, regionStrings, atomType); 528 | regionStrings.push("end bold text"); 529 | }); 530 | break; 531 | } 532 | 533 | buildRegion(a11yStrings, function (regionStrings) { 534 | regionStrings.push("start text"); 535 | buildA11yStrings(tree.body, regionStrings, atomType); 536 | regionStrings.push("end text"); 537 | }); 538 | break; 539 | } 540 | 541 | case "textord": 542 | { 543 | buildString(tree.text, atomType, a11yStrings); 544 | break; 545 | } 546 | 547 | case "smash": 548 | { 549 | buildA11yStrings(tree.body, a11yStrings, atomType); 550 | break; 551 | } 552 | 553 | case "enclose": 554 | { 555 | // TODO: create a map for these. 556 | // TODO: differentiate between a body with a single atom, e.g. 557 | // "cancel a" instead of "start cancel, a, end cancel" 558 | if (/cancel/.test(tree.label)) { 559 | buildRegion(a11yStrings, function (regionStrings) { 560 | regionStrings.push("start cancel"); 561 | buildA11yStrings(tree.body, regionStrings, atomType); 562 | regionStrings.push("end cancel"); 563 | }); 564 | break; 565 | } else if (/box/.test(tree.label)) { 566 | buildRegion(a11yStrings, function (regionStrings) { 567 | regionStrings.push("start box"); 568 | buildA11yStrings(tree.body, regionStrings, atomType); 569 | regionStrings.push("end box"); 570 | }); 571 | break; 572 | } else if (/sout/.test(tree.label)) { 573 | buildRegion(a11yStrings, function (regionStrings) { 574 | regionStrings.push("start strikeout"); 575 | buildA11yStrings(tree.body, regionStrings, atomType); 576 | regionStrings.push("end strikeout"); 577 | }); 578 | break; 579 | } else if (/phase/.test(tree.label)) { 580 | buildRegion(a11yStrings, function (regionStrings) { 581 | regionStrings.push("start phase angle"); 582 | buildA11yStrings(tree.body, regionStrings, atomType); 583 | regionStrings.push("end phase angle"); 584 | }); 585 | break; 586 | } 587 | 588 | throw new Error("KaTeX-a11y: enclose node with " + tree.label + " not supported yet"); 589 | } 590 | 591 | case "vcenter": 592 | { 593 | buildA11yStrings(tree.body, a11yStrings, atomType); 594 | break; 595 | } 596 | 597 | case "vphantom": 598 | { 599 | throw new Error("KaTeX-a11y: vphantom not implemented yet"); 600 | } 601 | 602 | case "hphantom": 603 | { 604 | throw new Error("KaTeX-a11y: hphantom not implemented yet"); 605 | } 606 | 607 | case "operatorname": 608 | { 609 | buildA11yStrings(tree.body, a11yStrings, atomType); 610 | break; 611 | } 612 | 613 | case "array": 614 | { 615 | throw new Error("KaTeX-a11y: array not implemented yet"); 616 | } 617 | 618 | case "raw": 619 | { 620 | throw new Error("KaTeX-a11y: raw not implemented yet"); 621 | } 622 | 623 | case "size": 624 | { 625 | // Although there are nodes of type "size" in the parse tree, they have 626 | // no semantic meaning and should be ignored. 627 | break; 628 | } 629 | 630 | case "url": 631 | { 632 | throw new Error("KaTeX-a11y: url not implemented yet"); 633 | } 634 | 635 | case "tag": 636 | { 637 | throw new Error("KaTeX-a11y: tag not implemented yet"); 638 | } 639 | 640 | case "verb": 641 | { 642 | buildString("start verbatim", "normal", a11yStrings); 643 | buildString(tree.body, "normal", a11yStrings); 644 | buildString("end verbatim", "normal", a11yStrings); 645 | break; 646 | } 647 | 648 | case "environment": 649 | { 650 | throw new Error("KaTeX-a11y: environment not implemented yet"); 651 | } 652 | 653 | case "horizBrace": 654 | { 655 | buildString("start " + tree.label.slice(1), "normal", a11yStrings); 656 | buildA11yStrings(tree.base, a11yStrings, atomType); 657 | buildString("end " + tree.label.slice(1), "normal", a11yStrings); 658 | break; 659 | } 660 | 661 | case "infix": 662 | { 663 | // All infix nodes are replace with other nodes. 664 | break; 665 | } 666 | 667 | case "includegraphics": 668 | { 669 | throw new Error("KaTeX-a11y: includegraphics not implemented yet"); 670 | } 671 | 672 | case "font": 673 | { 674 | // TODO: callout the start/end of specific fonts 675 | // TODO: map \BBb{N} to "the naturals" or something like that 676 | buildA11yStrings(tree.body, a11yStrings, atomType); 677 | break; 678 | } 679 | 680 | case "href": 681 | { 682 | throw new Error("KaTeX-a11y: href not implemented yet"); 683 | } 684 | 685 | case "cr": 686 | { 687 | // This is used by environments. 688 | throw new Error("KaTeX-a11y: cr not implemented yet"); 689 | } 690 | 691 | case "underline": 692 | { 693 | buildRegion(a11yStrings, function (a11yStrings) { 694 | a11yStrings.push("start underline"); 695 | buildA11yStrings(tree.body, a11yStrings, atomType); 696 | a11yStrings.push("end underline"); 697 | }); 698 | break; 699 | } 700 | 701 | case "xArrow": 702 | { 703 | throw new Error("KaTeX-a11y: xArrow not implemented yet"); 704 | } 705 | 706 | case "cdlabel": 707 | { 708 | throw new Error("KaTeX-a11y: cdlabel not implemented yet"); 709 | } 710 | 711 | case "cdlabelparent": 712 | { 713 | throw new Error("KaTeX-a11y: cdlabelparent not implemented yet"); 714 | } 715 | 716 | case "mclass": 717 | { 718 | // \neq and \ne are macros so we let "htmlmathml" render the mathmal 719 | // side of things and extract the text from that. 720 | var _atomType = tree.mclass.slice(1); // $FlowFixMe: drop the leading "m" from the values in mclass 721 | 722 | 723 | buildA11yStrings(tree.body, a11yStrings, _atomType); 724 | break; 725 | } 726 | 727 | case "mathchoice": 728 | { 729 | // TODO: track which style we're using, e.g. display, text, etc. 730 | // default to text style if even that may not be the correct style 731 | buildA11yStrings(tree.text, a11yStrings, atomType); 732 | break; 733 | } 734 | 735 | case "htmlmathml": 736 | { 737 | buildA11yStrings(tree.mathml, a11yStrings, atomType); 738 | break; 739 | } 740 | 741 | case "middle": 742 | { 743 | buildString(tree.delim, atomType, a11yStrings); 744 | break; 745 | } 746 | 747 | case "internal": 748 | { 749 | // internal nodes are never included in the parse tree 750 | break; 751 | } 752 | 753 | case "html": 754 | { 755 | buildA11yStrings(tree.body, a11yStrings, atomType); 756 | break; 757 | } 758 | 759 | default: 760 | tree.type; 761 | throw new Error("KaTeX a11y un-recognized type: " + tree.type); 762 | } 763 | }; 764 | 765 | var buildA11yStrings = function buildA11yStrings(tree, a11yStrings, atomType) { 766 | if (a11yStrings === void 0) { 767 | a11yStrings = []; 768 | } 769 | 770 | if (tree instanceof Array) { 771 | for (var i = 0; i < tree.length; i++) { 772 | buildA11yStrings(tree[i], a11yStrings, atomType); 773 | } 774 | } else { 775 | handleObject(tree, a11yStrings, atomType); 776 | } 777 | 778 | return a11yStrings; 779 | }; 780 | 781 | var flatten = function flatten(array) { 782 | var result = []; 783 | array.forEach(function (item) { 784 | if (item instanceof Array) { 785 | result = result.concat(flatten(item)); 786 | } else { 787 | result.push(item); 788 | } 789 | }); 790 | return result; 791 | }; 792 | 793 | var renderA11yString = function renderA11yString(text, settings) { 794 | var tree = katex.__parse(text, settings); 795 | 796 | var a11yStrings = buildA11yStrings(tree, [], "normal"); 797 | return flatten(a11yStrings).join(", "); 798 | }; 799 | 800 | export { renderA11yString as default }; 801 | -------------------------------------------------------------------------------- /assets/katex/contrib/render-a11y-string.js: -------------------------------------------------------------------------------- 1 | (function webpackUniversalModuleDefinition(root, factory) { 2 | if(typeof exports === 'object' && typeof module === 'object') 3 | module.exports = factory(require("katex")); 4 | else if(typeof define === 'function' && define.amd) 5 | define(["katex"], factory); 6 | else { 7 | var a = typeof exports === 'object' ? factory(require("katex")) : factory(root["katex"]); 8 | for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; 9 | } 10 | })((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__757__) { 11 | return /******/ (function() { // webpackBootstrap 12 | /******/ "use strict"; 13 | /******/ var __webpack_modules__ = ({ 14 | 15 | /***/ 757: 16 | /***/ (function(module) { 17 | 18 | module.exports = __WEBPACK_EXTERNAL_MODULE__757__; 19 | 20 | /***/ }) 21 | 22 | /******/ }); 23 | /************************************************************************/ 24 | /******/ // The module cache 25 | /******/ var __webpack_module_cache__ = {}; 26 | /******/ 27 | /******/ // The require function 28 | /******/ function __webpack_require__(moduleId) { 29 | /******/ // Check if module is in cache 30 | /******/ var cachedModule = __webpack_module_cache__[moduleId]; 31 | /******/ if (cachedModule !== undefined) { 32 | /******/ return cachedModule.exports; 33 | /******/ } 34 | /******/ // Create a new module (and put it into the cache) 35 | /******/ var module = __webpack_module_cache__[moduleId] = { 36 | /******/ // no module.id needed 37 | /******/ // no module.loaded needed 38 | /******/ exports: {} 39 | /******/ }; 40 | /******/ 41 | /******/ // Execute the module function 42 | /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 43 | /******/ 44 | /******/ // Return the exports of the module 45 | /******/ return module.exports; 46 | /******/ } 47 | /******/ 48 | /************************************************************************/ 49 | /******/ /* webpack/runtime/compat get default export */ 50 | /******/ !function() { 51 | /******/ // getDefaultExport function for compatibility with non-harmony modules 52 | /******/ __webpack_require__.n = function(module) { 53 | /******/ var getter = module && module.__esModule ? 54 | /******/ function() { return module['default']; } : 55 | /******/ function() { return module; }; 56 | /******/ __webpack_require__.d(getter, { a: getter }); 57 | /******/ return getter; 58 | /******/ }; 59 | /******/ }(); 60 | /******/ 61 | /******/ /* webpack/runtime/define property getters */ 62 | /******/ !function() { 63 | /******/ // define getter functions for harmony exports 64 | /******/ __webpack_require__.d = function(exports, definition) { 65 | /******/ for(var key in definition) { 66 | /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 67 | /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 68 | /******/ } 69 | /******/ } 70 | /******/ }; 71 | /******/ }(); 72 | /******/ 73 | /******/ /* webpack/runtime/hasOwnProperty shorthand */ 74 | /******/ !function() { 75 | /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } 76 | /******/ }(); 77 | /******/ 78 | /************************************************************************/ 79 | var __webpack_exports__ = {}; 80 | /* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(757); 81 | /* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(katex__WEBPACK_IMPORTED_MODULE_0__); 82 | /** 83 | * renderA11yString returns a readable string. 84 | * 85 | * In some cases the string will have the proper semantic math 86 | * meaning,: 87 | * renderA11yString("\\frac{1}{2}"") 88 | * -> "start fraction, 1, divided by, 2, end fraction" 89 | * 90 | * However, other cases do not: 91 | * renderA11yString("f(x) = x^2") 92 | * -> "f, left parenthesis, x, right parenthesis, equals, x, squared" 93 | * 94 | * The commas in the string aim to increase ease of understanding 95 | * when read by a screenreader. 96 | */ 97 | // NOTE: since we're importing types here these files won't actually be 98 | // included in the build. 99 | // $FlowIgnore: we import the types directly anyways 100 | 101 | const stringMap = { 102 | "(": "left parenthesis", 103 | ")": "right parenthesis", 104 | "[": "open bracket", 105 | "]": "close bracket", 106 | "\\{": "left brace", 107 | "\\}": "right brace", 108 | "\\lvert": "open vertical bar", 109 | "\\rvert": "close vertical bar", 110 | "|": "vertical bar", 111 | "\\uparrow": "up arrow", 112 | "\\Uparrow": "up arrow", 113 | "\\downarrow": "down arrow", 114 | "\\Downarrow": "down arrow", 115 | "\\updownarrow": "up down arrow", 116 | "\\leftarrow": "left arrow", 117 | "\\Leftarrow": "left arrow", 118 | "\\rightarrow": "right arrow", 119 | "\\Rightarrow": "right arrow", 120 | "\\langle": "open angle", 121 | "\\rangle": "close angle", 122 | "\\lfloor": "open floor", 123 | "\\rfloor": "close floor", 124 | "\\int": "integral", 125 | "\\intop": "integral", 126 | "\\lim": "limit", 127 | "\\ln": "natural log", 128 | "\\log": "log", 129 | "\\sin": "sine", 130 | "\\cos": "cosine", 131 | "\\tan": "tangent", 132 | "\\cot": "cotangent", 133 | "\\sum": "sum", 134 | "/": "slash", 135 | ",": "comma", 136 | ".": "point", 137 | "-": "negative", 138 | "+": "plus", 139 | "~": "tilde", 140 | ":": "colon", 141 | "?": "question mark", 142 | "'": "apostrophe", 143 | "\\%": "percent", 144 | " ": "space", 145 | "\\ ": "space", 146 | "\\$": "dollar sign", 147 | "\\angle": "angle", 148 | "\\degree": "degree", 149 | "\\circ": "circle", 150 | "\\vec": "vector", 151 | "\\triangle": "triangle", 152 | "\\pi": "pi", 153 | "\\prime": "prime", 154 | "\\infty": "infinity", 155 | "\\alpha": "alpha", 156 | "\\beta": "beta", 157 | "\\gamma": "gamma", 158 | "\\omega": "omega", 159 | "\\theta": "theta", 160 | "\\sigma": "sigma", 161 | "\\lambda": "lambda", 162 | "\\tau": "tau", 163 | "\\Delta": "delta", 164 | "\\delta": "delta", 165 | "\\mu": "mu", 166 | "\\rho": "rho", 167 | "\\nabla": "del", 168 | "\\ell": "ell", 169 | "\\ldots": "dots", 170 | // TODO: add entries for all accents 171 | "\\hat": "hat", 172 | "\\acute": "acute" 173 | }; 174 | const powerMap = { 175 | "prime": "prime", 176 | "degree": "degrees", 177 | "circle": "degrees", 178 | "2": "squared", 179 | "3": "cubed" 180 | }; 181 | const openMap = { 182 | "|": "open vertical bar", 183 | ".": "" 184 | }; 185 | const closeMap = { 186 | "|": "close vertical bar", 187 | ".": "" 188 | }; 189 | const binMap = { 190 | "+": "plus", 191 | "-": "minus", 192 | "\\pm": "plus minus", 193 | "\\cdot": "dot", 194 | "*": "times", 195 | "/": "divided by", 196 | "\\times": "times", 197 | "\\div": "divided by", 198 | "\\circ": "circle", 199 | "\\bullet": "bullet" 200 | }; 201 | const relMap = { 202 | "=": "equals", 203 | "\\approx": "approximately equals", 204 | "≠": "does not equal", 205 | "\\geq": "is greater than or equal to", 206 | "\\ge": "is greater than or equal to", 207 | "\\leq": "is less than or equal to", 208 | "\\le": "is less than or equal to", 209 | ">": "is greater than", 210 | "<": "is less than", 211 | "\\leftarrow": "left arrow", 212 | "\\Leftarrow": "left arrow", 213 | "\\rightarrow": "right arrow", 214 | "\\Rightarrow": "right arrow", 215 | ":": "colon" 216 | }; 217 | const accentUnderMap = { 218 | "\\underleftarrow": "left arrow", 219 | "\\underrightarrow": "right arrow", 220 | "\\underleftrightarrow": "left-right arrow", 221 | "\\undergroup": "group", 222 | "\\underlinesegment": "line segment", 223 | "\\utilde": "tilde" 224 | }; 225 | 226 | const buildString = (str, type, a11yStrings) => { 227 | if (!str) { 228 | return; 229 | } 230 | 231 | let ret; 232 | 233 | if (type === "open") { 234 | ret = str in openMap ? openMap[str] : stringMap[str] || str; 235 | } else if (type === "close") { 236 | ret = str in closeMap ? closeMap[str] : stringMap[str] || str; 237 | } else if (type === "bin") { 238 | ret = binMap[str] || str; 239 | } else if (type === "rel") { 240 | ret = relMap[str] || str; 241 | } else { 242 | ret = stringMap[str] || str; 243 | } // If the text to add is a number and there is already a string 244 | // in the list and the last string is a number then we should 245 | // combine them into a single number 246 | 247 | 248 | if (/^\d+$/.test(ret) && a11yStrings.length > 0 && // TODO(kevinb): check that the last item in a11yStrings is a string 249 | // I think we might be able to drop the nested arrays, which would make 250 | // this easier to type 251 | // $FlowFixMe 252 | /^\d+$/.test(a11yStrings[a11yStrings.length - 1])) { 253 | a11yStrings[a11yStrings.length - 1] += ret; 254 | } else if (ret) { 255 | a11yStrings.push(ret); 256 | } 257 | }; 258 | 259 | const buildRegion = (a11yStrings, callback) => { 260 | const regionStrings = []; 261 | a11yStrings.push(regionStrings); 262 | callback(regionStrings); 263 | }; 264 | 265 | const handleObject = (tree, a11yStrings, atomType) => { 266 | // Everything else is assumed to be an object... 267 | switch (tree.type) { 268 | case "accent": 269 | { 270 | buildRegion(a11yStrings, a11yStrings => { 271 | buildA11yStrings(tree.base, a11yStrings, atomType); 272 | a11yStrings.push("with"); 273 | buildString(tree.label, "normal", a11yStrings); 274 | a11yStrings.push("on top"); 275 | }); 276 | break; 277 | } 278 | 279 | case "accentUnder": 280 | { 281 | buildRegion(a11yStrings, a11yStrings => { 282 | buildA11yStrings(tree.base, a11yStrings, atomType); 283 | a11yStrings.push("with"); 284 | buildString(accentUnderMap[tree.label], "normal", a11yStrings); 285 | a11yStrings.push("underneath"); 286 | }); 287 | break; 288 | } 289 | 290 | case "accent-token": 291 | { 292 | // Used internally by accent symbols. 293 | break; 294 | } 295 | 296 | case "atom": 297 | { 298 | const { 299 | text 300 | } = tree; 301 | 302 | switch (tree.family) { 303 | case "bin": 304 | { 305 | buildString(text, "bin", a11yStrings); 306 | break; 307 | } 308 | 309 | case "close": 310 | { 311 | buildString(text, "close", a11yStrings); 312 | break; 313 | } 314 | // TODO(kevinb): figure out what should be done for inner 315 | 316 | case "inner": 317 | { 318 | buildString(tree.text, "inner", a11yStrings); 319 | break; 320 | } 321 | 322 | case "open": 323 | { 324 | buildString(text, "open", a11yStrings); 325 | break; 326 | } 327 | 328 | case "punct": 329 | { 330 | buildString(text, "punct", a11yStrings); 331 | break; 332 | } 333 | 334 | case "rel": 335 | { 336 | buildString(text, "rel", a11yStrings); 337 | break; 338 | } 339 | 340 | default: 341 | { 342 | tree.family; 343 | throw new Error("\"" + tree.family + "\" is not a valid atom type"); 344 | } 345 | } 346 | 347 | break; 348 | } 349 | 350 | case "color": 351 | { 352 | const color = tree.color.replace(/katex-/, ""); 353 | buildRegion(a11yStrings, regionStrings => { 354 | regionStrings.push("start color " + color); 355 | buildA11yStrings(tree.body, regionStrings, atomType); 356 | regionStrings.push("end color " + color); 357 | }); 358 | break; 359 | } 360 | 361 | case "color-token": 362 | { 363 | // Used by \color, \colorbox, and \fcolorbox but not directly rendered. 364 | // It's a leaf node and has no children so just break. 365 | break; 366 | } 367 | 368 | case "delimsizing": 369 | { 370 | if (tree.delim && tree.delim !== ".") { 371 | buildString(tree.delim, "normal", a11yStrings); 372 | } 373 | 374 | break; 375 | } 376 | 377 | case "genfrac": 378 | { 379 | buildRegion(a11yStrings, regionStrings => { 380 | // genfrac can have unbalanced delimiters 381 | const { 382 | leftDelim, 383 | rightDelim 384 | } = tree; // NOTE: Not sure if this is a safe assumption 385 | // hasBarLine true -> fraction, false -> binomial 386 | 387 | if (tree.hasBarLine) { 388 | regionStrings.push("start fraction"); 389 | leftDelim && buildString(leftDelim, "open", regionStrings); 390 | buildA11yStrings(tree.numer, regionStrings, atomType); 391 | regionStrings.push("divided by"); 392 | buildA11yStrings(tree.denom, regionStrings, atomType); 393 | rightDelim && buildString(rightDelim, "close", regionStrings); 394 | regionStrings.push("end fraction"); 395 | } else { 396 | regionStrings.push("start binomial"); 397 | leftDelim && buildString(leftDelim, "open", regionStrings); 398 | buildA11yStrings(tree.numer, regionStrings, atomType); 399 | regionStrings.push("over"); 400 | buildA11yStrings(tree.denom, regionStrings, atomType); 401 | rightDelim && buildString(rightDelim, "close", regionStrings); 402 | regionStrings.push("end binomial"); 403 | } 404 | }); 405 | break; 406 | } 407 | 408 | case "hbox": 409 | { 410 | buildA11yStrings(tree.body, a11yStrings, atomType); 411 | break; 412 | } 413 | 414 | case "kern": 415 | { 416 | // No op: we don't attempt to present kerning information 417 | // to the screen reader. 418 | break; 419 | } 420 | 421 | case "leftright": 422 | { 423 | buildRegion(a11yStrings, regionStrings => { 424 | buildString(tree.left, "open", regionStrings); 425 | buildA11yStrings(tree.body, regionStrings, atomType); 426 | buildString(tree.right, "close", regionStrings); 427 | }); 428 | break; 429 | } 430 | 431 | case "leftright-right": 432 | { 433 | // TODO: double check that this is a no-op 434 | break; 435 | } 436 | 437 | case "lap": 438 | { 439 | buildA11yStrings(tree.body, a11yStrings, atomType); 440 | break; 441 | } 442 | 443 | case "mathord": 444 | { 445 | buildString(tree.text, "normal", a11yStrings); 446 | break; 447 | } 448 | 449 | case "op": 450 | { 451 | const { 452 | body, 453 | name 454 | } = tree; 455 | 456 | if (body) { 457 | buildA11yStrings(body, a11yStrings, atomType); 458 | } else if (name) { 459 | buildString(name, "normal", a11yStrings); 460 | } 461 | 462 | break; 463 | } 464 | 465 | case "op-token": 466 | { 467 | // Used internally by operator symbols. 468 | buildString(tree.text, atomType, a11yStrings); 469 | break; 470 | } 471 | 472 | case "ordgroup": 473 | { 474 | buildA11yStrings(tree.body, a11yStrings, atomType); 475 | break; 476 | } 477 | 478 | case "overline": 479 | { 480 | buildRegion(a11yStrings, function (a11yStrings) { 481 | a11yStrings.push("start overline"); 482 | buildA11yStrings(tree.body, a11yStrings, atomType); 483 | a11yStrings.push("end overline"); 484 | }); 485 | break; 486 | } 487 | 488 | case "pmb": 489 | { 490 | a11yStrings.push("bold"); 491 | break; 492 | } 493 | 494 | case "phantom": 495 | { 496 | a11yStrings.push("empty space"); 497 | break; 498 | } 499 | 500 | case "raisebox": 501 | { 502 | buildA11yStrings(tree.body, a11yStrings, atomType); 503 | break; 504 | } 505 | 506 | case "rule": 507 | { 508 | a11yStrings.push("rectangle"); 509 | break; 510 | } 511 | 512 | case "sizing": 513 | { 514 | buildA11yStrings(tree.body, a11yStrings, atomType); 515 | break; 516 | } 517 | 518 | case "spacing": 519 | { 520 | a11yStrings.push("space"); 521 | break; 522 | } 523 | 524 | case "styling": 525 | { 526 | // We ignore the styling and just pass through the contents 527 | buildA11yStrings(tree.body, a11yStrings, atomType); 528 | break; 529 | } 530 | 531 | case "sqrt": 532 | { 533 | buildRegion(a11yStrings, regionStrings => { 534 | const { 535 | body, 536 | index 537 | } = tree; 538 | 539 | if (index) { 540 | const indexString = flatten(buildA11yStrings(index, [], atomType)).join(","); 541 | 542 | if (indexString === "3") { 543 | regionStrings.push("cube root of"); 544 | buildA11yStrings(body, regionStrings, atomType); 545 | regionStrings.push("end cube root"); 546 | return; 547 | } 548 | 549 | regionStrings.push("root"); 550 | regionStrings.push("start index"); 551 | buildA11yStrings(index, regionStrings, atomType); 552 | regionStrings.push("end index"); 553 | return; 554 | } 555 | 556 | regionStrings.push("square root of"); 557 | buildA11yStrings(body, regionStrings, atomType); 558 | regionStrings.push("end square root"); 559 | }); 560 | break; 561 | } 562 | 563 | case "supsub": 564 | { 565 | const { 566 | base, 567 | sub, 568 | sup 569 | } = tree; 570 | let isLog = false; 571 | 572 | if (base) { 573 | buildA11yStrings(base, a11yStrings, atomType); 574 | isLog = base.type === "op" && base.name === "\\log"; 575 | } 576 | 577 | if (sub) { 578 | const regionName = isLog ? "base" : "subscript"; 579 | buildRegion(a11yStrings, function (regionStrings) { 580 | regionStrings.push("start " + regionName); 581 | buildA11yStrings(sub, regionStrings, atomType); 582 | regionStrings.push("end " + regionName); 583 | }); 584 | } 585 | 586 | if (sup) { 587 | buildRegion(a11yStrings, function (regionStrings) { 588 | const supString = flatten(buildA11yStrings(sup, [], atomType)).join(","); 589 | 590 | if (supString in powerMap) { 591 | regionStrings.push(powerMap[supString]); 592 | return; 593 | } 594 | 595 | regionStrings.push("start superscript"); 596 | buildA11yStrings(sup, regionStrings, atomType); 597 | regionStrings.push("end superscript"); 598 | }); 599 | } 600 | 601 | break; 602 | } 603 | 604 | case "text": 605 | { 606 | // TODO: handle other fonts 607 | if (tree.font === "\\textbf") { 608 | buildRegion(a11yStrings, function (regionStrings) { 609 | regionStrings.push("start bold text"); 610 | buildA11yStrings(tree.body, regionStrings, atomType); 611 | regionStrings.push("end bold text"); 612 | }); 613 | break; 614 | } 615 | 616 | buildRegion(a11yStrings, function (regionStrings) { 617 | regionStrings.push("start text"); 618 | buildA11yStrings(tree.body, regionStrings, atomType); 619 | regionStrings.push("end text"); 620 | }); 621 | break; 622 | } 623 | 624 | case "textord": 625 | { 626 | buildString(tree.text, atomType, a11yStrings); 627 | break; 628 | } 629 | 630 | case "smash": 631 | { 632 | buildA11yStrings(tree.body, a11yStrings, atomType); 633 | break; 634 | } 635 | 636 | case "enclose": 637 | { 638 | // TODO: create a map for these. 639 | // TODO: differentiate between a body with a single atom, e.g. 640 | // "cancel a" instead of "start cancel, a, end cancel" 641 | if (/cancel/.test(tree.label)) { 642 | buildRegion(a11yStrings, function (regionStrings) { 643 | regionStrings.push("start cancel"); 644 | buildA11yStrings(tree.body, regionStrings, atomType); 645 | regionStrings.push("end cancel"); 646 | }); 647 | break; 648 | } else if (/box/.test(tree.label)) { 649 | buildRegion(a11yStrings, function (regionStrings) { 650 | regionStrings.push("start box"); 651 | buildA11yStrings(tree.body, regionStrings, atomType); 652 | regionStrings.push("end box"); 653 | }); 654 | break; 655 | } else if (/sout/.test(tree.label)) { 656 | buildRegion(a11yStrings, function (regionStrings) { 657 | regionStrings.push("start strikeout"); 658 | buildA11yStrings(tree.body, regionStrings, atomType); 659 | regionStrings.push("end strikeout"); 660 | }); 661 | break; 662 | } else if (/phase/.test(tree.label)) { 663 | buildRegion(a11yStrings, function (regionStrings) { 664 | regionStrings.push("start phase angle"); 665 | buildA11yStrings(tree.body, regionStrings, atomType); 666 | regionStrings.push("end phase angle"); 667 | }); 668 | break; 669 | } 670 | 671 | throw new Error("KaTeX-a11y: enclose node with " + tree.label + " not supported yet"); 672 | } 673 | 674 | case "vcenter": 675 | { 676 | buildA11yStrings(tree.body, a11yStrings, atomType); 677 | break; 678 | } 679 | 680 | case "vphantom": 681 | { 682 | throw new Error("KaTeX-a11y: vphantom not implemented yet"); 683 | } 684 | 685 | case "hphantom": 686 | { 687 | throw new Error("KaTeX-a11y: hphantom not implemented yet"); 688 | } 689 | 690 | case "operatorname": 691 | { 692 | buildA11yStrings(tree.body, a11yStrings, atomType); 693 | break; 694 | } 695 | 696 | case "array": 697 | { 698 | throw new Error("KaTeX-a11y: array not implemented yet"); 699 | } 700 | 701 | case "raw": 702 | { 703 | throw new Error("KaTeX-a11y: raw not implemented yet"); 704 | } 705 | 706 | case "size": 707 | { 708 | // Although there are nodes of type "size" in the parse tree, they have 709 | // no semantic meaning and should be ignored. 710 | break; 711 | } 712 | 713 | case "url": 714 | { 715 | throw new Error("KaTeX-a11y: url not implemented yet"); 716 | } 717 | 718 | case "tag": 719 | { 720 | throw new Error("KaTeX-a11y: tag not implemented yet"); 721 | } 722 | 723 | case "verb": 724 | { 725 | buildString("start verbatim", "normal", a11yStrings); 726 | buildString(tree.body, "normal", a11yStrings); 727 | buildString("end verbatim", "normal", a11yStrings); 728 | break; 729 | } 730 | 731 | case "environment": 732 | { 733 | throw new Error("KaTeX-a11y: environment not implemented yet"); 734 | } 735 | 736 | case "horizBrace": 737 | { 738 | buildString("start " + tree.label.slice(1), "normal", a11yStrings); 739 | buildA11yStrings(tree.base, a11yStrings, atomType); 740 | buildString("end " + tree.label.slice(1), "normal", a11yStrings); 741 | break; 742 | } 743 | 744 | case "infix": 745 | { 746 | // All infix nodes are replace with other nodes. 747 | break; 748 | } 749 | 750 | case "includegraphics": 751 | { 752 | throw new Error("KaTeX-a11y: includegraphics not implemented yet"); 753 | } 754 | 755 | case "font": 756 | { 757 | // TODO: callout the start/end of specific fonts 758 | // TODO: map \BBb{N} to "the naturals" or something like that 759 | buildA11yStrings(tree.body, a11yStrings, atomType); 760 | break; 761 | } 762 | 763 | case "href": 764 | { 765 | throw new Error("KaTeX-a11y: href not implemented yet"); 766 | } 767 | 768 | case "cr": 769 | { 770 | // This is used by environments. 771 | throw new Error("KaTeX-a11y: cr not implemented yet"); 772 | } 773 | 774 | case "underline": 775 | { 776 | buildRegion(a11yStrings, function (a11yStrings) { 777 | a11yStrings.push("start underline"); 778 | buildA11yStrings(tree.body, a11yStrings, atomType); 779 | a11yStrings.push("end underline"); 780 | }); 781 | break; 782 | } 783 | 784 | case "xArrow": 785 | { 786 | throw new Error("KaTeX-a11y: xArrow not implemented yet"); 787 | } 788 | 789 | case "cdlabel": 790 | { 791 | throw new Error("KaTeX-a11y: cdlabel not implemented yet"); 792 | } 793 | 794 | case "cdlabelparent": 795 | { 796 | throw new Error("KaTeX-a11y: cdlabelparent not implemented yet"); 797 | } 798 | 799 | case "mclass": 800 | { 801 | // \neq and \ne are macros so we let "htmlmathml" render the mathmal 802 | // side of things and extract the text from that. 803 | const atomType = tree.mclass.slice(1); // $FlowFixMe: drop the leading "m" from the values in mclass 804 | 805 | buildA11yStrings(tree.body, a11yStrings, atomType); 806 | break; 807 | } 808 | 809 | case "mathchoice": 810 | { 811 | // TODO: track which style we're using, e.g. display, text, etc. 812 | // default to text style if even that may not be the correct style 813 | buildA11yStrings(tree.text, a11yStrings, atomType); 814 | break; 815 | } 816 | 817 | case "htmlmathml": 818 | { 819 | buildA11yStrings(tree.mathml, a11yStrings, atomType); 820 | break; 821 | } 822 | 823 | case "middle": 824 | { 825 | buildString(tree.delim, atomType, a11yStrings); 826 | break; 827 | } 828 | 829 | case "internal": 830 | { 831 | // internal nodes are never included in the parse tree 832 | break; 833 | } 834 | 835 | case "html": 836 | { 837 | buildA11yStrings(tree.body, a11yStrings, atomType); 838 | break; 839 | } 840 | 841 | default: 842 | tree.type; 843 | throw new Error("KaTeX a11y un-recognized type: " + tree.type); 844 | } 845 | }; 846 | 847 | const buildA11yStrings = function (tree, a11yStrings, atomType) { 848 | if (a11yStrings === void 0) { 849 | a11yStrings = []; 850 | } 851 | 852 | if (tree instanceof Array) { 853 | for (let i = 0; i < tree.length; i++) { 854 | buildA11yStrings(tree[i], a11yStrings, atomType); 855 | } 856 | } else { 857 | handleObject(tree, a11yStrings, atomType); 858 | } 859 | 860 | return a11yStrings; 861 | }; 862 | 863 | const flatten = function (array) { 864 | let result = []; 865 | array.forEach(function (item) { 866 | if (item instanceof Array) { 867 | result = result.concat(flatten(item)); 868 | } else { 869 | result.push(item); 870 | } 871 | }); 872 | return result; 873 | }; 874 | 875 | const renderA11yString = function (text, settings) { 876 | const tree = katex__WEBPACK_IMPORTED_MODULE_0___default().__parse(text, settings); 877 | 878 | const a11yStrings = buildA11yStrings(tree, [], "normal"); 879 | return flatten(a11yStrings).join(", "); 880 | }; 881 | 882 | /* harmony default export */ __webpack_exports__["default"] = (renderA11yString); 883 | __webpack_exports__ = __webpack_exports__["default"]; 884 | /******/ return __webpack_exports__; 885 | /******/ })() 886 | ; 887 | }); -------------------------------------------------------------------------------- /assets/katex/contrib/mhchem.min.js: -------------------------------------------------------------------------------- 1 | !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("katex"));else if("function"==typeof define&&define.amd)define(["katex"],e);else{var n="object"==typeof exports?e(require("katex")):e(t.katex);for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}("undefined"!=typeof self?self:this,(function(t){return function(){"use strict";var e={757:function(e){e.exports=t}},n={};function o(t){var a=n[t];if(void 0!==a)return a.exports;var r=n[t]={exports:{}};return e[t](r,r.exports,o),r.exports}o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,{a:e}),e},o.d=function(t,e){for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var a={},r=o(757),i=o.n(r);i().__defineMacro("\\ce",(function(t){return c(t.consumeArgs(1)[0],"ce")})),i().__defineMacro("\\pu",(function(t){return c(t.consumeArgs(1)[0],"pu")})),i().__defineMacro("\\tripledash","{\\vphantom{-}\\raisebox{2.56mu}{$\\mkern2mu\\tiny\\text{-}\\mkern1mu\\text{-}\\mkern1mu\\text{-}\\mkern2mu$}}");var c=function(t,e){for(var n="",o=t.length&&t[t.length-1].loc.start,a=t.length-1;a>=0;a--)t[a].loc.start>o&&(n+=" ",o=t[a].loc.start),n+=t[a].text,o+=t[a].text.length;return p.go(u.go(n,e))},u={go:function(t,e){if(!t)return[];void 0===e&&(e="ce");var n,o="0",a={};a.parenthesisLevel=0,t=(t=(t=t.replace(/\n/g," ")).replace(/[\u2212\u2013\u2014\u2010]/g,"-")).replace(/[\u2026]/g,"...");for(var r=10,i=[];;){n!==t?(r=10,n=t):r--;var c=u.stateMachines[e],p=c.transitions[o]||c.transitions["*"];t:for(var s=0;s0))return i;if(d.revisit||(t=_.remainder),!d.toContinue)break t}}if(r<=0)throw["MhchemBugU","mhchem bug U. Please report."]}},concatArray:function(t,e){if(e)if(Array.isArray(e))for(var n=0;n":/^[=<>]/,"#":/^[#\u2261]/,"+":/^\+/,"-$":/^-(?=[\s_},;\]/]|$|\([a-z]+\))/,"-9":/^-(?=[0-9])/,"- orbital overlap":/^-(?=(?:[spd]|sp)(?:$|[\s,;\)\]\}]))/,"-":/^-/,"pm-operator":/^(?:\\pm|\$\\pm\$|\+-|\+\/-)/,operator:/^(?:\+|(?:[\-=<>]|<<|>>|\\approx|\$\\approx\$)(?=\s|$|-?[0-9]))/,arrowUpDown:/^(?:v|\(v\)|\^|\(\^\))(?=$|[\s,;\)\]\}])/,"\\bond{(...)}":function(t){return u.patterns.findObserveGroups(t,"\\bond{","","","}")},"->":/^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,CMT:/^[CMT](?=\[)/,"[(...)]":function(t){return u.patterns.findObserveGroups(t,"[","","","]")},"1st-level escape":/^(&|\\\\|\\hline)\s*/,"\\,":/^(?:\\[,\ ;:])/,"\\x{}{}":function(t){return u.patterns.findObserveGroups(t,"",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"\\x{}":function(t){return u.patterns.findObserveGroups(t,"",/^\\[a-zA-Z]+\{/,"}","")},"\\ca":/^\\ca(?:\s+|(?![a-zA-Z]))/,"\\x":/^(?:\\[a-zA-Z]+\s*|\\[_&{}%])/,orbital:/^(?:[0-9]{1,2}[spdfgh]|[0-9]{0,2}sp)(?=$|[^a-zA-Z])/,others:/^[\/~|]/,"\\frac{(...)}":function(t){return u.patterns.findObserveGroups(t,"\\frac{","","","}","{","","","}")},"\\overset{(...)}":function(t){return u.patterns.findObserveGroups(t,"\\overset{","","","}","{","","","}")},"\\underset{(...)}":function(t){return u.patterns.findObserveGroups(t,"\\underset{","","","}","{","","","}")},"\\underbrace{(...)}":function(t){return u.patterns.findObserveGroups(t,"\\underbrace{","","","}_","{","","","}")},"\\color{(...)}0":function(t){return u.patterns.findObserveGroups(t,"\\color{","","","}")},"\\color{(...)}{(...)}1":function(t){return u.patterns.findObserveGroups(t,"\\color{","","","}","{","","","}")},"\\color(...){(...)}2":function(t){return u.patterns.findObserveGroups(t,"\\color","\\","",/^(?=\{)/,"{","","","}")},"\\ce{(...)}":function(t){return u.patterns.findObserveGroups(t,"\\ce{","","","}")},oxidation$:/^(?:[+-][IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"d-oxidation$":/^(?:[+-]?\s?[IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"roman numeral":/^[IVX]+/,"1/2$":/^[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+(?:\$[a-z]\$|[a-z])?$/,amount:function(t){var e;if(e=t.match(/^(?:(?:(?:\([+\-]?[0-9]+\/[0-9]+\)|[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+|[+\-]?[0-9]+[.,][0-9]+|[+\-]?\.[0-9]+|[+\-]?[0-9]+)(?:[a-z](?=\s*[A-Z]))?)|[+\-]?[a-z](?=\s*[A-Z])|\+(?!\s))/))return{match_:e[0],remainder:t.substr(e[0].length)};var n=u.patterns.findObserveGroups(t,"","$","$","");return n&&(e=n.match_.match(/^\$(?:\(?[+\-]?(?:[0-9]*[a-z]?[+\-])?[0-9]*[a-z](?:[+\-][0-9]*[a-z]?)?\)?|\+|-)\$$/))?{match_:e[0],remainder:t.substr(e[0].length)}:null},amount2:function(t){return this.amount(t)},"(KV letters),":/^(?:[A-Z][a-z]{0,2}|i)(?=,)/,formula$:function(t){if(t.match(/^\([a-z]+\)$/))return null;var e=t.match(/^(?:[a-z]|(?:[0-9\ \+\-\,\.\(\)]+[a-z])+[0-9\ \+\-\,\.\(\)]*|(?:[a-z][0-9\ \+\-\,\.\(\)]+)+[a-z]?)$/);return e?{match_:e[0],remainder:t.substr(e[0].length)}:null},uprightEntities:/^(?:pH|pOH|pC|pK|iPr|iBu)(?=$|[^a-zA-Z])/,"/":/^\s*(\/)\s*/,"//":/^\s*(\/\/)\s*/,"*":/^\s*[*.]\s*/},findObserveGroups:function(t,e,n,o,a,r,i,c,u,p){var s=function(t,e){if("string"==typeof e)return 0!==t.indexOf(e)?null:e;var n=t.match(e);return n?n[0]:null},_=s(t,e);if(null===_)return null;if(t=t.substr(_.length),null===(_=s(t,n)))return null;var d=function(t,e,n){for(var o=0;e":{"0|1|2|3":{action_:"r=",nextState:"r"},"a|as":{action_:["output","r="],nextState:"r"},"*":{action_:["output","r="],nextState:"r"}},"+":{o:{action_:"d= kv",nextState:"d"},"d|D":{action_:"d=",nextState:"d"},q:{action_:"d=",nextState:"qd"},"qd|qD":{action_:"d=",nextState:"qd"},dq:{action_:["output","d="],nextState:"d"},3:{action_:["sb=false","output","operator"],nextState:"0"}},amount:{"0|2":{action_:"a=",nextState:"a"}},"pm-operator":{"0|1|2|a|as":{action_:["sb=false","output",{type_:"operator",option:"\\pm"}],nextState:"0"}},operator:{"0|1|2|a|as":{action_:["sb=false","output","operator"],nextState:"0"}},"-$":{"o|q":{action_:["charge or bond","output"],nextState:"qd"},d:{action_:"d=",nextState:"d"},D:{action_:["output",{type_:"bond",option:"-"}],nextState:"3"},q:{action_:"d=",nextState:"qd"},qd:{action_:"d=",nextState:"qd"},"qD|dq":{action_:["output",{type_:"bond",option:"-"}],nextState:"3"}},"-9":{"3|o":{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"3"}},"- orbital overlap":{o:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"},d:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"}},"-":{"0|1|2":{action_:[{type_:"output",option:1},"beginsWithBond=true",{type_:"bond",option:"-"}],nextState:"3"},3:{action_:{type_:"bond",option:"-"}},a:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"},as:{action_:[{type_:"output",option:2},{type_:"bond",option:"-"}],nextState:"3"},b:{action_:"b="},o:{action_:{type_:"- after o/d",option:!1},nextState:"2"},q:{action_:{type_:"- after o/d",option:!1},nextState:"2"},"d|qd|dq":{action_:{type_:"- after o/d",option:!0},nextState:"2"},"D|qD|p":{action_:["output",{type_:"bond",option:"-"}],nextState:"3"}},amount2:{"1|3":{action_:"a=",nextState:"a"}},letters:{"0|1|2|3|a|as|b|p|bp|o":{action_:"o=",nextState:"o"},"q|dq":{action_:["output","o="],nextState:"o"},"d|D|qd|qD":{action_:"o after d",nextState:"o"}},digits:{o:{action_:"q=",nextState:"q"},"d|D":{action_:"q=",nextState:"dq"},q:{action_:["output","o="],nextState:"o"},a:{action_:"o=",nextState:"o"}},"space A":{"b|p|bp":{}},space:{a:{nextState:"as"},0:{action_:"sb=false"},"1|2":{action_:"sb=true"},"r|rt|rd|rdt|rdq":{action_:"output",nextState:"0"},"*":{action_:["output","sb=true"],nextState:"1"}},"1st-level escape":{"1|2":{action_:["output",{type_:"insert+p1",option:"1st-level escape"}]},"*":{action_:["output",{type_:"insert+p1",option:"1st-level escape"}],nextState:"0"}},"[(...)]":{"r|rt":{action_:"rd=",nextState:"rd"},"rd|rdt":{action_:"rq=",nextState:"rdq"}},"...":{"o|d|D|dq|qd|qD":{action_:["output",{type_:"bond",option:"..."}],nextState:"3"},"*":{action_:[{type_:"output",option:1},{type_:"insert",option:"ellipsis"}],nextState:"1"}},". |* ":{"*":{action_:["output",{type_:"insert",option:"addition compound"}],nextState:"1"}},"state of aggregation $":{"*":{action_:["output","state of aggregation"],nextState:"1"}},"{[(":{"a|as|o":{action_:["o=","output","parenthesisLevel++"],nextState:"2"},"0|1|2|3":{action_:["o=","output","parenthesisLevel++"],nextState:"2"},"*":{action_:["output","o=","output","parenthesisLevel++"],nextState:"2"}},")]}":{"0|1|2|3|b|p|bp|o":{action_:["o=","parenthesisLevel--"],nextState:"o"},"a|as|d|D|q|qd|qD|dq":{action_:["output","o=","parenthesisLevel--"],nextState:"o"}},", ":{"*":{action_:["output","comma"],nextState:"0"}},"^_":{"*":{}},"^{(...)}|^($...$)":{"0|1|2|as":{action_:"b=",nextState:"b"},p:{action_:"b=",nextState:"bp"},"3|o":{action_:"d= kv",nextState:"D"},q:{action_:"d=",nextState:"qD"},"d|D|qd|qD|dq":{action_:["output","d="],nextState:"D"}},"^a|^\\x{}{}|^\\x{}|^\\x|'":{"0|1|2|as":{action_:"b=",nextState:"b"},p:{action_:"b=",nextState:"bp"},"3|o":{action_:"d= kv",nextState:"d"},q:{action_:"d=",nextState:"qd"},"d|qd|D|qD":{action_:"d="},dq:{action_:["output","d="],nextState:"d"}},"_{(state of aggregation)}$":{"d|D|q|qd|qD|dq":{action_:["output","q="],nextState:"q"}},"_{(...)}|_($...$)|_9|_\\x{}{}|_\\x{}|_\\x":{"0|1|2|as":{action_:"p=",nextState:"p"},b:{action_:"p=",nextState:"bp"},"3|o":{action_:"q=",nextState:"q"},"d|D":{action_:"q=",nextState:"dq"},"q|qd|qD|dq":{action_:["output","q="],nextState:"q"}},"=<>":{"0|1|2|3|a|as|o|q|d|D|qd|qD|dq":{action_:[{type_:"output",option:2},"bond"],nextState:"3"}},"#":{"0|1|2|3|a|as|o":{action_:[{type_:"output",option:2},{type_:"bond",option:"#"}],nextState:"3"}},"{}":{"*":{action_:{type_:"output",option:1},nextState:"1"}},"{...}":{"0|1|2|3|a|as|b|p|bp":{action_:"o=",nextState:"o"},"o|d|D|q|qd|qD|dq":{action_:["output","o="],nextState:"o"}},"$...$":{a:{action_:"a="},"0|1|2|3|as|b|p|bp|o":{action_:"o=",nextState:"o"},"as|o":{action_:"o="},"q|d|D|qd|qD|dq":{action_:["output","o="],nextState:"o"}},"\\bond{(...)}":{"*":{action_:[{type_:"output",option:2},"bond"],nextState:"3"}},"\\frac{(...)}":{"*":{action_:[{type_:"output",option:1},"frac-output"],nextState:"3"}},"\\overset{(...)}":{"*":{action_:[{type_:"output",option:2},"overset-output"],nextState:"3"}},"\\underset{(...)}":{"*":{action_:[{type_:"output",option:2},"underset-output"],nextState:"3"}},"\\underbrace{(...)}":{"*":{action_:[{type_:"output",option:2},"underbrace-output"],nextState:"3"}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:[{type_:"output",option:2},"color-output"],nextState:"3"}},"\\color{(...)}0":{"*":{action_:[{type_:"output",option:2},"color0-output"]}},"\\ce{(...)}":{"*":{action_:[{type_:"output",option:2},"ce"],nextState:"3"}},"\\,":{"*":{action_:[{type_:"output",option:1},"copy"],nextState:"1"}},"\\x{}{}|\\x{}|\\x":{"0|1|2|3|a|as|b|p|bp|o|c0":{action_:["o=","output"],nextState:"3"},"*":{action_:["output","o=","output"],nextState:"3"}},others:{"*":{action_:[{type_:"output",option:1},"copy"],nextState:"3"}},else2:{a:{action_:"a to o",nextState:"o",revisit:!0},as:{action_:["output","sb=true"],nextState:"1",revisit:!0},"r|rt|rd|rdt|rdq":{action_:["output"],nextState:"0",revisit:!0},"*":{action_:["output","copy"],nextState:"3"}}}),actions:{"o after d":function(t,e){var n;if((t.d||"").match(/^[0-9]+$/)){var o=t.d;t.d=void 0,n=this.output(t),t.b=o}else n=this.output(t);return u.actions["o="](t,e),n},"d= kv":function(t,e){t.d=e,t.dType="kv"},"charge or bond":function(t,e){if(t.beginsWithBond){var n=[];return u.concatArray(n,this.output(t)),u.concatArray(n,u.actions.bond(t,e,"-")),n}t.d=e},"- after o/d":function(t,e,n){var o=u.patterns.match_("orbital",t.o||""),a=u.patterns.match_("one lowercase greek letter $",t.o||""),r=u.patterns.match_("one lowercase latin letter $",t.o||""),i=u.patterns.match_("$one lowercase latin letter$ $",t.o||""),c="-"===e&&(o&&""===o.remainder||a||r||i);!c||t.a||t.b||t.p||t.d||t.q||o||!r||(t.o="$"+t.o+"$");var p=[];return c?(u.concatArray(p,this.output(t)),p.push({type_:"hyphen"})):(o=u.patterns.match_("digits",t.d||""),n&&o&&""===o.remainder?(u.concatArray(p,u.actions["d="](t,e)),u.concatArray(p,this.output(t))):(u.concatArray(p,this.output(t)),u.concatArray(p,u.actions.bond(t,e,"-")))),p},"a to o":function(t){t.o=t.a,t.a=void 0},"sb=true":function(t){t.sb=!0},"sb=false":function(t){t.sb=!1},"beginsWithBond=true":function(t){t.beginsWithBond=!0},"beginsWithBond=false":function(t){t.beginsWithBond=!1},"parenthesisLevel++":function(t){t.parenthesisLevel++},"parenthesisLevel--":function(t){t.parenthesisLevel--},"state of aggregation":function(t,e){return{type_:"state of aggregation",p1:u.go(e,"o")}},comma:function(t,e){var n=e.replace(/\s*$/,"");return n!==e&&0===t.parenthesisLevel?{type_:"comma enumeration L",p1:n}:{type_:"comma enumeration M",p1:n}},output:function(t,e,n){var o,a,r;t.r?(a="M"===t.rdt?u.go(t.rd,"tex-math"):"T"===t.rdt?[{type_:"text",p1:t.rd||""}]:u.go(t.rd),r="M"===t.rqt?u.go(t.rq,"tex-math"):"T"===t.rqt?[{type_:"text",p1:t.rq||""}]:u.go(t.rq),o={type_:"arrow",r:t.r,rd:a,rq:r}):(o=[],(t.a||t.b||t.p||t.o||t.q||t.d||n)&&(t.sb&&o.push({type_:"entitySkip"}),t.o||t.q||t.d||t.b||t.p||2===n?t.o||t.q||t.d||!t.b&&!t.p?t.o&&"kv"===t.dType&&u.patterns.match_("d-oxidation$",t.d||"")?t.dType="oxidation":t.o&&"kv"===t.dType&&!t.q&&(t.dType=void 0):(t.o=t.a,t.d=t.b,t.q=t.p,t.a=t.b=t.p=void 0):(t.o=t.a,t.a=void 0),o.push({type_:"chemfive",a:u.go(t.a,"a"),b:u.go(t.b,"bd"),p:u.go(t.p,"pq"),o:u.go(t.o,"o"),q:u.go(t.q,"pq"),d:u.go(t.d,"oxidation"===t.dType?"oxidation":"bd"),dType:t.dType})));for(var i in t)"parenthesisLevel"!==i&&"beginsWithBond"!==i&&delete t[i];return o},"oxidation-output":function(t,e){var n=["{"];return u.concatArray(n,u.go(e,"oxidation")),n.push("}"),n},"frac-output":function(t,e){return{type_:"frac-ce",p1:u.go(e[0]),p2:u.go(e[1])}},"overset-output":function(t,e){return{type_:"overset",p1:u.go(e[0]),p2:u.go(e[1])}},"underset-output":function(t,e){return{type_:"underset",p1:u.go(e[0]),p2:u.go(e[1])}},"underbrace-output":function(t,e){return{type_:"underbrace",p1:u.go(e[0]),p2:u.go(e[1])}},"color-output":function(t,e){return{type_:"color",color1:e[0],color2:u.go(e[1])}},"r=":function(t,e){t.r=e},"rdt=":function(t,e){t.rdt=e},"rd=":function(t,e){t.rd=e},"rqt=":function(t,e){t.rqt=e},"rq=":function(t,e){t.rq=e},operator:function(t,e,n){return{type_:"operator",kind_:n||e}}}},a:{transitions:u.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"1",revisit:!0}},"$(...)$":{"*":{action_:"tex-math tight",nextState:"1"}},",":{"*":{action_:{type_:"insert",option:"commaDecimal"}}},else2:{"*":{action_:"copy"}}}),actions:{}},o:{transitions:u.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"1",revisit:!0}},letters:{"*":{action_:"rm"}},"\\ca":{"*":{action_:{type_:"insert",option:"circa"}}},"\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"{text}"}},else2:{"*":{action_:"copy"}}}),actions:{}},text:{transitions:u.createTransitions({empty:{"*":{action_:"output"}},"{...}":{"*":{action_:"text="}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"\\greek":{"*":{action_:["output","rm"]}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:["output","copy"]}},else:{"*":{action_:"text="}}}),actions:{output:function(t){if(t.text_){var e={type_:"text",p1:t.text_};for(var n in t)delete t[n];return e}}}},pq:{transitions:u.createTransitions({empty:{"*":{}},"state of aggregation $":{"*":{action_:"state of aggregation"}},i$:{0:{nextState:"!f",revisit:!0}},"(KV letters),":{0:{action_:"rm",nextState:"0"}},formula$:{0:{nextState:"f",revisit:!0}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"!f",revisit:!0}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"text"}},"a-z":{f:{action_:"tex-math"}},letters:{"*":{action_:"rm"}},"-9.,9":{"*":{action_:"9,9"}},",":{"*":{action_:{type_:"insert+p1",option:"comma enumeration S"}}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:"color-output"}},"\\color{(...)}0":{"*":{action_:"color0-output"}},"\\ce{(...)}":{"*":{action_:"ce"}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},else2:{"*":{action_:"copy"}}}),actions:{"state of aggregation":function(t,e){return{type_:"state of aggregation subscript",p1:u.go(e,"o")}},"color-output":function(t,e){return{type_:"color",color1:e[0],color2:u.go(e[1],"pq")}}}},bd:{transitions:u.createTransitions({empty:{"*":{}},x$:{0:{nextState:"!f",revisit:!0}},formula$:{0:{nextState:"f",revisit:!0}},else:{0:{nextState:"!f",revisit:!0}},"-9.,9 no missing 0":{"*":{action_:"9,9"}},".":{"*":{action_:{type_:"insert",option:"electron dot"}}},"a-z":{f:{action_:"tex-math"}},x:{"*":{action_:{type_:"insert",option:"KV x"}}},letters:{"*":{action_:"rm"}},"'":{"*":{action_:{type_:"insert",option:"prime"}}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"text"}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:"color-output"}},"\\color{(...)}0":{"*":{action_:"color0-output"}},"\\ce{(...)}":{"*":{action_:"ce"}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},else2:{"*":{action_:"copy"}}}),actions:{"color-output":function(t,e){return{type_:"color",color1:e[0],color2:u.go(e[1],"bd")}}}},oxidation:{transitions:u.createTransitions({empty:{"*":{}},"roman numeral":{"*":{action_:"roman-numeral"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},else:{"*":{action_:"copy"}}}),actions:{"roman-numeral":function(t,e){return{type_:"roman numeral",p1:e||""}}}},"tex-math":{transitions:u.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},else:{"*":{action_:"o="}}}),actions:{output:function(t){if(t.o){var e={type_:"tex-math",p1:t.o};for(var n in t)delete t[n];return e}}}},"tex-math tight":{transitions:u.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},"-|+":{"*":{action_:"tight operator"}},else:{"*":{action_:"o="}}}),actions:{"tight operator":function(t,e){t.o=(t.o||"")+"{"+e+"}"},output:function(t){if(t.o){var e={type_:"tex-math",p1:t.o};for(var n in t)delete t[n];return e}}}},"9,9":{transitions:u.createTransitions({empty:{"*":{}},",":{"*":{action_:"comma"}},else:{"*":{action_:"copy"}}}),actions:{comma:function(){return{type_:"commaDecimal"}}}},pu:{transitions:u.createTransitions({empty:{"*":{action_:"output"}},space$:{"*":{action_:["output","space"]}},"{[(|)]}":{"0|a":{action_:"copy"}},"(-)(9)^(-9)":{0:{action_:"number^",nextState:"a"}},"(-)(9.,9)(e)(99)":{0:{action_:"enumber",nextState:"a"}},space:{"0|a":{}},"pm-operator":{"0|a":{action_:{type_:"operator",option:"\\pm"},nextState:"0"}},operator:{"0|a":{action_:"copy",nextState:"0"}},"//":{d:{action_:"o=",nextState:"/"}},"/":{d:{action_:"o=",nextState:"/"}},"{...}|else":{"0|d":{action_:"d=",nextState:"d"},a:{action_:["space","d="],nextState:"d"},"/|q":{action_:"q=",nextState:"q"}}}),actions:{enumber:function(t,e){var n=[];return"+-"===e[0]||"+/-"===e[0]?n.push("\\pm "):e[0]&&n.push(e[0]),e[1]&&(u.concatArray(n,u.go(e[1],"pu-9,9")),e[2]&&(e[2].match(/[,.]/)?u.concatArray(n,u.go(e[2],"pu-9,9")):n.push(e[2])),e[3]=e[4]||e[3],e[3]&&(e[3]=e[3].trim(),"e"===e[3]||"*"===e[3].substr(0,1)?n.push({type_:"cdot"}):n.push({type_:"times"}))),e[3]&&n.push("10^{"+e[5]+"}"),n},"number^":function(t,e){var n=[];return"+-"===e[0]||"+/-"===e[0]?n.push("\\pm "):e[0]&&n.push(e[0]),u.concatArray(n,u.go(e[1],"pu-9,9")),n.push("^{"+e[2]+"}"),n},operator:function(t,e,n){return{type_:"operator",kind_:n||e}},space:function(){return{type_:"pu-space-1"}},output:function(t){var e,n=u.patterns.match_("{(...)}",t.d||"");n&&""===n.remainder&&(t.d=n.match_);var o=u.patterns.match_("{(...)}",t.q||"");if(o&&""===o.remainder&&(t.q=o.match_),t.d&&(t.d=t.d.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),t.d=t.d.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F")),t.q){t.q=t.q.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),t.q=t.q.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F");var a={d:u.go(t.d,"pu"),q:u.go(t.q,"pu")};"//"===t.o?e={type_:"pu-frac",p1:a.d,p2:a.q}:(e=a.d,a.d.length>1||a.q.length>1?e.push({type_:" / "}):e.push({type_:"/"}),u.concatArray(e,a.q))}else e=u.go(t.d,"pu-2");for(var r in t)delete t[r];return e}}},"pu-2":{transitions:u.createTransitions({empty:{"*":{action_:"output"}},"*":{"*":{action_:["output","cdot"],nextState:"0"}},"\\x":{"*":{action_:"rm="}},space:{"*":{action_:["output","space"],nextState:"0"}},"^{(...)}|^(-1)":{1:{action_:"^(-1)"}},"-9.,9":{0:{action_:"rm=",nextState:"0"},1:{action_:"^(-1)",nextState:"0"}},"{...}|else":{"*":{action_:"rm=",nextState:"1"}}}),actions:{cdot:function(){return{type_:"tight cdot"}},"^(-1)":function(t,e){t.rm+="^{"+e+"}"},space:function(){return{type_:"pu-space-2"}},output:function(t){var e=[];if(t.rm){var n=u.patterns.match_("{(...)}",t.rm||"");e=n&&""===n.remainder?u.go(n.match_,"pu"):{type_:"rm",p1:t.rm}}for(var o in t)delete t[o];return e}}},"pu-9,9":{transitions:u.createTransitions({empty:{0:{action_:"output-0"},o:{action_:"output-o"}},",":{0:{action_:["output-0","comma"],nextState:"o"}},".":{0:{action_:["output-0","copy"],nextState:"o"}},else:{"*":{action_:"text="}}}),actions:{comma:function(){return{type_:"commaDecimal"}},"output-0":function(t){var e=[];if(t.text_=t.text_||"",t.text_.length>4){var n=t.text_.length%3;0===n&&(n=3);for(var o=t.text_.length-3;o>0;o-=3)e.push(t.text_.substr(o,3)),e.push({type_:"1000 separator"});e.push(t.text_.substr(0,n)),e.reverse()}else e.push(t.text_);for(var a in t)delete t[a];return e},"output-o":function(t){var e=[];if(t.text_=t.text_||"",t.text_.length>4){for(var n=t.text_.length-3,o=0;o":case"\u2192":case"\u27f6":return"rightarrow";case"<-":return"leftarrow";case"<->":return"leftrightarrow";case"<--\x3e":return"rightleftarrows";case"<=>":case"\u21cc":return"rightleftharpoons";case"<=>>":return"rightequilibrium";case"<<=>":return"leftequilibrium";default:throw["MhchemBugT","mhchem bug T. Please report."]}},_getBond:function(t){switch(t){case"-":case"1":return"{-}";case"=":case"2":return"{=}";case"#":case"3":return"{\\equiv}";case"~":return"{\\tripledash}";case"~-":return"{\\mathrlap{\\raisebox{-.1em}{$-$}}\\raisebox{.1em}{$\\tripledash$}}";case"~=":case"~--":return"{\\mathrlap{\\raisebox{-.2em}{$-$}}\\mathrlap{\\raisebox{.2em}{$\\tripledash$}}-}";case"-~-":return"{\\mathrlap{\\raisebox{-.2em}{$-$}}\\mathrlap{\\raisebox{.2em}{$-$}}\\tripledash}";case"...":return"{{\\cdot}{\\cdot}{\\cdot}}";case"....":return"{{\\cdot}{\\cdot}{\\cdot}{\\cdot}}";case"->":return"{\\rightarrow}";case"<-":return"{\\leftarrow}";case"<":return"{<}";case">":return"{>}";default:throw["MhchemBugT","mhchem bug T. Please report."]}},_getOperator:function(t){switch(t){case"+":return" {}+{} ";case"-":return" {}-{} ";case"=":return" {}={} ";case"<":return" {}<{} ";case">":return" {}>{} ";case"<<":return" {}\\ll{} ";case">>":return" {}\\gg{} ";case"\\pm":return" {}\\pm{} ";case"\\approx":case"$\\approx$":return" {}\\approx{} ";case"v":case"(v)":return" \\downarrow{} ";case"^":case"(^)":return" \\uparrow{} ";default:throw["MhchemBugT","mhchem bug T. Please report."]}}};return a=a.default}()})); --------------------------------------------------------------------------------