sty文件里的代码如下,里面写的是一些我常用的自己定义的一些定理环境
\ProvidesPackage{lotheoenvir}
\RequirePackage{tcolorbox}
\tcbuselibrary{theorems}
\newtcbtheorem[number within=chapter]{mydef}{Definition}{colback=green!5,colframe=green!50!black,fonttitle=\scshape,description font=\bfseries}{def}
\newtcbtheorem[number within=chapter]{mytheo}{Theorem}{colback=blue!5,colframe=blue!50!black,fonttitle=\scshape,description font=\bfseries}{theo}
\newtcbtheorem[number within=chapter]{mylem}{Lemma}{colback=yellow!5,colframe=yellow!50!black,fonttitle=\scshape,description font=\bfseries}{lem}
\newtcbtheorem[number within=chapter]{mypro}{Proposition}{colback=red!5,colframe=red!50!black,fonttitle=\scshape,description font=\bfseries}{prop}
\newtcbtheorem[number within=chapter]{mylt}{Example}{colback=purple!5,colframe=purple!50!black,fonttitle=\scshape,description font=\bfseries}{lt}我在文档中加载的情况如下:documentclass[a4paper]{ctexart}
\usepackage[top=2cm,bottom=2cm,left=1.5cm,right=1.5cm]{geometry}
\usepackage{tensor}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{lotheoenvir}
\begin{document}
\begin{mytheo}{}{}
My theorem
\end{mytheo}
\begin{mylt}{}{}
My example
\end{mylt}
\end{
var text = document.getElementById("qsdescription").innerHTML;
var escapetext = escape2Html(text);
console.log(escapetext);
var html = marked(escapetext);
// var converter = new showdown.Converter();
// var html = converter.makeHtml(text);
document.getElementById("qsdescription").innerHTML = html;
//HTML标签反转义(< -> <)
function escape2Html(str) {
var arrEntities={'lt':'<','gt':'>','nbsp':' ','amp':'&','quot':'"'};
return str.replace(/&(lt|gt|nbsp|amp|quot);/ig,function(all,t){
return arrEntities[t];
});
}