Created
June 6, 2009 23:54
-
-
Save CaptSolo/125060 to your computer and use it in GitHub Desktop.
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} | |
% compile this file using: | |
% pdflatex --shell-escape py-latex.tex | |
\usepackage{python} | |
\usepackage{url} | |
\begin{document} | |
\title{ | |
Testing Embedding of Python in \LaTeX | |
} | |
\author{Uldis Boj\=ars} | |
\maketitle | |
\section{Intro} | |
This is a test of the python.sty package which allows to embed Python code inside a \LaTeX document. | |
Get it at: \url{http://www.imada.sdu.dk/~ehmsen/pythonlatex.php} | |
\section{Example} | |
Executing code: | |
\begin{verbatim} | |
for i in range(0,10): | |
print "hahaha", i | |
\end{verbatim} | |
Result: | |
\begin{python} | |
for i in range(0,10): | |
print "hahaha", i | |
\end{python} | |
Note: the code is replaced with its output and is intepreted as \LaTeX instructions. | |
\end{document} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment