From a98b5ea6fe8e8cc98a55e0fd793e6e8660ea31c1 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Thu, 30 Dec 2021 19:47:21 +0100 Subject: chore: add prismjs for syntax highlighting --- public/prism/prism-latex.min.js | 43 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 public/prism/prism-latex.min.js (limited to 'public/prism/prism-latex.min.js') diff --git a/public/prism/prism-latex.min.js b/public/prism/prism-latex.min.js new file mode 100644 index 0000000..3ae0a7a --- /dev/null +++ b/public/prism/prism-latex.min.js @@ -0,0 +1,43 @@ +!(function (a) { + var e = /\\(?:[^a-z()[\]]|[a-z*]+)/i, + n = { 'equation-command': { pattern: e, alias: 'regex' } }; + (a.languages.latex = { + comment: /%.*/, + cdata: { + pattern: + /(\\begin\{((?:lstlisting|verbatim)\*?)\})[\s\S]*?(?=\\end\{\2\})/, + lookbehind: !0, + }, + equation: [ + { + pattern: + /\$\$(?:\\[\s\S]|[^\\$])+\$\$|\$(?:\\[\s\S]|[^\\$])+\$|\\\([\s\S]*?\\\)|\\\[[\s\S]*?\\\]/, + inside: n, + alias: 'string', + }, + { + pattern: + /(\\begin\{((?:align|eqnarray|equation|gather|math|multline)\*?)\})[\s\S]*?(?=\\end\{\2\})/, + lookbehind: !0, + inside: n, + alias: 'string', + }, + ], + keyword: { + pattern: + /(\\(?:begin|cite|documentclass|end|label|ref|usepackage)(?:\[[^\]]+\])?\{)[^}]+(?=\})/, + lookbehind: !0, + }, + url: { pattern: /(\\url\{)[^}]+(?=\})/, lookbehind: !0 }, + headline: { + pattern: + /(\\(?:chapter|frametitle|paragraph|part|section|subparagraph|subsection|subsubparagraph|subsubsection|subsubsubparagraph)\*?(?:\[[^\]]+\])?\{)[^}]+(?=\})/, + lookbehind: !0, + alias: 'class-name', + }, + function: { pattern: e, alias: 'selector' }, + punctuation: /[[\]{}&]/, + }), + (a.languages.tex = a.languages.latex), + (a.languages.context = a.languages.latex); +})(Prism); -- cgit v1.2.3