Making Slides with Org-reveal

Scott Nesbitt has an informative post on how to set up and use Reveal.js and Org-reveal for generating slide decks. There are several solutions for making slides that leverage Emacs and Org mode but Org-reveal is the simplest that I’ve seen. If you’re giving talks all the time, you should at least look at Beamer and it’s org interface but if you only occasionally need to generate slides and you’re looking for a simple, quick-start method, Org-reveal is just what you need.

Nesbitt’s post tells you how to install Reveal.js and Org-reveal. Note, though, that if you’re using ELPA, the name of the package is “ox-reveal” not “org-reveal.”

Once you’ve gotten Reveal.js and Org-reveal loaded, making a slide deck is simply at matter of writing an Org outline, where each headline corresponds to a slide. You can make subsidiary slides by using sub-headlines as described in the Org-reveal README on GitHub.

Nesbitt’s post shows you how to control the look of the slides and choose the transition technique. He also shows you how to include images. Check out the README for more detailed information such as how to include Mathematics, give slides headers, footers, and numbers, and a few other “advanced” techniques.

If you’re giving that talk tomorrow and don’t have time to waste, Nesbitt’s post will tell you all you need to know. If you have a bit more time, the README file in the Org-reveal repository will show you how to spruce the slides up.

Posted in General | Tagged , | Leave a comment

Batch Editing with ed

I’ve written before about the ed editor and the faithful who still use it today. A tweet by Mike Zamansky lead me to this Julia Evans post on batch editing files with ed. Evans has a typical editing problem: she wants to duplicate each line in several files that contain a certain string but also change the string to something else on the new line. See her post for the details.

She chose to do this by writing an ed script to make the change and then call ed with the script (presumably) as part of a larger shell script that does this for each file. My first thought was that this made sense even today because ed scripts have always been used in just this way and it’s still an easy and elegant solution. But then I got to wondering how I’d perform that task.

My inclination was to try some sort of Emacs trick, of course. Evans is a Vim user so she doesn’t have the awesome power of Emacs at her fingertips and can be forgiven for falling back to ed. Since we haven’t had an Emacs puzzle for a while, here’s a challenge: figure out how you’d use Emacs to get this done.

Zamansky, being less inclined to rush in, offers the following excellent Sed solution:

It’s probably hard to beat that solution even with Emacs but see what you can do.

Posted in General | Tagged , | Leave a comment

Spaces After Periods

I feel almost like a troll writing about this. The controversy as to whether there should be one space or two after a period is surely one of the most pointless of holy wars. Yet holy war it is. For those of you can came in late—that is, who grew up using computers instead of typewriters—the issue is whether typists should put one or two spaces after the period ending a sentence. The two spaces made sense for typewriters with their fixed-width fonts as it made the text slightly easier to read. When computers came along and everyone started using proportional fonts, the second space was no longer needed. At least that’s what the typography experts said.

Nonetheless, the debate raged on. Having learned to type on actual typewriters, I was for many years in the two space camp, if only out of habit. Around 2011, I changed to using a single space, adjusted my Emacs to recognize that as a sentence end (as related here), and have been happily conserving spaces ever since.

One of the reasons I say the argument is mostly pointless is that when documents are typeset, the composition software is probably going to ignore that extra space anyway. That’s something Avi Selk found out when he tried to insert an extra space in the headline to this Washington Post article on the controversy: it broke the formatting. And, sorry two-spacers, once he got it working it looked weird. Follow the link and see for yourself.

Both Selk’s article and a a similar one in Ars Technica by Sean Gallagher report the results of a study published in Attention, Perception, & Psychophysics that found two spaces slightly increased reading speed in some subjects.

Leaving aside the fact that the majority of psychological studies are not reproducible and therefore suspect, there’s plenty to criticize about this study on its own terms. Most glaringly, to me, is that the study tested its subjects using the fixed-width font Courier New 14. The researchers justified this on the grounds that the font was standard for this type of study but that misses the point: Of course the extra space helps with typewriter-like fonts. Everyone agrees about that; the question is does it make sense with proportional fonts. In any event, the modest increase in reading speed (≈ 10 words/minute) was seen only by those who used two spaces.

So the TL;DR is that we don’t really know more than we did before and the debate will continue unabated. The Washington Post article appears to favor the two-spacer camp while the Ars Technical article seems partial to the one-spacers. Go read both articles; there’s something for everyone.

Posted in General | Tagged , | Leave a comment

A Timestamp Hydra

It’s astounding how many “standard” formats there are for date/time stamps. Two or three years ago, I gave up my American provincialism on the matter and settled on the formats

  • 2018-05-09,
  • 2018-05-09 Wed, and
  • 2018-05-09 Wed 13:24.

I like them because they are unambiguous—unkike, say 10/11/12—and easy to parse programmatically. They also seem more logical because they move from the more general to the more specific. What kind of logical sense does “May 9, 2018” make?

