Locally add prismjs
This commit is contained in:
parent
35af792c6a
commit
6aa044cf9b
701 changed files with 35787 additions and 0 deletions
64
node_modules/prismjs/components/prism-latex.js
generated
vendored
Normal file
64
node_modules/prismjs/components/prism-latex.js
generated
vendored
Normal file
|
@ -0,0 +1,64 @@
|
|||
(function (Prism) {
|
||||
var funcPattern = /\\(?:[^a-z()[\]]|[a-z*]+)/i;
|
||||
var insideEqu = {
|
||||
'equation-command': {
|
||||
pattern: funcPattern,
|
||||
alias: 'regex'
|
||||
}
|
||||
};
|
||||
|
||||
Prism.languages.latex = {
|
||||
'comment': /%.*/,
|
||||
// the verbatim environment prints whitespace to the document
|
||||
'cdata': {
|
||||
pattern: /(\\begin\{((?:lstlisting|verbatim)\*?)\})[\s\S]*?(?=\\end\{\2\})/,
|
||||
lookbehind: true
|
||||
},
|
||||
/*
|
||||
* equations can be between $$ $$ or $ $ or \( \) or \[ \]
|
||||
* (all are multiline)
|
||||
*/
|
||||
'equation': [
|
||||
{
|
||||
pattern: /\$\$(?:\\[\s\S]|[^\\$])+\$\$|\$(?:\\[\s\S]|[^\\$])+\$|\\\([\s\S]*?\\\)|\\\[[\s\S]*?\\\]/,
|
||||
inside: insideEqu,
|
||||
alias: 'string'
|
||||
},
|
||||
{
|
||||
pattern: /(\\begin\{((?:align|eqnarray|equation|gather|math|multline)\*?)\})[\s\S]*?(?=\\end\{\2\})/,
|
||||
lookbehind: true,
|
||||
inside: insideEqu,
|
||||
alias: 'string'
|
||||
}
|
||||
],
|
||||
/*
|
||||
* arguments which are keywords or references are highlighted
|
||||
* as keywords
|
||||
*/
|
||||
'keyword': {
|
||||
pattern: /(\\(?:begin|cite|documentclass|end|label|ref|usepackage)(?:\[[^\]]+\])?\{)[^}]+(?=\})/,
|
||||
lookbehind: true
|
||||
},
|
||||
'url': {
|
||||
pattern: /(\\url\{)[^}]+(?=\})/,
|
||||
lookbehind: true
|
||||
},
|
||||
/*
|
||||
* section or chapter headlines are highlighted as bold so that
|
||||
* they stand out more
|
||||
*/
|
||||
'headline': {
|
||||
pattern: /(\\(?:chapter|frametitle|paragraph|part|section|subparagraph|subsection|subsubparagraph|subsubsection|subsubsubparagraph)\*?(?:\[[^\]]+\])?\{)[^}]+(?=\})/,
|
||||
lookbehind: true,
|
||||
alias: 'class-name'
|
||||
},
|
||||
'function': {
|
||||
pattern: funcPattern,
|
||||
alias: 'selector'
|
||||
},
|
||||
'punctuation': /[[\]{}&]/
|
||||
};
|
||||
|
||||
Prism.languages.tex = Prism.languages.latex;
|
||||
Prism.languages.context = Prism.languages.latex;
|
||||
}(Prism));
|
Loading…
Add table
Add a link
Reference in a new issue