Using an ODT Style Sheet With Org Mode

Over at the Emacs Notes blog there’s an interesting tutorial on how to style ODT output when exporting from Org-mode. The tutorial uses the “problem” of producing a manuscript for a novel. That’s a good example because literary publishers like to pretend that we’re still using typewriters and the manuscripts, in addition to having a highly stylized format, are most often rendered in Courier.

The tutorial shows an example of the output you’d get from Org normally and then the desired format you get after adding some XML definitions to your Org file. It’s very much like adding HTML definitions for exporting to the Web. The process is a bit complicated but the tutorial steps you through what has to be done.

Most of us aren’t writing novels, of course, but many of us do have to produce ODT files either as an end product or to accommodate our colleagues. That’s not a problem until the document needs special formatting. This tutorial tells you how to make a style sheet to do this. If you’re producing the same type of document many times, you need only to do this once.

If you’re interested in learning how to control the formatting of Org-mode ODT output, this tutorial is definitely worth taking a look at. The author did a lot of research and hunted up information that’s hard to find. Reading it will save you a lot of time.

Posted in General | Tagged , | Leave a comment

Emacs: The Editor for All Seasons

Derek Taylor is a Linux vlogger who was, apparently, undecided between Emacs and Vim. He likes them both, and he and I are in agreement that they are the two editors for serious developers. He’s been using Emacs more lately—although with Doom so he hasn’t really abandoned Vim—and has become one with the force. So much so that one of his recent videos declares that he replacing all his programs with Emacs.

That’s a bit of hyperbole, of course, but he does say that the more he uses Emacs the more he wants to use it for everything. As regular Irreal readers know, I can sympathize. I’m down to essentially Emacs and Safari for almost all my work and am eagerly looking forward to the day when I can ditch the browser.

The video itself explains why he feels this way and shows some (but not all) of the Emacs features that he’s using to replace other programs. He takes a look at Org-mode, dired, mu4e, elfeed, and eww. He also mentions, but does not demonstrate, magit and emms.

The video is just shy of 12 minutes so you’ll probably need to schedule some time. If you or someone you know is wondering what Emacs has to offer and whether you should give it a try, this video may help you decide.

Posted in General | Tagged | Leave a comment

Elfeed for Videos

As you all know, I’m a huge fan of Elfeed. It’s made reading my feeds a breeze, works just the way I want it to, and, of course, runs inside Emacs. You probably also know that I’m not a Google fan and even though there are several YouTube series that I follow, I don’t like to subscribe to them and expose my interests to Google’s advertising behemoth.

Josh Rollins has a nice post on Elfeed that describes how to track YouTube channels without subscribing. That’s handy for the same reason it’s handy with blogs and other feeds: you don’t have to check in everyday with your YouTube channels. You just add them to Elfeed and let it notify when there’s something new you may want to watch.

Privacy is enhanced because you’re not running in your browser. Rollins uses MPV to view the videos but you can use whatever you want; you’ll just have to adjust the Elisp that he describes. His rendition is derived from one by Noonker.

If you’re an Emacser and read RSS feeds, you should definitely be using Elfeed. I’ve said that every since I started using it but now that I know you can also use it to keep track of YouTube videos I’m going to double down on that recommendation.

Posted in General | Tagged , | Leave a comment

Red Meat Friday: Is Dark Mode a Good Idea?

Those pesky Irreal minions are at it again. They can’t let a Friday go by without trying to bring up the light-mode/dark-mode debate. Alas, they’ve succeeded again. After the last time, I had a discussion with them but they were recalcitrant and insisted they would carry on until the whole world comes to know the superiority of light-mode.

Kev Quirk was a dark-mode adherent and believed everything that its supporters were saying. But then he did a bit of research and discovered that what he believed wasn’t necessarily true and that maybe dark-mode wasn’t such a good idea.

He looked at three common beliefs and discovered that two were wrong and one was only correct in very specific (uncommon) situations. You can read the details in Quirk’s post but below is a précis of three misconceptions about dark-mode.

