Skip to content
Snippets Groups Projects
Commit ec426d93 authored by FAZELI SHAHROUDI Sepehr (INTERN)'s avatar FAZELI SHAHROUDI Sepehr (INTERN)
Browse files

Add: configure listings and color settings for code snippets

parent 96a2a450
No related branches found
No related tags found
4 merge requests!12First publish without edit,!9Resolve "Implementation",!7Add: Abstract and Introduction,!4Draft: Review Branch with all changes from main against empty
......@@ -10,11 +10,11 @@
% \usepackage{fancyhdr}
\usepackage{scrlayer-scrpage}
\usepackage{listings}
% \usepackage{xcolor}
\usepackage{xcolor}
\usepackage{scrhack}
\usepackage{longtable}
\usepackage{tabularx}
\usepackage[table]{xcolor}
% \usepackage[table]{xcolor}
\usepackage{array}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
......@@ -38,6 +38,68 @@
% \let\oldsubsection\subsection
% \renewcommand{\subsection}{\clearpage\oldsubsection}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\lstloadlanguages{C,C++,csh,Java}
\definecolor{red}{rgb}{0.6,0,0}
\definecolor{blue}{rgb}{0,0,0.6}
\definecolor{green}{rgb}{0,0.8,0}
\definecolor{cyan}{rgb}{0.0,0.6,0.6}
\definecolor{cloudwhite}{rgb}{0.9412, 0.9608, 0.8471}
\lstset{
language=csh,
basicstyle=\footnotesize\ttfamily,
numbers=left,
numberstyle=\tiny,
numbersep=5pt,
tabsize=2,
extendedchars=true,
breaklines=true,
frame=b,
stringstyle=\color{blue}\ttfamily,
showspaces=false,
showtabs=false,
xleftmargin=17pt,
framexleftmargin=17pt,
framexrightmargin=5pt,
framexbottommargin=4pt,
commentstyle=\color{green},
morecomment=[l]{//}, %use comment-line-style!
morecomment=[s]{/*}{*/}, %for multiline comments
showstringspaces=false,
morekeywords={ abstract, event, new, struct,
as, explicit, null, switch,
base, extern, object, this,
bool, false, operator, throw,
break, finally, out, true,
byte, fixed, override, try,
case, float, params, typeof,
catch, for, private, uint,
char, foreach, protected, ulong,
checked, goto, public, unchecked,
class, if, readonly, unsafe,
const, implicit, ref, ushort,
continue, in, return, using,
decimal, int, sbyte, virtual,
default, interface, sealed, volatile,
delegate, internal, short, void,
do, is, sizeof, while,
double, lock, stackalloc,
else, long, static,
enum, namespace, string},
keywordstyle=\color{cyan},
identifierstyle=\color{red},
backgroundcolor=\color{cloudwhite},
}
\usepackage{caption}
\DeclareCaptionFont{white}{\color{white}}
\DeclareCaptionFormat{listing}{\colorbox{blue}{\parbox{\textwidth}{\hspace{5pt}#1#2#3}}}
\DeclareCaptionFormat{listingbullet}{\hspace{27.5pt}\colorbox{blue}{\parbox{0.931\textwidth}{\hspace{5pt}#1#2#3}}}
\captionsetup[lstlisting]{format=listing,labelfont=white,textfont=white,
singlelinecheck=false, margin=0pt, font={bf,footnotesize}}
\renewcommand\lstlistingname{Code}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\clearpairofpagestyles
\ihead{\headmark}
\ofoot*{\pagemark}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment