LaTeX Tip For Using Colon In Math Mode

The other day, I stumbled across a LaTeX tip over at John Cook’s TeX and Typography feed. For some reason, WordPress won’t let me embed it, so here it is.

The Tweet is about why you should use \colon instead of : in certain Math situations.
You can click on the Tweet to see the a couple of examples but here the first:

f: X \to Y \(f: X \to Y\)
f\colon X \to Y \(f\colon X \to Y\)

As you can see, in the first line the colon has equal spacing on both sides and doesn’t look quite right while in the second it’s flush up against the \(f\) with space on the right.

This might seem overly technical but if you’re trying to make your rendered mathematics look as nice as possible, it’s a technique worth knowing. I’m posting about this because I hadn’t seen it before.

Posted in General | Tagged | Leave a comment

Request For Your Garbage Collection Statistics

There’s been some discussion lately on the Emacs-devel mailing list about Emacs garbage collection. It’s pretty well known that Emacs GC uses old algorithms and is far from optimal. Part of improving the Emacs GC situation is understanding how the current GC implementation is behaving in the wild.

Ihor Radchenko has written a bit of Elisp to capture and store the GC statistics, which can be later uploaded to the developers working on this problem. He is asking Emacs users to install his package and run it to help gather information. The statistics are in plain text and can be viewed before sending them if you’re nervous about security. Additionally, you can view the source code before loading and running it.

This seems like a worthwhile project to me so please consider participating if you can. In the meantime, if you are experiencing delays for GC you might consider trying gcmh, a package that arranges for doing GC during idle times rather than when you’re actively using Emacs. I’ve used it for some time and never see any problems with GC delay.

In any event, if you’re willing and your employer doesn’t object try capturing and sharing your GC statistics to help improve Emacs.

Posted in General | Tagged | Leave a comment

Noweb as glue

Álvaro Ramírez has a revealing post about using noweb with Org mode in an unusual way. Most of us think of noweb as a way of doing Literate Programming. It enables the insertion of previously named text in another place. Ramírez reasoned that it would be a good way gluing the contents of Org blocks or their results into another block.

If you’re not familiar with the noweb system, the way you include a block—NAMED-BLOCK, say—is to put where you want to text to appear. Ramírez pointed out something I didn’t know: If you want the results of evaluating the block, rather than the verbatim contents, you can use instead.

Ramírez’s post has examples of both methods. The second, more complicated example shows how complex data generated in one block using Elisp can be included in another block using a different language. Even if, like me, you don’t know anything about Swift Charts, you won’t have any trouble following the process of using noweb to glue the results together.

There are, of course, other ways of doing this but using noweb is an easy method that doesn’t require remembering a lot of syntax.Take a look at the post for the details. It’s a nice technique.

Posted in General | Tagged , | Leave a comment

The Third Pretest For Emacs 29 Is Available

Eli Zaretskii writes to tell us that the Emacs developers have released the third pretest for Emacs 29. If you believe in history, it shouldn’t be long before the release candidates are available and shortly after that Emacs 29.1 itself. In the meantime, you can help speed things along by testing this release and reporting any problems back to the developers.

I always say—but it can’t be said enough—we all owe Eli and the other developers a big vote of thanks for their selfless work in keeping Emacs alive, thriving, and the best editor for those who want a complete work environment.

Posted in General | Tagged | Leave a comment

Org Mode Clock Checks

I’ve had this in my blog queue for sometime but before I could get to it, Sacha ran with it in her Emacs News post. I was going to forego mentioning it but after my Clocktables post, I decided that would be a useful adjunct to that post. After all, if you’re going to be using clocktables, you really should be sure that your clocking data is accurate and this post from Marcin Borkowski shows a nice way of helping to do this.

It turns out that the Org mode agenda has a builtin way of checking for anomalies in clock data. That means things like overly long clock intervals. Borkowski’s post talks about some of these cases and shows how to invoke the checks.

As Borkowski writes, you can check out the details by looking at the docstring of org-agenda-clock-consistency-checks but that function is defined with a defcustom so you’ll need to search for it in org-agenda.el directly.

Posted in General | Tagged , | Leave a comment

Setting Up emacs

Will Schenk has a post that may interest some of you. It’s about setting up a new Emacs instance. It’s not that he’s a n00b; he just wants to set up a nice clean instance. You can argue with his choice of themes and the packages that he chooses but the post is handy nonetheless.

He starts with installing emacs-plus from Homebrew along with the Roboto fonts. Then he disables package.el in favor of straight.el. Lots of folks have abandoned the default package.el in favor of straight.el or one of the other alternatives but I’ve never felt the need. The default system works well for me and I don’t need the pain of worrying about another package to wrangle my packages. Still, straight.el appears to be a good choice if you do feel the need for another package manager.

