keytheorems[auto-qed] with zref-clever

An automatic QED end mark

A little while ago I wrote a rant about zref-clever, ntheorem, and texlive 2025, and how this part of my tex infrastructure is sort of falling apart. Well, I'm happy to report that there is now a good replacement for ntheorem! I worked with the author of the keytheorems package to add an end mark functionality that we called auto-qed!

The auto-qed functionality is very similar to the thmmarks option of ntheorem, with some significant differences in implementation and minor differences in output. I spent some effort to explain it as clearly as possible in the documentation (Section 8, Automatic QED placement). So, I'll refer there for more explanation along those lines.

Tex sample

If you already know you want a thing like this, I've posted a tex sample that you can download and copy/paste for your own use. Currently this consists of the following files:

  • environments-zrc-kthm.sty: necessary packages, configuration, and some useful helper macros
  • sample-kthm-zrc.tex: usage demonstration
  • sample-kthm-zrc.pdf: compiled output
Note that these require the new auto-qed option, available in version 0.4.0 now on ctan!

Some history

While working on this I learned a part of the history of end marks. The tradition of marking the ends of proofs goes back to Euclid's Elements, where he wrote a certain Greek phrase that was later abbreviated as Q.E.D. in the Latin translations. But Euclid apparently also used a different phrase at the end of "constructions" which, in the Latin translations, was abbreviated Q.E.F. (F for faciendum) meaning "that which was to be done".

You can find both Q.E.D. and Q.E.F., with basically this explanation (and with the three periods each), in Heath's English edition of Elements. There was maybe also a third ending, Q.E.I. (I for inveniendum = "to be found"), but I couldn't find a more detailed explanation of that.

The earliest tex package to support \QED (Paul Taylor's QED.sty) also has macros for \QEF and \QEI. That was the first place I heard of these.

I take all this to mean that, even from the very beginning of the QED end mark, it has always made sense to also mark the ends of other environments! Now that there is better support for doing this automatically in general—not just for proofs—I hope more people will take advantage of it.

tags: maybe-blog | info

Site Info

icon CCicon BYicon NC The content of nilesjohnson.net is licensed under CC BY-NC 4.0.