Using Org Tables in Source Blocks

Andreas Gerler has a nice post that shows how to access individual table columns in a source block. If you don't do this sort of thing frequently, it's easy to forget the details. If you occasionally need this capability or think you might, bookmark this post so you have an easy way to reacquaint yourself with the procedure.

I haven't written about using Org source blocks for a long time but they are tremendously powerful. If, for example, you're writing up a lab report for a class, this is a wonderful way to put your data and exact calculations in the same file and then export the parts you want to turn in to a nicely formatted PDF file.

Does that sound familiar? It should. It's just reproducible research writ small. If you're out of school and producing reports or writing up results, the process is just as useful. I use this type of thing all the time in my day to day work and consider it one of the great things about Org mode and Emacs. If you want to see an another example of this sort of thing, I wrote about it here.

Posted in General | Tagged , | 1 Comment

Emacs Videos for N00bs

In yesterday's post I wrote about Rainer König's introductory videos on Org mode. Today, I want to continue that theme with a set of introductory videos for Emacs itself.

Mike Zamansky over at C'est la Z is producing a series of Emacs videos for n00bs. As of this writing Zamansky has 5 videos but he has others in the pipeline. Like König's Org tutorials, they are mostly less than 10 minutes each so they are easy to watch. If you start with Video 11, the videos will play in sequence automatically but it's worthwhile clicking on each video section because that will take you to a page with the video, associated notes, and code mentioned in the video.

So far, he has covered

  • Setting up the package manager
  • Intro to Org Mode
  • How to think about Emacs
  • Buffers
  • Windows

and is promising a video on effective navigation next.

Zamansky approaches the subject on how he uses Emacs so he introduces packages that he's found useful as he goes along. At each step he adds the package and it's configuration to his init.el file so you can see how to set it up. That code is also in the individual Video pages so you don't have to worry about writing it down.

It's an enjoyable series and should be especially useful for those just learning Emacs. Recommended.



The video in the Introduction section is by someone else and not part of the series.

Posted in General | Tagged | 1 Comment

Org Tutorial Videos

Rainer König is producing a series of video tutorials on Org mode. Each video is typically short—less than 10 minutes—and addresses a specific aspect of Org. If you're looking for an easy introduction to Org mode, this is what you want.

So far there are 8 videos1 but more are being added continually. There's a convenient “Play all” button that will play all the videos in order. The 8 videos are just under 57 minutes so you'll need to schedule some time but they're easy to watch and you can always watch them piecemeal during coffee breaks or other spare time.

Because each video focuses on a specific target, König is able to cover that topic in reasonable depth. As usual with these introductory tutorials, I was still able to learn something new. König's explanation of follow mode helped me understand the point of the functionality.

If you're an Org mode user or you're interested in learning about it, these videos are worth your time. They're an easy way to learn the basics or review what you already know. Highly recommended.



Since I wrote this on Thursday, König has added two more videos for a total of 10. The total running time is up to 77:15. It's probably a good idea to subscribe to the videos so that you'll be notified as he adds new ones.

Posted in General | Tagged , | Leave a comment

Copying Formatted Org Text to Other Apps

John Kitchin, who does a lot—most?—of his writing in Org mode sometimes wants to copy and paste Org text into other applications such as Word or the mail app. He wants more than just doing a verbatim copy, he wants the text to keep its formatting. Thus he wants links to appear as links instead of the Org markup for links, italics to appear as italics instead of text between slashes, and so on.

He noticed that this is what happens when you copy from, say, the browser, but not when you copy from Org. The answer, as this video explains, is to first convert the text to rich text format and then copy it to the clip board. After that, it can be pasted into the appropriate app.

Kitchin presents a bit of Elisp to take care of this on the Mac platform but it's easy to see how you can adapt it to use tools appropriate to whatever platform you're using. If you're unfortunate enough to sometimes need to paste Org data into Word, this is just what you need. It's easy to set up and pretty much seamless—other than assigning a key sequence to the code—to use.

Posted in General | Tagged , | Leave a comment

Keeping a Logbook or Journal

I ended yesterday's post by noting that if you maintain a daily journal or log of your activities, you can get a timesheet for free. But what if you aren't maintaining a log or journal? This

tweet inspired me to write about my journal, what's in it, and how I maintain it. You won't be surprised to learn that it's all Org based.

I've always maintained a log book in which I kept track of what I was doing and ideas or notes that I might want to remember later. I've always thought of it as a sort of Lab Notebook. Before Org, I kept everything in a quad ruled, bound computation book. That's a good solution but Org mode is much better.

Org capture makes it easy to make entries that are automatically filed according to day. The file is tree structured as1

* Year
** Month
*** Day
**** {time-stamped entries}

but the Org agenda search commands make it easy to jump to a particular date if I need to.

By far, the most important aspect of the journal is the tags. For example, every time I publish a blog entry it gets logged in my journal with a tag of blog. That makes it easy to find published blog posts, especially since each entry contains a link to the metadata for the post.

The tags make it possible to keep unrelated subject matter in the same file. For instance, I used to have a separate log file that I used to record events with other people that I might need to recall. A typical example is dealing with an account problem for some service. I can record the time and date of the call, who I talked to, and what the resolution of the problem was. Now I just add those entries to my journal with a tag of LOG. If the call was with my ISP, I add a tag of isp and then I can search the relevant entries by looking for entries with the tags LOG and isp.

