-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprintCode.tex
executable file
·45 lines (38 loc) · 1.14 KB
/
printCode.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
\documentclass[10pt]{article}
%%%http://pedrokroger.net/2011/04/printing-python-code-with-latex/
\usepackage[T1]{fontenc}
\usepackage[scaled]{beramono}
\renewcommand*\familydefault{\ttdefault}
\usepackage{listings}
\newcommand{\code}[2] {
\hrulefill
\subsection*{#1}
\lstinputlisting{#2}
\vspace{2em}
}
\lstset{
language=Python,
showstringspaces=false,
tabsize=4,
commentstyle=\itshape,
basicstyle = \ttfamily,
breaklines,
breakautoindent,
breakindent = 5pt,
prebreak = !,
postbreak = \space,
}
\pagestyle{headings}
\pagenumbering{arabic}
\setlength{\oddsidemargin}{-0.75in} % there is 1 inch before the
% side margin in ``article'' class
\setlength{\textwidth}{8.0in}
\setlength{\voffset}{0pt}
%\setlength{\topmargin}{-36pt} % there is 1 inch before the
\setlength{\topmargin}{-0.95in} % there is 1 inch before the
% top margin in ``article'' class and
% then room for header, etc.
\setlength{\textheight}{10.0in}
\begin{document}
\code{bleor}{bleor.py}
\end{document}