tex-framework/config/sourcelst.tex
Thomas Klaehn 518ecab91d default source listing
fontsize for default listing changed
2017-01-06 11:23:32 +01:00

82 lines
1.4 KiB
TeX

\usepackage{listings}%
\usepackage{courier}%
\newcommand{\lstsetdefault}
{\lstset
{
aboveskip=\baselineskip,
belowskip=\baselineskip,
language=bash,
tabsize=4,
frame=single,
%basicstyle=\ttfamily\small,
basicstyle=\ttfamily\scriptsize,
commentstyle=\color{black},
keywordstyle=\color{black}
}
}
\newcommand{\lstsetc}
{\lstset
{
aboveskip=\baselineskip,
belowskip=\baselineskip,
language=[ANSI]C,
numbers=left,
tabsize=4,
frame=single,
basicstyle=\ttfamily\small,
commentstyle=\color{green},
keywordstyle=\color{blue}\textbf
}
}
\newcommand{\lstsetmake}
{\lstset
{
aboveskip=\baselineskip,
belowskip=\baselineskip,
language=make,
numbers=left,
tabsize=4,
frame=single,
basicstyle=\ttfamily\small,
commentstyle=\color{green},
keywordstyle=\color{blue}\textbf
}
}
\newcommand{\lstsetbash}
{\lstset
{
aboveskip=\baselineskip,
belowskip=\baselineskip,
language=bash,
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}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%