Making Design Documents with Org-mode

Christian Blades over at the Beard Institute has a nice post on how he uses Org-mode to write and manage design documents. One interesting feature of his workflow is that the document starts as a TODO item in his agenda and the details—including the text—get filled in as the document evolves. When he’s ready to share the document with the rest of his team, he exports the TODO subtree to PDF and uploads it to Google drive.

Since he’s exporting only a subtree, he puts the desired export options in a PROPERTIES drawer so that he can have per-document options if needed. That includes the file name for the PDF so he doesn’t have to manually rename the file before moving it to Google drive.

Another nice technique he uses is to decorate diagrams with sizing information so they aren’t overlarge. He does that with a bit of Elisp that gets called by the :post keyword in the source block that generates the diagram.

Take a look at Blades’ post for the details. It’s a nice workflow and one that would work for most kinds of documentation. It’s simple but seems very effective.

Posted in General | Tagged , | Leave a comment

Using C-x 4 in Emacs

Marcin Borkowski (mbork) has an interesting post on the Emacs C-x 4 bindings. My normal Emacs window configuration is two side-by-side windows in a full screen frame and my workflow often involves opening related buffers in the two windows so I am constantly using commands like find-file-other-window (Ctrl+x 4 f) and switch-to-buffer-other-window (Ctrl+x 4 b). All that’s by way of saying that I’m pretty familiar with the Ctrl+x 4 bindings. Nevertheless, I learned some new things from Borkowski’s post.

One of those new things is display-buffer (Ctrl+x 4 Ctrl+o). It’s sort of like find-file-other-window except that it doesn’t switch focus. That’s handy if you want to open a file in the other window but keep working in the current window.

Another new command I learned is clone-indirect-buffer-other-window (Ctrl+x 4 c). Cloning buffers is something I rarely do so I always forget the exact commands. This makes it easy to clone a buffer with a single key sequence.

Finally, there’s an infelicity. I always think of Ctrl+x 4 as meaning perform an action in the other window. Indeed, if you’re using which-key, and you should be, you’ll see that all the Ctrl+x 4 completions do perform some action in the other window. All, that is, except Ctrl+x 4 0. You’d think that it would delete the other window but it does something entirely different. It deletes the current window and its associated buffer. To my mind, that’s a blatant violation of the principle of least surprise.

Take a look at Borkowski’s post. He discusses additional Ctrl+x 4 commands and provides a deeper explanation of some of the commands I’ve mentioned.

Posted in General | Tagged | Leave a comment

Drawing Figures in Math Lectures

A month ago I wrote about Gilles Castel’s system for taking notes with LaTeX during Math lectures. As I wrote at the time, I was astounded that he could type the LaTeX fast enough to keep up with the lecturer. It turned out he used a snippet completion system and some Vim customizations to make it possible. Castel’s post didn’t explain how he drew the figures to go with the text.

Now Castel has published a second post that explains how he’s able to draw those figures. Take a look at either post to see some of those figures: they’re professional quality drawings rendered directly in the LaTeX.

Once again, he does this with some snippets and Vim customizations along with the use of Inkscape, a vector graphics editor that’s freely available for Linux, macOS, and Windows. As with entering the mathematical text, the secret of his speed is the aggressive optimization of keystrokes, including a Python program that filters his keystrokes before passing them onto Inkscape. Castel’s post has several animated GIFs that show the process in action.

Most or all of what’s he’s doing could easily be ported to Emacs/AUCTeX. A bit of Elisp could replace his first script and probably his Python filtering program although I’m not sure of the details for replacing the filtering program. If you’re interested on porting his system to Emacs and, say, macOS, it should be fairly easy to do the necessary research.

Posted in General | Tagged , | Leave a comment

Orgmode-TV: How I Plan My Days

Rainer König is back with another video. A few days ago, he published a blog post on how he uses Org-mode for his daily plan. The basic idea is that every morning he brings up an Org template for what he wants to accomplish that day. It starts with the three most important tasks followed by other things on his agenda and finally by recurring tasks such as housecleaning and grocery shopping.

Unfortunately, the blog post didn’t have many details and I remember hoping that he would do a video to fill in those details. Happily, he has made such a video and it does make clear exactly how his system works.

If you’re looking for a way of creating and tracking a daily plan, take a look at König’s video for some good ideas. It’s pretty easy to implement using the standard Org facilities. König has links to the (small amount of) custom elisp he wrote to help with the process so everything you need is there. The point of view of this video is slightly different from the first 36. Rather than explaining and demonstrating a particular Org-mode functionality, this video shows how he uses some of that functionality in his workflow. Like all of König’s videos, it’s worth watching.

Posted in General | Tagged , | Leave a comment

An Easy Tutorial for Setting Up Mu4e and Mbsync

Those of you who have been around for a while know that I’m a huge fan of mu/mu4e. I use it everyday to read and send all my email. You may also remember that I had a difficult time getting it installed and set up. Part of that is because I’m on a Mac and things are a little different there but even for Linux users configuring mbsync can be tricky.

Over at the Emacs subreddit, skizmi has a nice post that he advertises as mu4e for Dummies. It’s a succinct guide for installing and configuring mu, mu4e, and mbsync to handle multiple Gmail accounts. It’s a really handy resource if you’re trying to get mu4e working.

If you are thinking about moving to mu4e, I urge you to read Ben Maughan’s excellent post on how he uses mu4e. The TL;DR is that he acts on every email—perhaps by turning it into a TODO item to be handled later—right away and all emails that he keeps go into a single folder. The idea is to let mu’s fast and flexible search facilities locate whatever old email you need. I’ve been using his system for a couple of years and can tell you it’s absolutely faster and easier than trying to file emails into separate folders. Maughan has a series of mu4e tutorials that are also worth looking at.

