36 lines
669 B
TeX
36 lines
669 B
TeX
|
\usepackage{listings}%
|
||
|
\usepackage{courier}%
|
||
|
|
||
|
\newcommand{\lstsetc}
|
||
|
{\lstset
|
||
|
{
|
||
|
language=[ANSI]C,
|
||
|
numbers=left,
|
||
|
tabsize=4,
|
||
|
frame=single,
|
||
|
basicstyle=\ttfamily\small,
|
||
|
commentstyle=\color{green},
|
||
|
keywordstyle=\color{blue}\textbf
|
||
|
}
|
||
|
}
|
||
|
|
||
|
\lstloadlanguages{[ISO]C++, [ANSI]C, bash, make, sh, Gnuplot}
|
||
|
|
||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||
|
% example usage:
|
||
|
%
|
||
|
% \input{config/sourcelst.tex}
|
||
|
% ...
|
||
|
% \lstsetc
|
||
|
% \begin{lstlisting}
|
||
|
% #include <stdio.h>
|
||
|
%
|
||
|
% int main(int argc, char *argv[])
|
||
|
% {
|
||
|
% printf("Hello World!\n");
|
||
|
% return 0;
|
||
|
% }
|
||
|
% \end{lstlisting}
|
||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||
|
|