列表和 matlab 美化程序包的问题

问题描述 投票:0回答:0

我有以下几行来为 Latex 中的 matlab 代码定义环境:

\usepackage{listings}
\usepackage{matlab-prettifier}

\lstnewenvironment{matlabcode}
{\lstset{language=Matlab,%
basicstyle=\small\ttfamily,
numbers=none,
numberstyle=\tiny,
stepnumber=1,
frame=single,
aboveskip=7pt,
belowskip=7pt,
xleftmargin=4pt,
xrightmargin=4pt,
framerule=1pt,
keywordstyle=\color[RGB]{0,0,255},
commentstyle=\color[RGB]{34,139,34},
stringstyle=\color[RGB]{160,32,240},
basicstyle=\small \ttfamily,
showstringspaces=false,
keepspaces,
morecomment=[l][\color{Blue}]{...},
frameround=tttt,
backgroundcolor=\color{gray!10!white},
%rulecolor=\color{gray!20!white}
}}
{\lstset{
    style=Matlab-editor,
    mlsectiontitlestyle=\bfseries\color{red}
}}

但是 fseries 或部分的颜色(%% 注释)都没有显示。我能做些什么?谢谢

我还有一个额外的问题:frameround和background color let the corner wrong (background colors the square, not therounded square)。可以修复吗?谢谢

matlab latex
© www.soinside.com 2019 - 2024. All rights reserved.