Still, other folks prefer different formats such as ISO-8601, which I’d use except it confuses the civilians with the T and offset. Whatever your preferences, Grant Rettke has you covered with a hydra to generate timestamps in multiple formats. You may think it’s silly to have so many formats available but sometimes you’re dealing with entities that insist on a certain format and Rettke’s hydra let’s you use whatever’s appropriate. If your favorite format isn’t included, it’s trivial to add another.

Rettke leverages hydras for his workflow a lot and this is another excellent example of how their use can make your workflow easier. Some folks don’t like them but unless you fall into that category, you’ll probably find that they can ease your workflow by grouping similar tasks into a simple menu-driven interface.

Posted in General | Tagged | Leave a comment

SSH Tips

If you’re reading Irreal, the chances are that you’re also a frequent SSH user. Very often it’s because you have to log into servers or development boxes at work. I use it even at home to log into remote or local machines and, of course, for remote repositories.

One of the things that can be really annoying about using SSH, is remembering the domain and host names (which in some situations can even be an IP address) and dealing with the passwords. Happily, both of these problems are easily solved and Ivan Zinovyev tells you how.

Even better, Zinovyev gives you three other tips for making your SSH experience better. If you have long running (remote) applications or several connections to the same machine, Zinovyev shows you how to keep the session alive, even if the underlying connection goes down. He also shows you how to reuse a single SSH connection for multiple sessions.

None of this is hard and involves only a few additions to your ~/.ssh/config file, which you probably already have. If you’re using SSH, you should definitely take a look at Zinovyev’s post.

UPDATE [2018-05-10 Thu 18:41]: .sshr/config.ssh/config

Posted in General | Tagged | Leave a comment

Text Manipulation with Command Line Utilities

If your computing experience has always involved GUI tools, you may be unfamiliar or rusty with the command line tools that Unix provides. Similarly, if, like me, you do almost all your text manipulation from within Emacs, you might also be rusty with the command line tools. Happily, Kade Killary has a solution.

Killary has a very useful post entitled Command Line Tricks for Data Scientists that discusses those tools and how to use them for a variety of everyday text manipulation chores. Although the title mentions data scientists particularly, the information is useful for anyone manipulating data in their day-to-day work.

He covers the tools

  1. Iconv
  2. Head
  3. Tr
  4. Wc
  5. Split
  6. Sort & Uniq
  7. Cut
  8. Paste
  9. Join
  10. Grep
  11. Sed
  12. Awk

and gives examples of their use. For some of the tools, like Iconv and Head, he tells you everything you’ll ever need to know; for others, like Sed and Awk, he mentions just a few use cases and points you to the documentation for more details.

At the end of the post he gives a series of links to further information. One of those links points to this Sed introduction and tutorial. It’s the best tutorial on Sed I’ve seen so if you took the advice in my Sed post, you’ll definitely want to take a look and bookmark it.

Posted in General | Tagged , | Leave a comment

Emacs 26.1 Should Be Released Very Soon

Eli Zaretskii is asking the Emacs Devel list if there are any objections to releasing Emacs 26.1 in a week. That was on [2018-05-06 Sun] so we should be seeing the new Emacs soon. I’ve been running Emacs 26.1 RC1 for a while and haven’t had any problems. Some folks were pushing to get a couple more bug fixes in before the release but there doesn’t appear to be any show stoppers.

As always, congratulations to Eli, John, Nicolas, and the (many) others for their hard work. It’s really nice to have regular releases but it does mean a lot more work for the developers.

I almost missed this announcement but Sacha, as she often does, had me covered with her Emacs News list.

Posted in General | Tagged | Leave a comment

Elisp Guide

One of the questions that n00bs are always asking in Emacs venues is, “How can I get started with Emacs Lisp?” It’s a huge help if the requester has a little Lisp background, of course, but the real hurdle to my mind—others disagree—is learning the Elisp specific commands and idioms.

Chris Done has an excellent GitHub repository that contains an Elisp Guide. He assumes the reader has some programming experience but not necessarily that it’s Lisp experience. The guide covers many of the basic features of the language and is a good first look at Elisp programming. Done’s goal is to get the reader to the point that he can profitably read the manual.

If you’ve been wanting to try out Elisp or maybe just make a simple change to your configuration, this is a nice resource. As I say, it will get you to the point that you can fill in the blanks by reading the manual.

Posted in General | Tagged | Leave a comment

Org 9.1.13

Bastien tweets to let us know that there’s a new version of Org mode (a bug fix) available:

If you’re tracking Org with ELPA, it’s already available in the repository.

Posted in General | Tagged , | Leave a comment

A Handy Tip for Counsel/Swiper Users

Marcin Borkowski (mbork) has a very handy tip for Counsel and Swiper users. The idea is that if you want to search for the symbol at point, you need only type Meta+n to use it for the search target. This works for Swiper and the counsel grep functions such as counsel-rg, counsel-ag, etc. See Borkowski’s post for the details.

Posted in General | Tagged | Leave a comment