Debian Codegraph @

inst/lib/prism-code-editor/prism/languages/latex.js

raw
1 import { l as languages } from "../../index-C1_GGQ8y.js";
2 var funcPattern = /\\(?:[^a-z()[\]]|[a-z*]+)/i;
3 var insideEqu = {
4 "equation-command": {
5 pattern: funcPattern,
6 alias: "regex"
7 }
8 };
9 languages.context = languages.tex = languages.latex = {
10 "comment": /%.*/,
11 // the verbatim environment prints whitespace to the document
12 "cdata": {
13 pattern: /(\\begin\{((?:lstlisting|verbatim)\*?)\})(?!\\end\{\2\})[^]+?(?=\\end\{\2\})/,
14 lookbehind: true
15 },
16 /*
17 * equations can be between $$ $$ or $ $ or \( \) or \[ \]
18 * (all are multiline)
19 */
20 "equation": [
21 {
22 pattern: /\$\$(?:\\[^]|[^\\$])+\$\$|\$(?:\\[^]|[^\\$])+\$|\\\([^]*?\\\)|\\\[[^]*?\\\]/,
23 inside: insideEqu,
24 alias: "string"
25 },
26 {
27 pattern: /(\\begin\{((?:align|eqnarray|equation|gather|math|multline)\*?)\})(?!\\end\{\2\})[^]+?(?=\\end\{\2\})/,
28 lookbehind: true,
29 inside: insideEqu,
30 alias: "string"
31 }
32 ],
33 /*
34 * arguments which are keywords or references are highlighted
35 * as keywords
36 */
37 "keyword": {
38 pattern: /(\\(?:begin|cite|documentclass|end|label|ref|usepackage)(?:\[[^\]]+\])?\{)[^}]+(?=\})/,
39 lookbehind: true
40 },
41 "url": {
42 pattern: /(\\url\{)[^}]+(?=\})/,
43 lookbehind: true
44 },
45 /*
46 * section or chapter headlines are highlighted as bold so that
47 * they stand out more
48 */
49 "headline": {
50 pattern: /(\\(?:chapter|frametitle|paragraph|part|section|subparagraph|subsection|subsubparagraph|subsubsection|subsubsubparagraph)\*?(?:\[[^\]]+\])?\{)[^}]+(?=\})/,
51 lookbehind: true,
52 alias: "class-name"
53 },
54 "function": {
55 pattern: funcPattern,
56 alias: "selector"
57 },
58 "punctuation": /[[\]{}&]/
59 };
60 //# sourceMappingURL=latex.js.map