有人知道这是否存在吗?如果存在,我可以在哪里找到它?
答案1
整个 Stack Exchange 网络使用Google 代码美化用于语法高亮。阅读其TeX
词法分析器,也许还有一些讨论,你会发现只有几个正则表达式在进行匹配。将数据与默认样式表你可以看到只需要六个类。要获取它们的属性,你可以对最小化样式表或使用浏览器的检查器。结果(shomewhat 解释):
.prettyprint { background-color: #eeeeee; } /* code snippet */
.pln { color: #000000; } /* plain text and whitespace */
.com { color: #868686; } /* comments */
.kwd { color: #8a4a0b; } /* macros ([a-Z@]* or single char) */
.typ { color: #2b91af; } /* $ & */
.lit { color: #953838; } /* dimensions */
.pun { color: #145680; } /* {}[]()= */
现在您需要将其放入 TeXstudio 颜色配置文件中。这可以相对轻松地完成(Options > Configure TeXstudio > Syntax Highlighting
)。匹配不会完美,因为突出显示例程完全不同:TeXstudio想要变得更聪明。以下是一些入门知识:
[formats]
data\align-ampersand\bold=false
data\align-ampersand\fontFamily=
data\align-ampersand\foreground=#2b91af
data\align-ampersand\italic=false
data\align-ampersand\overline=false
data\align-ampersand\pointSize=0
data\align-ampersand\priority=-1
data\align-ampersand\strikeout=false
data\align-ampersand\underline=false
data\align-ampersand\waveUnderline=false
data\align-ampersand\wrapAround=false
data\background\background=#eeeeee
data\background\bold=false
data\background\fontFamily=
data\background\italic=false
data\background\overline=false
data\background\pointSize=0
data\background\priority=-1
data\background\strikeout=false
data\background\underline=false
data\background\waveUnderline=false
data\background\wrapAround=false
data\comment\bold=false
data\comment\fontFamily=
data\comment\foreground=#868686
data\comment\italic=false
data\comment\overline=false
data\comment\pointSize=0
data\comment\priority=-1
data\comment\strikeout=false
data\comment\underline=false
data\comment\waveUnderline=false
data\comment\wrapAround=false
data\commentTodo\bold=false
data\commentTodo\fontFamily=
data\commentTodo\foreground=#868686
data\commentTodo\italic=false
data\commentTodo\overline=false
data\commentTodo\pointSize=0
data\commentTodo\priority=-1
data\commentTodo\strikeout=false
data\commentTodo\underline=false
data\commentTodo\waveUnderline=false
data\commentTodo\wrapAround=false
data\environment\bold=false
data\environment\fontFamily=
data\environment\foreground=#000000
data\environment\italic=false
data\environment\overline=false
data\environment\pointSize=0
data\environment\priority=-1
data\environment\strikeout=false
data\environment\underline=false
data\environment\waveUnderline=false
data\environment\wrapAround=false
data\escapeseq\bold=false
data\escapeseq\fontFamily=
data\escapeseq\italic=false
data\escapeseq\overline=false
data\escapeseq\pointSize=0
data\escapeseq\priority=-1
data\escapeseq\strikeout=false
data\escapeseq\underline=false
data\escapeseq\waveUnderline=false
data\escapeseq\wrapAround=false
data\extra-keyword\bold=false
data\extra-keyword\fontFamily=
data\extra-keyword\foreground=#8a4a0b
data\extra-keyword\italic=false
data\extra-keyword\overline=false
data\extra-keyword\pointSize=0
data\extra-keyword\priority=-1
data\extra-keyword\strikeout=false
data\extra-keyword\underline=false
data\extra-keyword\waveUnderline=false
data\extra-keyword\wrapAround=false
data\keyword\bold=false
data\keyword\fontFamily=
data\keyword\foreground=#8a4a0b
data\keyword\italic=false
data\keyword\overline=false
data\keyword\pointSize=0
data\keyword\priority=-1
data\keyword\strikeout=false
data\keyword\underline=false
data\keyword\waveUnderline=false
data\keyword\wrapAround=false
data\link\bold=false
data\link\fontFamily=
data\link\italic=false
data\link\overline=false
data\link\pointSize=0
data\link\priority=-1
data\link\strikeout=false
data\link\underline=false
data\link\waveUnderline=false
data\link\wrapAround=false
data\magicComment\bold=false
data\magicComment\fontFamily=
data\magicComment\foreground=#868686
data\magicComment\italic=false
data\magicComment\overline=false
data\magicComment\pointSize=0
data\magicComment\priority=-1
data\magicComment\strikeout=false
data\magicComment\underline=false
data\magicComment\waveUnderline=false
data\magicComment\wrapAround=false
data\math-delimiter\bold=false
data\math-delimiter\fontFamily=
data\math-delimiter\foreground=#2b91af
data\math-delimiter\italic=false
data\math-delimiter\overline=false
data\math-delimiter\pointSize=0
data\math-delimiter\priority=-1
data\math-delimiter\strikeout=false
data\math-delimiter\underline=false
data\math-delimiter\waveUnderline=false
data\math-delimiter\wrapAround=false
data\math-keyword\bold=false
data\math-keyword\fontFamily=
data\math-keyword\foreground=#8a4a0b
data\math-keyword\italic=false
data\math-keyword\overline=false
data\math-keyword\pointSize=0
data\math-keyword\priority=-1
data\math-keyword\strikeout=false
data\math-keyword\underline=false
data\math-keyword\waveUnderline=false
data\math-keyword\wrapAround=false
data\normal\bold=false
data\normal\fontFamily=
data\normal\foreground=#000000
data\normal\italic=false
data\normal\overline=false
data\normal\pointSize=0
data\normal\priority=-1
data\normal\strikeout=false
data\normal\underline=false
data\normal\waveUnderline=false
data\normal\wrapAround=false
data\numbers\bold=false
data\numbers\fontFamily=
data\numbers\italic=false
data\numbers\overline=false
data\numbers\pointSize=0
data\numbers\priority=-1
data\numbers\strikeout=false
data\numbers\underline=false
data\numbers\waveUnderline=false
data\numbers\wrapAround=false
data\picture\bold=false
data\picture\fontFamily=
data\picture\italic=false
data\picture\overline=false
data\picture\pointSize=0
data\picture\priority=-1
data\picture\strikeout=false
data\picture\underline=false
data\picture\waveUnderline=false
data\picture\wrapAround=false
data\preedit\bold=false
data\preedit\fontFamily=
data\preedit\italic=false
data\preedit\overline=false
data\preedit\pointSize=0
data\preedit\priority=-1
data\preedit\strikeout=false
data\preedit\underline=false
data\preedit\waveUnderline=false
data\preedit\wrapAround=false
data\structure\bold=false
data\structure\fontFamily=
data\structure\italic=false
data\structure\overline=false
data\structure\pointSize=0
data\structure\priority=-1
data\structure\strikeout=false
data\structure\underline=false
data\structure\waveUnderline=false
data\structure\wrapAround=false
data\text\bold=false
data\text\fontFamily=
data\text\italic=false
data\text\overline=false
data\text\pointSize=0
data\text\priority=-1
data\text\strikeout=false
data\text\underline=false
data\text\waveUnderline=false
data\text\wrapAround=false
data\verbatim\bold=false
data\verbatim\fontFamily=
data\verbatim\italic=false
data\verbatim\overline=false
data\verbatim\pointSize=0
data\verbatim\priority=-1
data\verbatim\strikeout=false
data\verbatim\underline=false
data\verbatim\waveUnderline=false
data\verbatim\wrapAround=false
version=1.0
加载它Options > Load Profile
。玩得开心。