Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.


python.sty was written by Martin R. Ehmsen, but is no longer
available on his personal site, so I have decided to upload
it here, and may make some changes to it.

It can be used to write python code inside a LaTeX file, and
then have the output included as part of the pdf!

Sample LaTeX document showing it's effect:



	Opening comments.

		# Must use spaces, not tabs.
		def hello_latex (t):
		    print 'Hello %s' % t

		print ' \[ x^2 + y^2 = z^2 \]'

Each LaTeX segment is *independent*, so you can't define variables
in one and reference them later. You can, however, write a kind of
companion python file, and call appropriate functions from within
it. Can be used in conjunction with, say, numpy.
Something went wrong with that request. Please try again.