gb-java-devel/settings/fancy-listings-preamble.tex

134 lines
3.4 KiB
TeX
Raw Normal View History

2022-08-13 02:31:01 +03:00
\usepackage{listings}
\definecolor{codekeywords}{rgb}{0.1,0.4,0.4}
\definecolor{codecomments}{rgb}{0,0.6,0}
\definecolor{codenumbers}{rgb}{0.4,0.4,0.4}
\definecolor{codestring}{rgb}{0.85,0.2,0.1}
\definecolor{backcolour}{rgb}{0.95,0.95,0.92}
\definecolor{codefine}{rgb}{0.7,0.5,0.3}
\definecolor{dkgreen}{rgb}{0,0.6,0}
\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{mauve}{rgb}{0.58,0,0.82}
\lstdefinestyle{JCodeStyle}{
frame=single,
language=Java,
aboveskip=3mm,
belowskip=3mm,
showstringspaces=false,
columns=flexible,
2024-05-12 20:23:51 +03:00
basicstyle=\larger[-1]\ttfamily,
2022-08-13 02:31:01 +03:00
numbers=left,
2024-05-12 20:23:51 +03:00
numberstyle=\larger[-2]\color{gray},
2022-08-13 02:31:01 +03:00
keywordstyle=\color{blue},
commentstyle=\color{dkgreen},
stringstyle=\color{mauve},
breaklines=true,
breakatwhitespace=true,
tabsize=4,
escapeinside={<@}{@>}
}
\lstdefinestyle{PyCodeStyle}{
frame=single,
commentstyle=\color{codecomments},
numberstyle=\tiny\color{codenumbers},
stringstyle=\color{codestring},
basicstyle=\ttfamily\footnotesize,
keywordstyle=\color{codekeywords},
breakatwhitespace=false,
breaklines=true,
captionpos=b,
keepspaces=true,
numbers=left,
numbersep=5pt,
showspaces=false,
showstringspaces=false,
showtabs=false,
tabsize=4,
escapeinside={<@}{@>}
}
% \DeclareCaptionFormat{listing}{
% \parbox{\textwidth}{\centering#1 - #3}
% }
% \captionsetup[lstlisting]{ format=listing, singlelinecheck=false, margin=0pt }
\lstdefinestyle{CCodeStyle}{
frame=single,
commentstyle=\color{codecomments},
morecomment=[l][\color{codefine}]{\#},
numberstyle=\tiny\color{codenumbers},
stringstyle=\color{codestring},
basicstyle=\ttfamily\footnotesize,
keywordstyle=\color{codekeywords},
emph={int,char,double,float,unsigned,void,bool},
emphstyle={\color{blue}},
breakatwhitespace=false,
breaklines=true,
captionpos=t,
keepspaces=true,
numbers=left,
numbersep=5pt,
showspaces=false,
showstringspaces=false,
showtabs=false,
tabsize=4,
escapeinside={<@}{@>}
}
\lstdefinestyle{ASMStyle}{
frame=single,
numberstyle=\tiny\color{codenumbers},
commentstyle=\color{codecomments},
keywordstyle=\color{codekeywords},
morecomment=[l]{;}, % l is for line comment
morecomment=[s]{/*}{*/}, % s is for start and end delimiter
2022-08-16 17:00:26 +03:00
basicstyle={\ttfamily\scriptsize},
2022-08-13 02:31:01 +03:00
morekeywords={
bset, macr,
add,addi,and,andi,
bge,beq,bne,br,
cmpeqi,cmpgei,cmplti,cmpnei,
ldhu,ldw,ldwio,
mov,movi,movhi,muli,
nop,nor,
ret,
slli,srai,srli,stw,stwio},
breakatwhitespace=false,
breaklines=true,
captionpos=t,
keepspaces=true,
numbers=left,
numbersep=5pt,
showspaces=false,
showtabs=false,
tabsize=4,
escapeinside={<@}{@>}
}
\lstdefinestyle{VerilogStyle}{
frame=single,
numberstyle=\tiny\color{codenumbers},
commentstyle=\color{codecomments},
keywordstyle=\color{codekeywords},
morecomment=[l]{//}, % l is for line comment
morecomment=[s]{/*}{*/}, % s is for start and end delimiter
basicstyle={\ttfamily\footnotesize},
morekeywords={
logic, always_ff, always_comb
},
breakatwhitespace=false,
breaklines=true,
captionpos=b,
keepspaces=true,
numbers=left,
numbersep=5pt,
showspaces=false,
showtabs=false,
tabsize=2,
escapeinside={<@}{@>}
}
\lstset{escapeinside={<@}{@>}}