Skip to main content

Literate programming in Python from markdown to LaTeX.

Project description

Prose Code

Literate programming in Python from markdown to LaTeX

The prosecode library is being developed as a way to generate really neat LaTeX from markdown files. It will support both tangling and weaving code. That is, it can run the code from the markdown files and it can also extract the code into separate .py files.

It is assumed that the markdown file uses github style fenced code blocks with extra data as is used in the Markdown-Preview-Enhanced plugin for Atom and VSCode.

Installation (coming soon)

pip install prosecode


The following will extract the python code from and store it in files.

$ prosecode tangle

There is an optional --srcdir parameter that tells where to put the tangled source code.

$ prosecode tangle --srcdir src/


The following will execute the code in, place the output inline, and then convert it to LaTeX.

$ prosecode weave --execute=True --outfile someotherfile.tex

The --outfile parameter is optional. If omitted, it will simply replace .md with .tex.

There is also an optional parameter --execute that tells whether or not to execute the code chunks. The default value is false.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prosecode-0.2.0.tar.gz (6.9 kB view hashes)

Uploaded Source

Built Distribution

prosecode-0.2.0-py3-none-any.whl (10.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page