Next, he installs Org and counsel. Those are pretty much mandatory and I definitely agree with those choices. The last major decision is to install the Nano theme. I don’t use any theme, preferring to simply set my background to a light tan (oldlace) and otherwise use the Emacs defaults. I’ve been doing that for years and have never felt the need to change. But lots of people love Nano so if you’re looking for theme, you should take a look at it.

Schenk installs some other packages so be sure to take a look at his post to see what he’s decided on.

Posted in General | Tagged | Leave a comment

Red Meat Friday: A Conversation With An Emacs User

A conversation with a typical Emacs user:

Interview with an Emacs Enthusiast in 2033 [Colorized]
by u/miversen33 in emacs

What makes this so funny is that every outrageous statement the protagonist makes is something that we’d agree with. Sort of.

So this one is for all you Vim users and other heathen.

Posted in General | Tagged , | Leave a comment

The Other Shoe Drops

If you’re an inquisitive, rational person and haven’t been assimilated by one of the hive minds, you’ve always known deep down that COVID-19 resulted from a lab leak even if there was not yet any definitive evidence to prove that conclusion. If nothing else, you could tell from the furious dismissal of the notion by those who had the most to lose from that explanation. Once they floated the idea that the lab leak hypothesis was racist, it was all but certain that those pushing back were hiding something.

Now, it seems, the other shoe has dropped. Michael Shellenberger, Matt Taibbi, and Alex Gutentag have an article in Shellenberger’s Public substack that reports that “Patient 0” of the COVID-19 epidemic was Ben Hu a researcher at the Wuhan Institute of Virology who was working on—you guessed it—gain-of-function research.

Irreal has always felt and has often written that the best explanation for the lies and push back was given by Jamie Metzl who said,

“If the pandemic started as part of a lab leak, it had the potential to do to virology what Three Mile Island and Chernobyl did to nuclear science.”

Now it’s becoming clearer and clearer that a lab leak is exactly what happened. Virologists who resisted this conclusion will have a lot to answer for but not nearly as much as the outright liars in our government who deserve criminal prosecution for lying under oath and perhaps even for having a hand in unleashing this horror on the world. Matt Tiabbi has a separate article on the probable fallout of these revelations. Read both articles if only because so many people don’t want you to.

Posted in General | Tagged | Leave a comment

Define-keymap

Zachary Kanfer has a useful post for those of you who want to reduce to a bare minimum the amount of code you have to write to configure Emacs. Kanfer was bothered by all the boilerplate you have to enter to make a keymap so he decided to write a couple of functions that simplified the process. While getting ready to publish his code, he discovered define-keymap. It is, strictly speaking, an Emacs 29 functionality but Emacs 28 has the compat-29.el module that backports define-keymap and other functionality to older Emacs versions. The nice thing about it is that it removes all the complexity and boiler plate involved in making a key map. Basically all you do is list the bindings (as text strings) and the corresponding functions. It could hardly be easier.

Personally, I’ve never found the old way of defining keymaps that onerous—although it can be hard to remember the exact spell if you aren’t doing it all the time—so I’m not going to jump into using define-keymap but I could see myself using it if I needed a quick keymap and didn’t want to look up the make-keymap incantation.

If you’re on Emacs 29, Emacs 28, or possibly older versions, invoke describe-function on define-keymap to see all the details. If you’re into simplifying your init.el, take a look at Kanfer’s post to see one way of doing that.

Posted in General | Tagged | Leave a comment

Prot Video on Org Mode

After watching and writing about Protesilaos Stavrou’s video on searching and replacing in Emacs, I went back and watched his previous video on Org mode basics. Although I’m late to the party with this post, the video is interesting enough that I felt it was worth writing about.

Although Prot mostly restricts himself to Org mode markup, he does his usual comprehensive coverage of the material. He starts with explaining the emphasis markers (bold, italics, etc.) and gives an excellent explanation of the difference between verbatum and code. Although these both render the same in every export format I know of, it’s perfectly reasonable that some new exporter could render them differently.

Most of the rest of the video considers optimal ways of entering text in an Org buffer. He starts with headings and shows how to add additional headers at the same or lower levels, mark them as TODO items, and how to promote and demote a heading’s level. One of the most interesting things that I learned about was org-indent-mode. It provides a virtual display of an Org buffer in which headings, subheadings, lists, sublists, and other constructs are indented according to their level. The underlying file is unchanged so the exporters don’t get confused by manually added indentation. Although Prot doesn’t mention it, you can make the mode persist by adding indent to the #+STARTUP keyword in the header.

As with all of Prot’s videos, this one is well worth your time. You’ll probably learn a thing or two even if you’re already familiar with Org markup. The video is 48 and a half minutes so you’ll need to schedule some time but it’s worth it.

Posted in General | Tagged , | Leave a comment