\newtcblisting 中敏感的注释部分对 \lstdefinelanguage 的影响有多大?

\newtcblisting 中敏感的注释部分对 \lstdefinelanguage 的影响有多大?

如何敏感评论部分(下部)代码环境以 \lstdefinelanguage Maple 为上部?

\documentclass{book}

\usepackage{tcolorbox}
\tcbuselibrary{listings,skins,theorems}

\lstdefinelanguage{Maple}{%
morekeywords={%
and,assuming,break,by,catch,description,do,done,
elif,else,end,error,export,fi,finally,for,from,global,if,
implies,in,intersect,local,minus,mod,module,next,not,od,
option,options,or,proc,quit,read,return,save,stop,subset,then,to,try,union,use,uses,while,xor},
sensitive=true,
%keywordstyle=\TNR\color{black},
keywordstyle=\color{black},
morecomment=[l][\color{green!50!black}]\#,
morestring=[b]",
morestring=[d]",
aboveskip={0pt},
belowskip={0pt}%
}[keywords,comments,strings]

\newtcblisting{code}[1]{%
%listing only,
skin=bicolor,
colback=white,
colbacklower=white,
colupper=red!40!black,
collower=blue,
%overlay={\draw[dashed,black] (segmentation.west)--(segmentation.east);},
listing options={language=Maple},
frame style={draw=white,left color=white,right color=white},
%fontupper=\latinfont\setLTR\ttfamily\bfseries,
fontupper=\ttfamily\bfseries,
fontlower=\itshape,
%fontlower=\rm\bf,
%fontlower=\latinfont\setLTR,
%math lower,
width=\linewidth,
%toprule=1mm,bottomrule=.3mm,rightrule=.3mm,leftrule=3mm,
boxrule=0mm,
outer arc=1mm,arc=1mm,
leftupper=0cm,leftlower=0cm,rightupper=0cm,rightlower=0cm,
top=0mm,bottom=0mm,middle=0mm,
%height=,
valign=center,
valign lower=center,
%before=\begin{center}, after=\end{center},
%before upper={\texttt{>}},
%before lower={\begin{center}}, after lower={\end{center}},
center lower,
% center upper,
%flushleft lower,
%flushright upper,
nobeforeafter,
%math lower,
%ams align* lower,
%ams nodisplayskip lower,
listing and comment,
%every listing line={\textcolor{red!40!black}{\ttfamily> }},
%comment={\DefaultMathsDigits\begin{tabular}{l}#1\end{tabular}},
comment={\begin{tabular}{l}#1\end{tabular}}%
}

\begin{document}

‎\begin{code}{‎
‎Fib‎‎ :‎= ‎proc‎(‎‎n::nonnegint)\\‎
option remember; system;\\‎
if $n < 2$ then $n$ else ‎Fib‎$‎(n‎ - ‎1)‎‎$‎ + ‎Fib‎$‎(n‎ - ‎2)$ end if\\‎
‎end proc‎
}
‎Fib‎ :‎= proc( n‎ :: ‎nonnegint‎ )
‎option remember‎, ‎system;‎
‎if n<2 then‎
‎n‎
‎else‎
‎Fib(n-1)‎ + ‎Fib(n-2)‎
‎end if;‎
‎end proc;‎
‎\end{code}‎

\end{document}

我的意思是,在输出中,我如何管理关键字进程选项然后,...和上部一模一样吗?

在此处输入图片描述

相关内容