Hi Medova,
I used
Code: Select all
\usepackage{listings}
\usepackage{color}
\definecolor{offwhite}{rgb}{0.99,1,0.84}
\definecolor{lightgray}{gray}{0.6}
\definecolor{myred}{rgb}{0.9,0,0}
\definecolor{myblue}{rgb}{0,0,0.5}
\definecolor{mygreen}{rgb}{0,0.5,0}
\lstset{ %
language=sh, % choose the language of the code
basicstyle=\footnotesize\ttfamily, % the size of the fonts that are used for the code
keywordstyle=\color{myred}\textbf,
identifierstyle=\color{myblue}\textbf,
commentstyle=\color{lightgray},
stringstyle=\color{mygreen},
morestring=[b]`,
showstringspaces=false, % underline spaces within strings
breakindent=0em,
breaklines,
breakatwhitespace=true,
numbers=left, % where to put the line-numbers
numberstyle=\footnotesize, % the size of the fonts that are used for the line-numbers
stepnumber=2, % the step between two line-numbers. If it's 1 each line will be numbered
numbersep=5pt, % how far the line-numbers are from the code
backgroundcolor=\color{offwhite}, % choose the background color
showspaces=false, % show spaces within strings adding particular underscores
showtabs=false, % show tabs within strings adding particular underscores
escapeinside={\%*}{*)} % if you want to add a comment within your code
}
to typeset bash scripts in a report with syntax highlighting (so lots of style changing!). Obviously I needed to include the color package to define and change colours.
I believe the bit that may be pertinent is to use \ttfamily in your style, rather than \textt{}, but I may be wrong (I'm still learning!).
Hope this helps though.