I included a Matlab file, and it worked fine. The colors changed and it looked nice. Suddenly
Latex
doesn't change the colors of the code, except of the background color. Is something wrong with my code? Or is there a possibility that a included package is disturbing the code?Thank you very much for answering!
Code: Select all
\documentclass[12pt, xcolor=dvipsnames]{scrartcl}
\usepackage{listings}
\usepackage[dvipsnames]{xcolor}
\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{mygreen}{RGB}{28,172,0}
\definecolor{mylilas}{RGB}{170,55,241}
\definecolor{backcolour}{rgb}{0.95,0.95,0.92}
\begin{document}
\lstdefinestyle{mystyle}{
backgroundcolor=\color{backcolour},
commentstyle=\color{codegreen},
keywordstyle=\color{blue},
numberstyle=\tiny\color{codegray},
stringstyle=\color{codepurple},
basicstyle=\ttfamily\scriptsize,
breakatwhitespace=false,
breaklines=true,
captionpos=b,
keepspaces=true,
numbers=left,
numbersep=5pt,
showspaces=false,
showstringspaces=false,
showtabs=false,
tabsize=2,
aboveskip=\medskipamount
}
\lstset{style=mystyle}
\lstinputlisting{adj.m}
\end{document}