1 Dark-mode is easier to read

Except that it isn’t. It turns out the humans were evolved to hunt during the day and have much greater visual acuity when looking at dark objects against a light background. Actual tests show that for people with normal vision, it’s easier to read and understand material displayed in light-mode.

2 Dark-mode reduces eyestrain

This also turns out not to be true. In fact, according to the research mentioned above, it’s actually blue light, not blinking, small fonts, eye problems such as astigmatism, and not taking breaks from reading that causes eye strain. In general, your eyes are happier when they’re getting lots of light, as they do when you’re using light-mode.

3 Dark-mode uses less power

Maybe. If you have an OLED/AMOLED display and if the sites you visit have an all-black background then dark-mode my save you a bit of power. The problem is that most displays aren’t OLED/AMOLED and most sites don’t use an all-black background even in dark-mode.

Posted in General | Tagged | Leave a comment

Monitors

Nikita Prokopov has a very informative post about computer monitors and how they influence our programming experiences. It’s a long post that begins with an excellent tutorial on how monitor resolution effects the display of characters and the various mitigating techniques that have traditionally been used to compensate for low resolution monitors.

Mitigating techniques, Prokopov says, can only make horrible rendering a bit less horrible but still poor. It’s an important issue for programmers because what we do involves looking at text all day and it’s important that that text be rendered as clearly as possible if only to prevent things like eye strain. If you think it’s an abstract issue, consider that Prokopov says that more than 40% of programmers are using monitors with inadequate resolution and that it’s time to upgrade.

That’s not the end of the story though. The best monitors are those like the Apple Retina but even those won’t deliver optimal performance without some tweaking of the settings. The most valuable part of his post for me was that he provides a step by step procedure for adjusting those settings. This is mainly of use to macOS and Windows users because he doesn’t address the procedures for Linux users, although you can probably extrapolate.

I followed his suggestions on my MacBook Pro and am pleased with the results. One of the suggestions means that you have about 15% less screen real estate but the text is clearer and a bit larger so I’m finding it easier to read and the modest loss of screen space is worth it to me.

You may have a different calculus, of course, but it costs nothing to experiment. If you don’t like the changes you can simply restore the defaults. Whatever you decide, it’s worthwhile taking a look at Prokopov’s post to see what the possibilities are. We spend our days staring at a screen so it makes sense to make the experience as pleasant as possible.

Posted in General | Tagged | Leave a comment

Fixing Email

From time to time I read a piece by some pundit proclaiming that email is dead; that it’s been supplanted by texting, Facebook, and other social media. Such pieces are, of course, ridiculous but it is true that the usual suspects are doing their best to ensure we can’t have nice things. It started with spam, moved on to scams, and finally became yet another way for Google and Google wannabes to track us so they can target us with advertisements.

David Heinemeier Hansson and Jason Fried co-founders of Basecamp believe Email is too valuable to lose but that Google, Microsoft, and Verizon effectively control the email infrastructure. They’ve started a crusade to rescue email by rebuilding it from the ground up. They have a new application called Hey that aims to fix some of email’s problems. You can read the article above for the details but the thing I can’t get out of my mind is how widespread the use of tracking pixels are in modern email. Everyone, it appears, are using them. The original idea was to implement the “read receipt” functionality but, of course, that’s been subverted to send a bunch of information about the reader back to some server.

I short circuit a lot of this by using mu4e to read my emails in ASCII but a distressing number of emails today really do have to be read as HTML. As soon as I do that, the tracking pixels kick in. Hey has the splendid feature that it blocks tracking pixels. If you’re interested in maintaining some privacy and preserving email, take a look at Hey. It still hasn’t launched but they are taking signups.

Posted in General | Tagged , | Leave a comment

Another One Falls

MIT has just ended negotiations with Elsevier on a new journals contract. Many institutions are doing that but MIT and the University of California, which also ended negotiations, are in the top tier of research institutions in the US and even the world. Elsevier can put on a happy face and predict dire consequences for those Universities but loosing MIT and UC has got to smart.

