Last active
August 29, 2015 14:03
-
-
Save kroger/ec493cdc24dff6ec5e37 to your computer and use it in GitHub Desktop.
Printing Python Code With Latex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\newcommand{code}[2]{ | |
hrulefill | |
subsection*{#1} | |
lstinputlisting{#2} | |
vspace{2em} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
documentclass[10pt]{article} | |
usepackage[T1]{fontenc} | |
usepackage[scaled]{beramono} | |
renewcommand*familydefault{ttdefault} | |
usepackage{listings} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\lstset{ | |
language=Python, | |
showstringspaces=false, | |
formfeed=newpage, | |
tabsize=4, | |
commentstyle=itshape, | |
basicstyle=ttfamily, | |
morekeywords={models, lambda, forms} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\code{Models}{../testapp/models.py} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment