Using org-mode and org-reveal for teaching material

I’ve finally put together in a single example repo an example of the way I manage teaching material with org-mode.

It needs more docs and work, but should be usable. Docs and demo at and the Gitlab repo at for those curious.

It doesn’t intend to be a full-fleshed product (also the name is just a codename), but release early, release often, they said 😉

Of course, teaching requires much more stuff than slides and handbooks, but eh, that’s my contribution for the moment.

Update 2017/05/18: I’ve updated the docs and repo to include generation of a “printed slides deck” in PDF, using DeckTape.

Slides + Manual + programs generated from single org-mode source

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).

Managing Python code with UTF-8 (french chars) in org-mode + babel + minted for LaTeX export

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.

The 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”

How to manage and export bibliographic notes/refs in org-mode

I’ve felt the need to manage my bibliography with org-mode, allowing me to write drafts of papers while being able to keep a track of all the litterature I’ve read and published already.

There are already many resources which explain how to integrate org-mode with reftex for instance, in order to cite papers inside org-mode, or how to link to biblographic references in bibtex format using org-bibtex.

People have also posted hints on how to manage bibliographic notes inside an org-mode file, which would allow to keep a track of read papers, tag them, add comments, and link these notes to the bibtex file contents.

But I couldn’t find a single comprehensive resource explaining if/how to manage links to such bibliographic notes that can both be navigated inside org-mode, and be exported to latex for previewing article drafts.

Here’s a proposal in attempt to bind all these needs together.

Let’s say we have one bibtex file ~/org/bibliography.bib which contains all the papers references.

We’ll also add into ~/org/ all the notes relating to these articles. These notes will be identified by CUSTOM_ID properties which will contain the bibliographic reference of the papers.

Then we can create a draft in ~/org/ which takes advantage of these.

We can then use two new link prefixes, bib and note to create links to entries in the bibtex file and the corresponding bibliographic notes. These are based on the use of a special rtcite link, that will be handled by a bit of emacs lisp.

Provided that some code is added in the .emacs to treat link opening and latex export for these rtcite links, we now have a valid solution :

  • clicking on a note:abibref link in an org-mode document will jump to the corresponding bibliographic note about a particular paper ‘abibref’ (a section in ~/org/ which has a :CUSTOM_ID: abibref property).
  • clicking on bib:abibref link in an org-mode document will jump to the corresponding bibliographic reference in the bibtex file.
  • exporting an org document containing either of the above links to LaTeX will produce correct references cite{abibref} LaTeX code (see the results here : draft.pdf).

Details of the bibliographic notes contents (~/org/

#+LINK: bib rtcite:bibliography.bib::%s

#+LINK: note

#+title: My bibliographic notes

# \bibliography{bibliography}

* My papers

** 2005

*** Why and how to contribute to libre software when you integrate them into an in-house application ?

:CUSTOM_ID: bac05why

[[bib:bac05why][BibTeX]] .

/This is an interesting paper.../

See also [[note:berger06integration]]

In the above, note that note: links use rtcite links with a # character, which will allow jumping to the CUSTOM_ID property.

Details of a paper draft (~/org/ :

#+LINK: note rtcite:~/org/

#+LINK: bib rtcite:~/org/bibliography.bib::%s

#+title: How to mix org and bib for fun and profit
#+author: Olivier Berger

# \bibliography{bibliography}

* Read a lot

See [[note:bac05why][Why and how to contribute to libre software]] or [[bib:berger06integration]] .

#+BIBLIOGRAPHY: bibliography plain limit:t

Excerpts of the corresponding .emacs :

(defun my-rtcite-export-handler (path desc format)
  (message "my-rtcite-export-handler is called : path = %s, desc = %s, format = %s" path desc format)
  (let* ((search (when (string-match "::#?\\(.+\\)\\'" path)
                   (match-string 1 path)))
         (path (substring path 0 (match-beginning 0))))
    (cond ((eq format 'latex)
           (if (or (not desc) 
                   (equal 0 (search "rtcite:" desc)))
               (format "\\cite{%s}" search)
             (format "\\cite[%s]{%s}" desc search))))))

(require 'org)

(org-add-link-type "rtcite" 

The above is an adapted version of a proposal sent to the org-mode list by Nick Dokos in a response to Andreas Willig :

Migrating from Evolution to Gnus + notmuch (part 3/x)

After having migrated my mail from Evolution’s storage to a local dovecot imap server, I’ve now started the migration to Gnus and notmuch.

I’ll then now manage my mail with Emacs 🙂

The migration to notmuch allows me to index all the threads even though they happen to cross the boundaries of the folders I’ve setup with dovecot’s sieve (see previous post). Still, in Gnus, I can still read the contents of the mail folders, for instance each mailing-list at a time. There are quite a few configuration difficulties so that Gnus and notmuch-emacs can work together well, which I’ll try and document if I find enough time.

I’ve also added a notification script that will notify my Gnome desktop of new mail (which will be the subject of a dedicated post).

While at it, I’ve also installed msmtp, which allows me to use different SMTP servers, depending on the different mail aliases I’ve used (in a symetrical way to what fetchmail does to fetch all mail from my different mail accounts).

I’m now able to integrate my mails with my org-mode setup, referencing Gnus mails in org notes, or tagging in notmuch with same tag names as in org-mode.

I’m now fully Emacs operated, and hope to gain in productivity 🙂

Stay tuned for more details