Code:
% LaTeX-Vorlage Version 3.1, Juli 2011
\documentclass[a4paper,bibliography=totoc,oneside]{scrbook}
\usepackage{multicol}
\usepackage{longtable, lscape}
\usepackage{fancyvrb, listings}
\usepackage[usenames,dvipsnames,svgnames]{xcolor}
\lstset{ %
backgroundcolor=\color{Red}, % choose the background color; you must add \usepackage{color} or \usepackage{xcolor}
basicstyle=\scriptsize\ttfamily, % footnotesize
belowcaptionskip=1\baselineskip,
breaklines=true,
breakatwhitespace=false, % sets if automatic breaks should only happen at whitespace
captionpos=b, % sets the caption-position to bottom
deletekeywords={...}, % if you want to delete keywords from the given language
escapeinside={\%*}{*)}, % if you want to add LaTeX within your code
morekeywords={*,...}, % if you want to add more keywords to the set
numbers=left, % where to put the line-numbers; possible values are (none, left, right)
numbersep=5pt, % how far the line-numbers are from the code
numberstyle=\tiny\color{Grey}, % the style that is used for the line-numbers
rulecolor=\color{Black}, % if not set, the frame-color may be changed on line-breaks within not-black text (e.g. comments (green here))
showspaces=false, % show spaces everywhere adding particular underscores; it overrides 'showstringspaces'
showstringspaces=false,
showtabs=false, % show tabs within strings adding particular underscores
stepnumber=1, % the step between two line-numbers. If it's 1, each line will be numbered
stringstyle=\color{DarkOrange}, % string literal style
tabsize=4, % sets default tabsize to 2 spaces
title=\lstname % show the filename of files included with \lstinputlisting; also try caption instead of title
}
\lstdefinestyle{python}{
backgroundcolor=\color{WhiteSmoke},
commentstyle=\itshape\color{purple!40!black},
frame=single,
identifierstyle=\color{NavyBlue},
keywordstyle=\bfseries\color{green!40!black},
language=Python,
stringstyle=\color{orange},
xleftmargin=\parindent,
}
\lstdefinestyle{bash}{
backgroundcolor=\color{Black},
commentstyle=\itshape\color{Grey},
frame=L,
identifierstyle=\color{LightGray},
keywordstyle=\bfseries\color{Indigo},
language=bash,
morekeywords={rayk@bacnet01},
numbers=none,
stringstyle=\color{FireBrick},
xleftmargin=\parindent,
}
\usepackage{hyperref}
\usepackage[ansinew]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{amsmath,amssymb,amsfonts,amstext}
\usepackage{helvet}
\renewcommand{\familydefault}{cmss}
\usepackage[pdftex]{graphicx}
\usepackage{array}
\setlength{\textheight}{225mm}
\setlength{\textwidth}{1.05\textwidth}
\tolerance = 9999
\sloppy
\begin{document}
\lstset{escapechar=@,style=bash}
\begin{lstlisting}[caption=bash, label=lst:bash]
$ apt-get install apache2 libapache2-mod-php5 mysql-server
$ apt-get install nagios3 nagios-plugins ndoutils-nagios3-mysql nagios-nrpe-plugin
\end{lstlisting}
\label{code}
\end{document}
Lesezeichen