I’ve used browser based mail readers, pine, mutt, iMail, and a bunch of others and mu4e is by far the most enjoyable and powerful. If you’re interested in trying it out, skizmi’s post is a good place to start.

Posted in General | Tagged , | Leave a comment

Literature Management with Emacs

I saw a query that had a link to a post from a couple of years ago that I missed at the time. It’s by Anand Iyer who is—or, perhaps, was—a graduate student and therefore is constantly reading papers. When you’re faced with reading and writing papers, one of the must-have tools is some sort of document management system.

Iyer’s solution is to use Emacs, Org-mode, John Kitchin’s org-ref, and Sebastian Christ’s interleave. I’ve written about all of those before but Iyer’s post ties them all together into a compelling workflow. If you haven’t already seen it, take a look at Kitchin’s video on org-ref. It shows how easy it is to add papers to your bibliography and—at the same time—download copies of the PDF.

Interleave lets you takes notes on the paper you’re reading. The notes are synchronized to the part of the paper they’re about. It’s a great way of making notes about a paper or, really, any PDF document.

Sadly, nothing can make reading or writing papers easy but using the tools Iyer discusses can largely automate most of the administrative chores. Iyer’s post is interesting and well worth a few minutes of your time. He has a section that shows you how easy it is to configure a basic system so you can get started using it right away.

Posted in General | Tagged , | Leave a comment

A Short Org Table Tutorial

Someone tweeted a link to this very nice Org table tutorial from 2013. Even though it’s fairly old, the information is still up to date and useful. I learned a couple of tricks that I either didn’t know or had forgotten. One such trick is how to add a line under the current row. I always struggle with that and end up doing it in a less than optimal fashion. It turns out to be simple: just type Ctrl+c -.

There are other shortcuts that you may not know about so it’s definitely worth a look. It can also serve as a cheat sheet so you might want to bookmark it if you do such things.

Posted in General | Tagged , | Leave a comment

Vivek Haldar on Why He’s Video Blogging

I’ve written a few times about Vivek Haldar’s Read A Paper videos. They’re vlogs that “read” a seminal paper in Computer Science. They’re really great. If I’ve already read the paper, that particular vlog serves to remind me of the details. If I haven’t read the paper, the vlog familiarizes me with the content and perhaps inspires me to read it on my own. If you don’t like actually reading papers, the series is a painless way to get many of the same benefits you would from reading them.

In a (regular) post, Haldar explains why he is vlogging and what he wants to accomplish. It’s a nice adjunct to the videos themselves. One of the things he said really resonated with me. He has, he says, deep misgivings about popular coverage of technology. We’ve all experienced that. Often, despite knowing better, we’re attracted by some click-baity headline about technology and discover that the story behind it is sensationalized, misrepresents the actual situation, or is flat out wrong. The only solution, Haldar says, is to read the source documents to get the real story.

Of course, that can be hard—or even impossible if it concerns a field of which we have no knowledge—so Haldar is trying to make reading some of the important papers in our field accessible by helping us through them. Dijkstra’s “Go To Statement Considered Harmful” paper is a good example: the advice to avoid gotos has become received wisdom but if you haven’t read the paper you won’t know his arguments and understand when using a goto is appropriate. Haldar’s video on the paper is an easy way to become conversant with Dijkstra’s arguments.

The videos are short and definitely worth watching when you have a few minutes.

Posted in General | Tagged | Leave a comment

Vivek Haldar: Global Variables

Vivek Haldar has been blogging up a storm with his video readings of seminal CS papers. I’ve written about a few of them but there’s lots more. See his blog for an up-to-date list. A recent post was about the paper Global variable considered harmful by Wulf and Shaw.

As suggested by the title, this paper has some connections with Djkistra’s famous paper Go To Statement Considered Harmful. The connections are much deeper than the shared title meme. Both papers argue that the construct they’re deprecating is harmful because it makes it difficult to understand the dynamic structure of a program.

The paper’s main argument is that variables should be scoped as locally as possible. When a function can have side effects—when it can modify variables that aren’t local to the function—the dynamic nature of the program becomes very difficult to understood. This is one of the principal arguments for functional programming. Wulf and Shaw go further, though, arguing for a stricter variable scoping that attempts to isolate the effects a variable change can have to as small an extent as possible. Take a look at Haldar’s video—or read the paper—for the details.

As with the admonition to avoid gotos, the idea that we should avoid global variables has become a sort of catechism that we recite but don’t understand. There are excellent reasons for the precept but if we don’t understand what they are, we can’t know when they don’t apply.

Posted in General | Tagged | Leave a comment

The Power of Vanilla Emacs

There’s an interesting blog post by bendersteed that discusses the power of vanilla Emacs. Emacs, he says, has a lot of useful packages but we shouldn’t underestimate the power of built-in commands that have nearly the same function. He notes, for example, that Magnar Sveen’s expand-region is a wonderful package but Emacs offers at set of commands (Meta+@, Meta+h, Ctrl+Meta+@, Ctrl+Meta+h, and Ctrl+x h) that do pretty much the same thing. Likewise, abbrev can perform many of the functions that yasnippet is often used for.

You may or may not be convinced to give up expand-region and yasnippet but bendersteed’s post is useful for two reasons. First, it serves as a reminder of that built-in functionality, which, in some circumstances, may be more appropriate than invoking the package and second, he’s got a nice section at the end of the post that lists some of the built-in functionality that he’s discovered. Two and a half years ago, I wrote about eww-search-words, which will search the Web for the highlighted region. I’d pretty much forgotten about it and that’s a shame because it’s really useful for checking a word that doesn’t appear in whatever local dictionary you’re using. It was nice to be reminded of it. That alone makes the post worth reading.

Posted in General | Tagged | Leave a comment