在列表中添加“numberstyle”一词

在列表中添加“numberstyle”一词

这有什么问题?我定义列表样式如下。

\definecolor{codegreen}{rgb}{0,0.6,0}
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
\definecolor{codepurple}{rgb}{0.58,0,0.82}
\definecolor{backcolour}{rgb}{0.95,0.95,0.92}


\lstdefinestyle{mysqlStyle}{
    language=SQL,
    tabsize=4,
    basicstyle=\footnotesize, 
    frame=tab,
    columns=fixed,
    breaklines=true,
    breakatwhitespace=false,
    showstringspaces=false,
    numbers=left,
    commentstyle=\color{codegreen},
    keywordstyle=\color{blue},
    stringstyle=\color{red}
    numberstyle=\color[rgb]{0.205, 0.142, 0.73},
    stepnumber=1,
    aboveskip={1\baselineskip},
    morekeywords={[1]bigint,nvarchar}
}

当我使用它时

\begin{latin}
    \begin{lstlisting}[style=mysqlStyle]
    INSERT INTO [Table] (id,name) 
    VALUES (0,'Karo');
    \end{lstlisting}
\end{latin}

它返回给我这个

在此处输入图片描述

答案1

您错过了comma (,)排队stringstyle=\color{red}

\lstdefinestyle{mysqlStyle}{
    language=SQL,
    tabsize=4,
    basicstyle=\footnotesize, 
    frame=tab,
    columns=fixed,
    breaklines=true,
    breakatwhitespace=false,
    showstringspaces=false,
    numbers=left,
    commentstyle=\color{codegreen},
    keywordstyle=\color{blue},
    stringstyle=\color{red},
    numberstyle=\color[rgb]{0.205, 0.142, 0.73},
    stepnumber=1,
    aboveskip={1\baselineskip},
    morekeywords={[1]bigint,nvarchar}
}

相关内容