I am trying to put in MATLAB code with comments that contain my language charaters thought they are covered under ANSI chars they jump to word begining in comments.
Heres the code. Its basically sample code I got from OverLeaf wiki I think. Compiled with XeLaTeX.
\documentclass{report}
\usepackage[utf8]{inputenc}
% MATLAB koda bloki
\usepackage{listings}
\usepackage{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{backcolour}{rgb}{0.95,0.95,0.92}
\lstdefinestyle{mystyle}{
backgroundcolor=\color{backcolour},
commentstyle=\color{codegreen},
keywordstyle=\color{magenta},
numberstyle=\tiny\color{codegray},
stringstyle=\color{codepurple},
basicstyle=\ttfamily\footnotesize,
breakatwhitespace=false,
breaklines=true,
captionpos=b,
keepspaces=true,
numbers=left,
numbersep=5pt,
showspaces=false,
showstringspaces=false,
showtabs=false,
tabsize=2,
extendedchars=true
}
\lstset{style=mystyle}
\begin{document}
\lstinputlisting[language=Octave]{matlab.m}
\end{document}