master/generators/listings-js.sty

31 lines
879 B
Text
Raw Normal View History

2024-04-12 11:54:05 +00:00
\RequirePackage{listings}
\lstdefinelanguage{JavaScript}{
2024-04-17 13:35:38 +00:00
keywords={typeof, new, true, false, catch, function, return, null, catch, switch,let,const, var, if, in,of, while, do, else, case, break},
2024-04-12 11:54:05 +00:00
keywordstyle=\color{blue}\bfseries,
ndkeywords={class, export, boolean, throw, implements, import, this},
2024-04-17 13:35:38 +00:00
ndkeywordstyle=\color{orange}\bfseries,
2024-04-12 11:54:05 +00:00
identifierstyle=\color{black},
sensitive=false,
comment=[l]{//},
morecomment=[s]{/*}{*/},
2024-04-17 13:35:38 +00:00
commentstyle=\color{gray}\ttfamily,
stringstyle=\color{olive}\ttfamily,
2024-04-12 11:54:05 +00:00
morestring=[b]',
morestring=[b]"
}
\lstset{
language=JavaScript,
2024-04-17 13:35:38 +00:00
backgroundcolor=\color{white},
2024-04-12 11:54:05 +00:00
extendedchars=true,
basicstyle=\footnotesize\ttfamily,
showstringspaces=false,
showspaces=false,
numbers=left,
numberstyle=\footnotesize,
numbersep=9pt,
tabsize=2,
breaklines=true,
showtabs=false,
captionpos=b
}