Created
May 21, 2018 13:33
-
-
Save silgon/88ac6399d2a80d869b2a72911e9ff739 to your computer and use it in GitHub Desktop.
create pdf python code with latex
This file contains hidden or 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{article} | |
\usepackage{listings} | |
\input{listings-python.prf} % defines the python-idle-code style | |
\usepackage{textcomp} % Needed for straight quotes | |
\lstset{ | |
basicstyle=\normalsize\ttfamily, % size of the fonts for the code | |
language={Python},style={python-idle-code}, | |
showstringspaces=false, | |
tabsize=4, | |
upquote=true, % Requires textcomp | |
} | |
\oddsidemargin=-0.5cm | |
\textwidth=7in % This just fits 80 characters at 10pt | |
\begin{document} | |
\lstinputlisting{myscript.py} | |
\end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment