Scientific Writing with Zotero and Org Mode

Michael Behr has an interesting post on his scientific writing workflow. The post isn’t really about how he writes his papers but rather how he organizes and curates his research materials. As you’d expect, he uses an Org file to store links to research papers and take notes on them. If you’re an Org mode user you won’t have any difficulty imagining what this looks like.

What’s interesting about his workflow is that he use Zotero to capture and store copies of the papers he needs for his research. I used Zotero long ago when I was still using Vim and Zotero existed solely as a Firefox plugin. These days, it’s available as a standalone application as well so even if you’re not a Firefox user, you can still take advantage of it. One very nice aspect of Zotero is that it has Emacs integration so that you can interact with it from within Emacs. Behr’s post describes how this works and how he uses it.

I’m not sure how necessary Zotero is if you want a similar workflow. You can easily store the papers and link to them from within Org files without a separate application. You could, for example, use the org-attach command (see this video for an excellent introduction) to store and associate copies of the papers with an Org file. It appears that Zotero does make it a bit easier to retrieve papers but I’m pretty sure that a bit of Elisp could easily duplicate its capabilities. On the other hand, Zotero is already available and has nice integration so if you don’t mind the separate utility, it’s a good solution.

If you’re a student or researcher who needs to keep tract of papers, be sure to take a look at Behr’s post. His workflow is interesting and may give you some ideas.

Posted in General | Tagged , | Leave a comment

Zamansky 24: Org Capture (Part 2)

Mike Zamansky has another video up in his Using Emacs series. This one is a continuation of his last video on Org Mode capture. Most of the video explains how Zamansky pops up an Org capture buffer even if he’s not in Emacs. I use a similar method all the time and find it really useful. If I want to make a quick note or capture a browser link for a blog post, I just pop up the capture menu and use the appropriate template.

Zamansky’s method is better than mine because his pops up a temporary frame that is deleted when he saves the capture and leaves him back where he started. Mine switches to Emacs and displays the menu but I have to switch back to whatever I was doing after I save the capture. It’s a bit harder to pop up a capture buffer with MacOS because you have to use AppleScript. I think if I install a keyboard macro app I can duplicate Zamansky’s method so I’ll probably give that a try.

The other nice trick I learned from the video is obvious but I never thought of it. Zamansky maintains an Org file of useful browser links along with helpful commentary. He exports this to HTML and then saves the file as a browser bookmark. That way, he can click on the book mark to bring up the page of his links and then click on the appropriate link to visit the page he’s interested in. As I said, it’s obvious in retrospect but a great tip if you haven’t considered it.

Posted in General | Tagged , | Leave a comment

Awesome Emacs (Again)

I’ve written about the community sourced Awesome Emacs before but it’s worth revisiting it because

  1. It’s really useful.
  2. It’s always being added to.

This time, I ignored the Table of Contents and just read down the list of packages and other goodies. Being crowd sourced, it offers an up-to-date list of Emacs resources that reflects a broad cross sections of interests and needs. For instance, it covers packages and modes for languages such as

  • C/C++
  • Python
  • Ruby
  • Common Lisp
  • Scheme
  • Clojure
  • Elisp
  • JavaScript
  • CoffeScript
  • TypeScript
  • PureScript
  • PHP
  • Java
  • Go
  • C#
  • Rust
  • Erlang
  • Elixir
  • Haskell
  • Swift
  • Scala
  • Lua
  • SML
  • Groovy
  • OCaml
  • Nim
  • D
  • Elm
  • Stan

The packages in each category are listed more or less in the order of popularity so you can get an idea of how useful others have found a particular package. I like the list because it’s an easy place to surf for new and useful packages. You can do that with something like MELPA, of course, but that list is so large it can be intimidating. If you haven’t seen the list, take a moment to browse through it; you may find something useful.

Posted in General | Tagged | Leave a comment

Blub Programmers: Editor Division

The other day I saw this tweet

and immediately thought of Paul Graham's essay about Blub programmers. I don't mean to beat up on Mr. Littlebury, who I don't know but am sure is a splendid fellow. I do think, however, that rather than reveling in his lack of knowledge he might investigate why so many of the best engineers do use Vim or Emacs.

His main complaint appears to be that Vim and Emacs are old. To that point I recommend Vivek Haldar's observation that editors are like wine. You want an editor that's old because, as Haldar says, “You want the text editor that has been around long enough and used by enough geeks that every conceivable pattern of manipulating symbols on the screen has been thought of, and crystallized into a re-usable pack.”

We use a vintage editor not because of some weird retro fetishism but because we want the best possible tool to get the job done. And nano? Really? It's a great editor for people who don't use editors. It's definitely not what I have in mind when I think of powerful tools. On the other hand, it does, apparently, help protect you from the old ones.

Posted in General | Tagged | Leave a comment

Zamansky 23: Org Capture (Part 1)

Mike Zamansky has another video up. It’s number 23 in his Using Emacs Series and is part 1 of a sequence videos about Org capture. In this first installment, he covers the mechanics of Org capture: how to configure it, how to call it, and how to write your own custom capture templates.

If you’ve been around here for awhile, you know that the Org capture system is an integral part of my workflow. Like Zamansky, I record blog ideas with Org capture and use that entry as an anchor for the subsequent blog. After I write the actual blog post, I put a pointer to the blog text in the anchor entry as well as recording the time I worked on the post. Since each blog idea is a TODO item, my blog ideas file also tracks the state of the post: waiting to be started, ready to post, done, and so on. I should probably write about that process since it’s changed considerably since the last time I wrote about it.

