Remote Code Blocks

As Irreal readers know, John Kitchin, a Chemical Engineering Professor at Carnegie Mellon, produces virtually all of his group’s journal articles in Org mode. Those articles typically contain a lot of figures and graphs. In his latest post, Kitchin shows us how to put the calculations for those graphs and figures into code blocks that reside in other files. That makes it easy to reuse those code blocks in other papers or situations and to organize the article source and supplemental information in an orderly way.

The remote code blocks turn out to be really easy to do. Basically you just use a #+call: statement in your main org file that points to the remote code block by name and file. See Kitchin’s post for the details and an example. In the example, the calculations and graphing are performed by a Python program of about 40 lines. Everything is contained in a code block that resides with the supplemental information for the paper.

It’s an impressive technique that makes reproducible research easier and more natural.

This entry was posted in General and tagged , . Bookmark the permalink.