Although I keep data in files other than my journal, I try to put as much as possible in That includes pretty much everything I do during the day and even what restaurant I have dinner at if I eat out. Using a single file makes it easy to search for items or to make large edits on the file2. If you aren't using a journal yet, I'd start with a single file until you discover that you need more. Once you get used to keeping the log, it will become second nature and you won't have to think about it. And you'll get a timesheet for free.



I use the org-capture template

("j" "Journal" entry (file+datetree "~/org/")
         "* %<%R: >%? %^g\n%t")

to make entries. That takes care of making the entry and querying me for a tag or tags. The %<%R: > records the time as HH:MM.


A typical example is fixing tags. Sometimes I'll accidentally use two nearly identical tags for the same event type and end up with several instances of each. It's easy to fix that by doing a query-replace on the entire journal file.

Posted in General | Tagged , | Leave a comment

Using Org as a Timesheet

The other day I saw this tweet

and thought it was pretty neat but I didn't know exactly how Woodbury was doing it. Part of the problem was that I didn't recognize the keywords :block and :step and couldn't find them in the Org documentation. So I asked Duck Duck Go and was pointed to the documentation for clock tables.

The clock table is a dynamic block that you can add to an Org file that will extract clocking information from the file. Thus, if you keep a journal that includes your, say, work tasks and you clock the time spent on those tasks, at the end of the week or month or whatever your reporting period is, you can produce a detailed report of the tasks you worked on and how long you spent on them.

As you can see from the documentation, you can filter the data to include at a granular level (including by tags) and have flexibility in formatting the resulting table. If you're already keeping a daily journal or log report, you can start clocking your time spent on tasks if you aren't already and you get the time sheet for free. It's painless and powerful.

Posted in General | Tagged , | Leave a comment

Reproducible Research for R

Continuing with yesterday's theme of reproducible research, I'd like to point to this resource for reproducible research. I've written about this before but I just came across this tweet

that points the Rawal's GitHub page and after rereading it, I thought it was worthwhile pointing it out for others who may have missed it the first time.

Rawal is mostly concerned with statistics and R but there are a lot a very good tips on his page that are more generally applicable. If you are interested in using Org in your research or other scientific work, you should definitely take a look.

In the meantime, Karl Voit, in a comment to yesterday's post, points out a number of other reproducible research links on the Worg site. You should check those out as well.

Posted in General | Tagged , , | Leave a comment

A Complete Example of Reproducible Research with Org

Those of you who frequent Irreal know that I'm a big believer in reproducible research and that I'm particularly fascinated with how Org mode can be leveraged to produce it. In the past, I've pointed out some small examples of researchers doing this. The other day, I came across this tweet

that pointed me to a complete example.

Luka Stanisic, Arnaud Legrand and Vincent Danjean from the University of Grenoble have an excellent paper on leveraging git and Org mode for reproducible research in the ACM SIGOPS Operating Systems Review1. The paper recounts in significant detail the git/Org-based workflow that the three authors used to do the research for and publish a paper in the Proceedings of the 20th Euro-Par Conference.

One of the things that makes their account especially useful is that they provide access to the full git repository for their research and writing. You can see every step they took and how they took pains to record the experimental environment for later researchers.

If you have any interest at all in reproducible research or in using Org mode to assist in research and writing papers, you should definitely take a look at their paper. It's a complete, worked out example of reproducible research.



If you don't have access to the ACM Digital Library, there's a preprint of the paper here.

Posted in General | Tagged , | 1 Comment

Interacting with the Emacs Compile Buffer

Artur Malabarba, an exemplar of configuring Emacs to accommodate your workflow, solves a long standing problem with the Emacs compile command. Although the command is powerful, it doesn't allow you to interact with the build process.

Malabarba presents a bit of Elisp that allows the user to respond to requests for input from the build process. That turns out to be pretty easy to do—see Malabarba's post for the details.

Usually, inputting data to the build process isn't a problem—at least for the type of work I do. My makefiles do their work without any assistance from me but not all environments are like that. Malabarba uses Ruby as an example of where you sometimes need to help things along during the build process. If you have a environment that needs extra input, be sure to take a look at Malabarba's post. It may help you eliminate one more reason for having to leave Emacs for the shell.

Posted in General | Tagged | Leave a comment

Project Planning with Org Mode

Peter J. Jones has a really useful post on how he uses Org mode to do project planning. In his post he demonstrates some features of Org mode that you might not be familiar with. Chief among these is column view, which turns out to be really useful for visualizing and exporting data.

Jones begins by noting that the most important attribute of any project planning tool is that it use plain text. Use plain text and your data is never orphaned by lost or discontinued applications or by moving to a different platform. Org mode, of course, is one of the very best applications of this sort and is what Jones uses.

Jones starts his planning by listing the features of his project and then the tasks needed to complete each of the features. Once that's complete, he can assign time estimates to each task. This is easy to do in column view and Org will automatically total the times for each feature and for the total project. Once this is done, he exports the results into a basic proposal for management or a client.

As he works on the project, he clocks his time on each task and, again, this is shown in column view along with the state of each task. His post has several screen shots that show the various views as he proceeds with the project. He also includes the raw org file for the project so you can see how he did things and how he set up the columns for column view1. It serves as an excellent go-by if you're interested in doing your own project planning this way or even if you just want to see a nice example of using column view.



Be sure to look at the raw file and the Org documentation on capturing column views to see how he produced the Estimates section of his proposal.

Posted in General | Tagged , | Leave a comment