I have several other templates that I use to capture journal entries, appointments, and other such information. All of this data is nicely displayed by the agenda system, which, presumably, Zamansky will talk about in his next video. The other strategy that I use is to insert tags into each entry. The capture templates prompt me for these so I don’t forget. The tags idea is something I learned from Karl Voit. The tags allow me to instantly display any entries with a certain tag. If, for example, I can’t remember the name of a nice restaurant I had dinner at last year, I can display all agenda items with a tag of dinner and quickly locate the entry that has the restaurant’s name.

It’s conventional wisdom that Org is Emacs’ killer app but the capture/agenda seem to be to be Org’s killer app. All my day-to-day planning and recording of events is centered around it and it fits in seamlessly with my workflow. If you aren’t using it take a look at Zamansky’s video (and the following ones on Org capture) and try it out for yourself. You won’t be sorry.

Posted in General | Tagged , | Leave a comment

Writing a format-like Function

Marcin Borkowski (mbork) has an interesting post on something I didn’t know about. He needed to write his own format-like function, presumably with %-tags not defined by the format function. It’s not too hard to write something like that but he asked about it on the Emacs help mailing list and got pointed to format-spec. That was just what he needed.

All the values are ultimately printed by princ so you can use it to print just about any Elisp object. You probably aren’t going to have a lot of use for format-spec but when you do need it, it’s just what you want. As Borkowski notes, you can use format-spec-make to help build the value list. I found the documentation for the two functions a bit ambiguous but the code is short and easy to read and resolved the questions I had about the functions.

Posted in General | Tagged | Leave a comment

Thoughts on Emacs Configuration

I sometimes feel that I have the most unorganized Emacs configuration strategy imaginable. I don’t worry about autoloading or other quick-loading strategies and I throw my entire configuration (other than machine and OS specific items) into my init.el file. All the really cool guys have their configurations broken out into separate files, carefully optimized for the smallest possible loading time.

I was, therefore, happy to discover that I’m not alone. Selah not only has the same strategy but argues that it’s the correct strategy. He used to obsess over Emacs loading times like the rest of us but realized that he spent far more time tweaking his configuration for optimal load time than he did waiting for it to load. That’s because like most of us he didn’t load it very often. He says he loads it only about twice a week. Even that seems like a lot to me. My Emacs instances generally run from a week to a month before I reload it because I get into an error condition or need to refresh a package. Reloading takes me about 5 seconds so it makes no sense worrying about reducing the time—except maybe as an interesting engineering problem.

Selah says that he likes everything in a single file because he doesn’t have to spend time remembering where things are as he did when he had everything broken out to multiple files. I like keeping everything in a single init.el for the same reason. Yes, you can locate things reasonably quickly with some form of grep or indexing (such as a TAGS file) but as Selah notes, that means you have to perform a context switch and think about something besides the problem you’re solving. The other advantage of having a single file is that it makes it easy to convert it to an annotated Org file. I haven’t done that yet but it’s on my TODO list.

UPDATE [2016-11-29 Tue 10:17]: Correct post’s author.

UPDATE [2016-11-30 Wed 12:41]: iniitinit.

Posted in General | Tagged | 8 Comments

Scrolling Left and Right

Hideo tweeted out a link

to this nice configuration by Shanthakumar. It’s a blog post written in Org mode that can be tangled to his init.el. It has some good ideas and is worth taking a look at.

One of the things in the configuration is a standard Emacs binding that I didn’t know about. You can scroll a window left or right with Ctrl+x < and Ctrl+x >. If you’re like me, you don’t often need to do that but I have one use case that comes up often: when I paste in the code for an embedded Tweet (like the above) it’s a long line. Sometimes I want to look at something in the middle of that line. I’ve been doing that by moving forward by word to get to the point I want to see. Moving by window length is much more efficient.

One thing to be wary of is that moving the screen left moves toward the right side of the screen—you’re moving the window not the cursor. Similarly for moving the screen right. I don’t know why I didn’t already know this but I’m glad to learn it.

Posted in General | Tagged | Leave a comment

The Iron Law and the Census

Not that we need another one but this 2007 Scientific American article has a frightening illustration of the Iron Law of Data Collection at work. Here in the U.S. the Constitution provides for a decennial census of the population in order to apportion members of the House of Representatives and direct taxes among the states. Over the years it's evolved from a simple head count into a nosy inquiry into such things as how many bathrooms each household has. Many people object to the snooping but there's been no organized resistance to it.

Despite years of pledges about confidentiality and specific denials about its use to round up Japanese-Americans during WWII, it turns out that that's exactly what happened. They had to change the law to allow the Census Bureau to release the information and for years the Census Bureau has insisted that they released only neighborhood information on Japanese-Americans but not the “microdata” about them. If you're familiar with the Iron Law, you won't be surprised to learn that that was a lie. Read the Scientific American article for the details.

You can understand why the Census Bureau would resist admitting this (other than an institutional sense of shame): if people felt that their personal information would be released whenever the government felt they had a good reason, they would be less forthcoming with that information. Then how would the government know how many bathrooms we had?

Posted in General | Tagged | Leave a comment

Mastering Emacs is 50% Off

The excellent Mastering Emacs is 50% off.

If you use Emacs, you really want this book. It’s been updated for Emacs 25 and is only $20 dollars while on sale.

UPDATE [2016-11-26 Sat 19:49]: matering → mastering

Posted in General | Tagged | 2 Comments