import {
  a as s,
  c as l
} from "./chunk-IO47FP3U.js";

// ../node_modules/refractor/lang/latex.js
var u = l((o, i) => {
  i.exports = e;
  e.displayName = "latex";
  e.aliases = ["tex", "context"];
  function e(r) {
    (function(a) {
      var t = /\\(?:[^a-z()[\]]|[a-z*]+)/i, n = {
        "equation-command": {
          pattern: t,
          alias: "regex"
        }
      };
      a.languages.latex = {
        comment: /%.*/,
        // the verbatim environment prints whitespace to the document
        cdata: {
          pattern: /(\\begin\{((?:lstlisting|verbatim)\*?)\})[\s\S]*?(?=\\end\{\2\})/,
          lookbehind: !0
        },
        /*
         * equations can be between $$ $$ or $ $ or \( \) or \[ \]
         * (all are multiline)
         */
        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"
          }
        ],
        /*
         * arguments which are keywords or references are highlighted
         * as keywords
         */
        keyword: {
          pattern: /(\\(?:begin|cite|documentclass|end|label|ref|usepackage)(?:\[[^\]]+\])?\{)[^}]+(?=\})/,
          lookbehind: !0
        },
        url: {
          pattern: /(\\url\{)[^}]+(?=\})/,
          lookbehind: !0
        },
        /*
         * 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: !0,
          alias: "class-name"
        },
        function: {
          pattern: t,
          alias: "selector"
        },
        punctuation: /[[\]{}&]/
      }, a.languages.tex = a.languages.latex, a.languages.context = a.languages.latex;
    })(r);
  }
  s(e, "latex");
});

export {
  u as a
};
