Commits

Stéphane GALLAND committed 241052f

Add configuration for source code.

  • Participants
  • Parent commits 95a90c0

Comments (0)

Files changed (1)

 \usepackage[utf8]{inputenc}
 \usepackage{autolatex}
 \usepackage{tabularx}
+\usepackage{listings}
 
 \graphicspath{{./imgs/chapter0/},{./imgs/chapter1/},{./imgs/appendix/}}
 
 	\end{frame}%
 }
 
-\let\code\texttt
+\newcommand{\eg}{\textit{eg.,}\xspace}
+\newcommand{\vs}{\textit{vs.}\xspace}
+
+\let\code\textmd
 \let\id\code
-\newcommand{\kw}[1]{\underline{\code{#1}}}
+\newcommand{\kw}[1]{{\code{\bfseries#1}}}
+
+\lstset{
+	% choose the background color
+	backgroundcolor=\color{white},
+	% the size of the fonts that are used for the code
+	basicstyle=\tiny,
+	% sets if automatic breaks should only happen at whitespace
+	breakatwhitespace=false,
+	% sets automatic line breaking
+	breaklines=true,
+	% sets the caption-position to bottom
+	captionpos=b,
+	% comment style
+	commentstyle=\color{IRTESgreen},
+	% if you want to delete keywords from the given language
+	%deletekeywords={...},
+	% if you want to add LaTeX within your code
+	escapeinside={\%*}{*)},
+	% lets you use non-ASCII characters; for 8-bits encodings only, does not work with UTF-8
+	%extendedchars=true,
+	% adds a frame around the code
+	frame=single,
+	% keeps spaces in text, useful for keeping indentation of code (possibly needs columns=flexible)
+	keepspaces=true,
+	% keyword style
+	keywordstyle=\bfseries,
+	% the language of the code
+	%language=Octave,
+	% if you want to add more keywords to the set
+	%morekeywords={*,...},
+	% where to put the line-numbers; possible values are (none, left, right)
+	numbers=none,
+	% how far the line-numbers are from the code
+	%numbersep=5pt,
+	% the style that is used for the line-numbers
+	%numberstyle=\tiny\color{IRTESblue},
+	% if not set, the frame-color may be changed on line-breaks within not-black text (e.g. comments (green here))
+	rulecolor=\color{IRTESblue},
+	% show spaces everywhere adding particular underscores; it overrides 'showstringspaces'
+	showspaces=false,
+	% underline spaces within strings only
+	showstringspaces=true,
+	% show tabs within strings adding particular underscores
+	showtabs=false,
+	% the step between two line-numbers. If it's 1, each line will be numbered
+	stepnumber=4,
+	% string literal style
+	stringstyle=\color{IRTESlightmagenta},
+	% sets default tabsize to 2 spaces
+	tabsize=2,
+	% show the filename of files included with \lstinputlisting; also try caption instead of title
+	%title=\lstname
+}
 
 \begin{document}