As far as dire consequences go, there’s been little evidence of them so far. Florida State University, for example, has seen dramatic decreases in their Library costs. The MIT statement doesn’t mention it, of course, but you can be pretty sure that their researchers will deal with the subscription cutoff by using Sci-Hub and Library Genesis instead. There are, to be sure, ethical issues with using pirate sites but most researchers are fed up with the journal publishers and won’t hesitate to use them if it’s the only way to get a paper.

I keep thinking that the publishers have got to fold and acknowledge that they have to replace their current lucrative business model but they keep doubling down. In the worst case, they won’t capitulate until academics refuse to publish in their journals and stop providing free labor. Of course, that also means that Universities would have to rethink their tenure rules, which won’t happen easily. Still, I don’t see how they can hold out much longer. Open access is a movement whose time has come.

Posted in General | Tagged | Leave a comment

Zamansky 73: Ripgrep

Mike Zamansky has another great video up in his Using Emacs Series. This time it’s about using ripgrep to do some refactoring of his blog. The problem is that for reasons explained in the video, he upgraded Hugo—his blog software—and installed a new theme. The new Hugo broke the embedding of his videos and tweets and to fix things he needed to wrap the HTML code for the embeddings in a #+begin_export html, #+end_export pair. Further complicating things is that the Org sources for the posts were scattered across multiple directories.

Ripgrep to the rescue. It will search recursively into all subdirectories looking for matches to the regex that you give it. The results, of course, are gathered in an output buffer that can be made editable. Once the changes are made to the ripgrep output buffer, they will be saved to the original files. Zamansky chose to make the changes with a keyboard macro, which worked out well. Once he saved the buffer, his blog posts with embedded videos or tweets started working again.

Zamansky installed the rg.el package to act as his Emacs interface to ripgrep. I prefer to use the Ivy/Counsel interface, council-rg. It has nice integration with Ivy and is essentially the only grep-like tool I use. It’s built into Ivy/Swiper/Counsel, so if you’re using Swiper, you already have it installed. I have it bound to Ctrl+c k because I use it so often. It has the other nice feature that if a file is a member of Git repository, it will begin the search at the repository root. That turns out to be very handy.

The video is 13 minutes, 40 seconds long so you’ll need to schedule some time. As usual with Zamansky’s videos, it’s well worth your time. And you’ll get to see his nifty new theme.

Posted in General | Tagged | Leave a comment

Org Table Export

Here’s an interesting tip from John D. Cook’s TeX and Typography Twitter feed:

The idea is that you can take an Org-mode table and export the corresponding LaTeX. That’s not as pointless as it seems because the TeX/LaTeX syntax for tables is, at least for me, hard to remember and using the Org table editor to layout the table is much easier to do. It also covers the case where you want to use an existing Org table in a LaTeX document, of course.

Realistically, this is not something I’d expect to get a lot of use because you might as well just write in Org to begin with but if you need to deliver some (human formatted) LaTeX or you just like using AUCTeX but hate laying out tables in it, this might be just what you need.

In any event, I hadn’t seen it before and it seemed worth sharing.

Posted in General | Tagged , | Leave a comment

Consistent Documents Redux

Just a quickie today. Recently, someone tweeted a link to Mike Hamrick’s terrific video on making consistent documents with Emacs and Org-mode. I’ve written about the video before but having rewatched it, I decided that it was worth revisiting. There’s a boatload of good ideas and information in the video and you should definitely watch it even if you’ve already seen it.

Two of the really excellent things Hamrick discusses are Fabrice Niessen’s CSS for exporting an Org document into beautiful HTML and the use of a utility file for functions that can be called from the Org document. The last is really useful for functions that you don’t want to include in the document itself but just use to produce some text for the document.

There are links to all the code and Hamrick’s configuration in case you want to import his ideas directly into your workflow. If you’re using Org-mode to write any sort of document, you really need to take a look at this video.

Posted in General | Tagged , | Leave a comment