I’ve been working on maintaining lecture slides and a manual, by writing a single source org-mode file.
From a single source I want to be able to generate different output PDFs, only changing a few switches :
- slides deck
- a manual document
- source files for examples
The slides may contain notes.
Here’s an archive that contains an example document and complementary files. See this documentation document for more details (itself maintained with such an .org source).
The goal of this article is to illustrate how to manage Python code which includes comments in UTF-8 characters inside a latin-1 source org-mode for LaTeX export.
Note that I’ve pasted in wordpress the HTML generated by org-mode, so I hope it isn’t broken too much.
My typical use case is a french lecture on Python where the text is written in french, as well as some of the code comments and examples
We’ll use org-mode’s babel module to include and manage the Python
examples. The goal is to write the source of the Python programs
directly in the same org source as the class book’s text, and to extract them into a subdir (with the “tangle” feature), so that they can be shipped to the students to experiment with.
minted LaTeX environment is used, for babel, to make the Python syntax highlighting.
Continue reading “Managing Python code with UTF-8 (french chars) in org-mode + babel + minted for LaTeX export”